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