Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Microsoft.ML.Data/Prediction/Calibrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
[assembly: LoadableClass(PlattCalibratorTrainer.Summary, typeof(PlattCalibratorTrainer), null, typeof(SignatureCalibrator),
PlattCalibratorTrainer.UserName,
PlattCalibratorTrainer.LoadName,
"SigmoidCalibration")]
"SigmoidCalibration", "Platt", "Sigmoid")]

[assembly: LoadableClass(FixedPlattCalibratorTrainer.Summary, typeof(FixedPlattCalibratorTrainer), typeof(FixedPlattCalibratorTrainer.Arguments), typeof(SignatureCalibrator),
FixedPlattCalibratorTrainer.UserName,
FixedPlattCalibratorTrainer.LoadName,
"FixedSigmoidCalibration")]
"FixedSigmoidCalibration", "FixedPlatt")]

[assembly: LoadableClass(PavCalibratorTrainer.Summary, typeof(PavCalibratorTrainer), null, typeof(SignatureCalibrator),
PavCalibratorTrainer.UserName,
Expand Down
23 changes: 23 additions & 0 deletions test/Microsoft.ML.Predictor.Tests/CmdLine/CmdLineReverseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
// See the LICENSE file in the project root for more information.

using System.Reflection;
using Microsoft.ML.Calibrators;
using Microsoft.ML.CommandLine;
using Microsoft.ML.Internal.Utilities;
using Microsoft.ML.Runtime;
using Microsoft.ML.TestFramework;
using Xunit;

namespace Microsoft.ML.RunTests
Expand Down Expand Up @@ -73,6 +76,26 @@ public void ArgumentParseTest()
Assert.Equal(innerArg3, testArg);
}

[Fact]
[TestCategory("Cmd Parsing")]
public void NewTest()
{
var ml = new MLContext();
ml.AddStandardComponents();
var classes = Utils.MarshalInvoke(ml.ComponentCatalog.FindLoadableClasses<int>, typeof(SignatureCalibrator));
foreach (var cls in classes)
{
var factory = CmdParser.CreateComponentFactory(typeof(IComponentFactory<ICalibratorTrainer>), typeof(SignatureCalibrator), cls.LoadNames[0]);
var calibrator = ((IComponentFactory<ICalibratorTrainer>)factory).CreateComponent(ml);
}
var components = ml.ComponentCatalog.GetAllComponents(typeof(ICalibratorTrainerFactory));
foreach (var component in components)
{
var factory = CmdParser.CreateComponentFactory(typeof(IComponentFactory<ICalibratorTrainer>), typeof(SignatureCalibrator), component.Aliases[0]);
var calibrator = ((IComponentFactory<ICalibratorTrainer>)factory).CreateComponent(ml);
}
}

private delegate void SignatureSimpleComponent();

private class SimpleArg
Expand Down