1 write to Host
Microsoft.ML.StandardTrainers (1)
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (1)
66
Host
= Contracts.CheckRef(env, nameof(env)).Register(name);
39 references to Host
Microsoft.ML.StandardTrainers (39)
Standard\MulticlassClassification\MetaMulticlassTrainer.cs (17)
67
Host
.CheckValue(options, nameof(options));
77
Calibrator = options.Calibrator.CreateComponent(
Host
);
87
Args.PredictorType.CreateComponent(
Host
) :
88
new LinearSvmTrainer(
Host
, new LinearSvmTrainer.Options());
93
Host
.AssertValue(type);
94
Host
.Assert(type.RawType == typeof(T));
95
Host
.AssertValue(equalsTarget);
96
Host
.AssertValue(data);
97
Host
.Assert(data.Schema.Label.HasValue);
102
dataView = new NAFilter(
Host
, data.Data, false, label.Name);
104
return LambdaColumnMapper.Create(
Host
, "Label mapper", data.Data,
119
Host
.CheckValue(context, nameof(context));
126
Host
.Assert(count > 0);
128
using (var ch =
Host
.Start("Training"))
143
Host
.CheckValue(inputSchema, nameof(inputSchema));
148
throw
Host
.ExceptSchemaMismatch(nameof(labelCol), "label", LabelColumn.Name);
151
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "label", LabelColumn.Name, LabelColumn.GetTypeString(), labelCol.GetTypeString());
Standard\MulticlassClassification\OneVersusAllTrainer.cs (12)
146
Host
.CheckValue(labelColumnName, nameof(labelColumnName), "Label column should not be null.");
160
return OneVersusAllModelParameters.Create(
Host
, _options.UseProbabilities, predictors);
182
calibratedModel = CalibratorUtils.GetCalibratedPredictor(
Host
, ch, Calibrator, transformer.Model, trainedData, Args.MaxCalibrationExamples) as TDistPredictor;
184
Host
.Check(calibratedModel != null, "Calibrated predictor does not implement the expected interface");
185
return new BinaryPredictionTransformer<TScalarPredictor>(
Host
, calibratedModel, trainedData.Data.Schema, transformer.FeatureColumnName);
188
return new BinaryPredictionTransformer<TScalarPredictor>(
Host
, transformer.Model, view.Schema, transformer.FeatureColumnName);
194
Host
.Assert(!label.IsHidden);
195
Host
.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double);
204
throw
Host
.ExceptNotSupp($"Label column type is not supported by OneVersusAllTrainer: {label.Type.RawType}");
221
using (var ch =
Host
.Start("Fitting"))
237
return new MulticlassPredictionTransformer<OneVersusAllModelParameters>(
Host
, OneVersusAllModelParameters.Create(
Host
, _options.UseProbabilities, predictors), input.Schema, featureColumn, LabelColumn.Name);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (10)
123
Host
.CheckValue(labelColumnName, nameof(labelColumnName), "Label column should not be null.");
142
return new PairwiseCouplingModelParameters(
Host
, predModels);
159
calibratedModel = CalibratorUtils.GetCalibratedPredictor(
Host
, ch, Calibrator, transformer.Model, trainedData, Args.MaxCalibrationExamples) as TDistPredictor;
161
return new BinaryPredictionTransformer<TDistPredictor>(
Host
, calibratedModel, trainedData.Data.Schema, transformer.FeatureColumnName);
167
Host
.Assert(!label.IsHidden);
168
Host
.Assert(label.Type.GetKeyCount() > 0 || label.Type == NumberDataViewType.Single || label.Type == NumberDataViewType.Double);
178
throw
Host
.ExceptNotSupp($"Label column type is not supported by nameof(PairwiseCouplingTrainer): {label.Type.RawType}");
198
using (var ch =
Host
.Start("Fitting"))
220
return new MulticlassPredictionTransformer<PairwiseCouplingModelParameters>(
Host
, new PairwiseCouplingModelParameters(
Host
, predictors), input.Schema, featureColumn, LabelColumn.Name);