Implemented interface member:
property
Model
Microsoft.ML.IPredictionTransformer<TModel>.Model
3 writes to Model
Microsoft.ML.Data (3)
Scorers\PredictionTransformer.cs (3)
88
Model
= model;
103
Model
= model;
112
Model
= model; // prediction model
167 references to Model
Microsoft.ML.AutoML (2)
Sweepers\SmacSweeper.cs (1)
135
var predictor = trainer.Fit(data).
Model
;
Tuner\SmacTuner.cs (1)
149
var predictor = model.
Model
;
Microsoft.ML.Data (5)
Scorers\PredictionTransformer.cs (3)
51
private protected IPredictor ModelAsPredictor => (IPredictor)
Model
;
174
ctx.SaveModel(
Model
, DirModel);
193
(
Model
as IDisposable)?.Dispose();
TrainCatalog.cs (2)
296
return new BinaryPredictionTransformer<TModel>(Environment, model.
Model
, model.TrainSchema, model.FeatureColumnName, threshold, model.ThresholdColumn);
790
return new AnomalyPredictionTransformer<TModel>(Environment, model.
Model
, model.TrainSchema, model.FeatureColumnName, threshold, model.ThresholdColumn);
Microsoft.ML.FastTree (8)
TreeEnsembleFeaturizationEstimator.cs (6)
246
return trained.
Model
.SubModel;
289
return trained.
Model
;
332
return trained.
Model
;
375
return trained.
Model
;
418
return trained.
Model
;
461
return trained.
Model
;
TreeEnsembleFeaturizationTransformer.cs (2)
131
BindableMapper = new TreeEnsembleFeaturizerBindableMapper(host, _scorerArgs,
Model
);
162
ctx.SaveModel(
Model
, DirModel);
Microsoft.ML.IntegrationTests (41)
Explainability.cs (3)
101
var linearModel = model.LastTransformer.
Model
;
125
var treeModel = model.LastTransformer.
Model
;
152
var treeModel = model.LastTransformer.
Model
;
IntrospectiveTraining.cs (6)
46
var fastForestModel = model.LastTransformer.
Model
;
90
var fastTreeModel = model.LastTransformer.
Model
.SubModel;
151
var gamModel = model.LastTransformer.
Model
;
237
var linearModel = model.LastTransformer.
Model
;
408
kMeansModel.
Model
.GetClusterCentroids(ref centroids, out int nCentroids);
413
mcLrModel.
Model
.GetWeights(ref weights, out int classes);
Training.cs (32)
104
var firstModelWeights = firstModel.
Model
.Weights;
108
var firstModelWeightsPrime = firstModel.
Model
.Weights;
111
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
);
112
var secondModelWeights = secondModel.
Model
.Weights;
148
var firstModelWeights = firstModel.
Model
.GetLinearWeights();
152
var firstModelWeightsPrime = firstModel.
Model
.GetLinearWeights();
155
var secondModel = trainer.Fit(featurizedData, modelParameters: firstModel.
Model
);
156
var secondModelWeights = secondModel.
Model
.GetLinearWeights();
192
var firstModelWeights = firstModel.
Model
.Weights;
196
var firstModelWeightsPrime = firstModel.
Model
.Weights;
199
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
);
200
var secondModelWeights = secondModel.
Model
.Weights;
236
var firstModelWeights = firstModel.
Model
.SubModel.Weights;
240
var firstModelWeightsPrime = firstModel.
Model
.SubModel.Weights;
243
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
.SubModel);
244
var secondModelWeights = secondModel.
Model
.SubModel.Weights;
280
firstModel.
Model
.GetWeights(ref firstModelWeights, out int firstModelNumClasses);
285
firstModel.
Model
.GetWeights(ref firstModelWeightsPrime, out int firstModelNumClassesPrime);
288
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
);
290
secondModel.
Model
.GetWeights(ref secondModelWeights, out int secondModelNumClasses);
330
var firstModelWeights = firstModel.
Model
.Weights;
334
var firstModelWeightsPrime = firstModel.
Model
.Weights;
337
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
);
338
var secondModelWeights = secondModel.
Model
.Weights;
374
var firstModelWeights = firstModel.
Model
.Weights;
378
var firstModelWeightsPrime = firstModel.
Model
.Weights;
381
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
);
382
var secondModelWeights = secondModel.
Model
.Weights;
422
var firstModelWeights = firstModel.
Model
.SubModel.Weights;
426
var firstModelWeightsPrime = firstModel.
Model
.SubModel.Weights;
429
var secondModel = trainer.Fit(featurizedData, firstModel.
Model
.SubModel);
430
var secondModelWeights = secondModel.
Model
.SubModel.Weights;
Microsoft.ML.PerformanceTests (1)
KMeansAndLogisticRegressionBench.cs (1)
46
return model.LastTransformer.
Model
;
Microsoft.ML.Predictor.Tests (2)
TestIniModels.cs (2)
542
((ICanSaveInIniFormat)model.LastTransformer.
Model
).SaveAsIni(iniWriter, roleMappedSchema);
578
var calibratedPredictor = model.LastTransformer.
Model
;
Microsoft.ML.Recommender (2)
MatrixFactorizationPredictor.cs (2)
501
BindableMapper = ScoreUtils.GetSchemaBindableMapper(Host,
Model
);
535
ctx.SaveModel(
Model
, DirModel);
Microsoft.ML.Samples (21)
Dynamic\Trainers\BinaryClassification\Gam.cs (1)
48
var gam = model.
Model
.SubModel;
Dynamic\Trainers\BinaryClassification\GamWithOptions.cs (1)
56
var gam = model.
Model
.SubModel;
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportance.cs (1)
63
linearPredictor.
Model
.SubModel.Weights[i],
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (1)
62
linearPredictor.
Model
.SubModel.Weights[i], // this way we can access the weights inside the submodel
Dynamic\Trainers\Clustering\KMeans.cs (1)
77
var modelParams = model.
Model
;
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
85
var modelParams = model.
Model
;
Dynamic\Trainers\Regression\GamAdvanced.cs (1)
48
var gam = model.
Model
.SubModel;
Dynamic\Trainers\Regression\GamWithOptionsAdvanced.cs (1)
56
var gam = model.
Model
.SubModel;
Dynamic\Trainers\Regression\LightGbmAdvanced.cs (1)
53
model.LastTransformer.
Model
.GetFeatureWeights(ref weights);
Dynamic\Trainers\Regression\LightGbmWithOptionsAdvanced.cs (1)
62
model.LastTransformer.
Model
.GetFeatureWeights(ref weights);
Dynamic\Trainers\Regression\OrdinaryLeastSquaresAdvanced.cs (1)
58
var weightsValues = model.
Model
.Weights;
Dynamic\Trainers\Regression\OrdinaryLeastSquaresWithOptionsAdvanced.cs (1)
62
var weightsValues = model.
Model
.Weights;
Dynamic\Trainers\Regression\PermutationFeatureImportance.cs (1)
73
linearPredictor.
Model
.Weights[i],
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (1)
80
linearPredictor.
Model
.Weights[i],
Dynamic\Transforms\CalculateFeatureContribution.cs (3)
42
Console.WriteLine("Bias: " + linearModel.
Model
.Bias + " Feature1: " +
43
linearModel.
Model
.Weights[0] + " Feature2: " + linearModel.
Model
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (3)
44
linearModel.
Model
.SubModel.Bias,
45
linearModel.
Model
.SubModel.Weights[0],
46
linearModel.
Model
.SubModel.Weights[1]);
Dynamic\Transforms\TreeFeaturization\PretrainedTreeEnsembleFeaturizationWithOptions.cs (1)
57
ModelParameters = model.
Model
.SubModel, // Pretrained tree model.
Microsoft.ML.StandardTrainers (4)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (4)
342
int featCount =
Model
.FieldCount;
360
BindableMapper = ScoreUtils.GetSchemaBindableMapper(Host,
Model
);
404
ctx.SaveModel(
Model
, DirModel);
414
for (int i = 0; i <
Model
.FieldCount; i++)
Microsoft.ML.Sweeper (1)
Algorithms\SmacSweeper.cs (1)
148
return predictor.
Model
;
Microsoft.ML.Tests (80)
CalibratedModelParametersTests.cs (9)
39
Assert.Equal(expectedInternalType, castedModel.
Model
.GetType());
40
Assert.Equal(model.
Model
.GetType(), castedModel.
Model
.GetType());
61
Assert.Equal(expectedInternalType, castedModel.
Model
.GetType());
62
Assert.Equal(model.
Model
.GetType(), castedModel.
Model
.GetType());
84
Assert.Equal(expectedInternalType, castedModel.
Model
.GetType());
85
Assert.Equal(model.
Model
.GetType(), castedModel.
Model
.GetType());
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (3)
242
var modelParameters = trainedModel.LastTransformer.
Model
as MaximumEntropyModelParameters;
397
var linearModel = model.LastTransformer.
Model
;
432
var linearModel = model.LastTransformer.
Model
;
Scenarios\Api\Estimators\TrainWithInitialPredictor.cs (1)
44
var finalModel = ((ITrainer)secondTrainer).Train(new TrainContext(trainRoles, initialPredictor: firstModel.
Model
));
TrainerEstimators\FAFMEstimator.cs (1)
84
var anotherModel = est.Fit(data, data, model.
Model
);
TrainerEstimators\LbfgsTests.cs (9)
28
trainer.Fit(transformedDataView, model.
Model
.SubModel);
42
trainer.Fit(transformedDataView, model.
Model
);
54
trainer.Fit(dataView, model.
Model
);
65
var linearModel = transformerChain.LastTransformer.
Model
.SubModel as LinearBinaryModelParameters;
92
var linearModel = transformer.LastTransformer.
Model
.SubModel as LinearBinaryModelParameters;
129
var model = lastTransformer.
Model
;
172
var model = transformer.LastTransformer.
Model
as MaximumEntropyModelParameters;
194
var model = transformer.LastTransformer.
Model
as MaximumEntropyModelParameters;
224
model = lastTransformer.
Model
;
TrainerEstimators\MatrixFactorizationTests.cs (12)
90
Assert.Equal(model.
Model
.ApproximationRank, options.ApproximationRank);
91
var leftMatrix = model.
Model
.LeftFactorMatrix;
92
var rightMatrix = model.
Model
.RightFactorMatrix;
93
Assert.Equal(leftMatrix.Count, model.
Model
.NumberOfRows * model.
Model
.ApproximationRank);
94
Assert.Equal(rightMatrix.Count, model.
Model
.NumberOfColumns * model.
Model
.ApproximationRank);
818
int m = model.
Model
.NumberOfRows;
819
int n = model.
Model
.NumberOfColumns;
820
int k = model.
Model
.ApproximationRank;
826
var leftFactorMatrix = model.
Model
.LeftFactorMatrix;
834
rightFactorVectorAligned[i] = model.
Model
.RightFactorMatrix[1 * k + i]; // value at the i-th row and j-th column is indexed by i * k + j.
TrainerEstimators\OlsLinearRegressionTests.cs (5)
22
Assert.True(model.
Model
.HasStatistics);
23
Assert.NotEmpty(model.
Model
.StandardErrors);
24
Assert.NotEmpty(model.
Model
.PValues);
25
Assert.NotEmpty(model.
Model
.TValues);
28
Assert.False(model.
Model
.HasStatistics);
TrainerEstimators\OnlineLinearTests.cs (3)
32
ogdTrainer.Fit(regressionTrainData, ogdModel.
Model
);
47
apTrainer.Fit(binaryTrainData, apModel.
Model
);
53
svmTrainer.Fit(binaryTrainData, apModel.
Model
);
TrainerEstimators\SymSgdClassificationTests.cs (2)
26
trainer.Fit(transformedDataView, model.
Model
.SubModel);
40
modelParameters: initPredictor.
Model
.SubModel);
TrainerEstimators\TrainerEstimators.cs (2)
104
trainer.Fit(transformedDataView, model.
Model
.SubModel);
135
trainer.Fit(transformedDataView, model.
Model
);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (11)
46
var treeFeaturizer = new TreeEnsembleFeaturizerBindableMapper(Env, args, model.
Model
);
149
var treeFeaturizer = new TreeEnsembleFeaturizationTransformer(ML, dataView.Schema, dataView.Schema["Features"], model.
Model
.SubModel,
166
var leafId = model.
Model
.SubModel.GetLeaf(treeIndex, new VBuffer<float>(10, features[dataPointIndex]), ref path);
167
var leafValue = model.
Model
.SubModel.GetLeafValue(0, leafId);
200
var treeFeaturizer = new TreeEnsembleFeaturizationTransformer(ML, dataView.Schema, dataView.Schema["Features"], model.
Model
,
217
var leafId = model.
Model
.GetLeaf(treeIndex, new VBuffer<float>(10, features[dataPointIndex]), ref path);
218
var leafValue = model.
Model
.GetLeafValue(0, leafId);
260
ModelParameters = model.
Model
.SubModel,
281
var leafId = model.
Model
.SubModel.GetLeaf(treeIndex, new VBuffer<float>(10, features[dataPointIndex]), ref path);
282
var leafValue = model.
Model
.SubModel.GetLeafValue(0, leafId);
328
ModelParameters = treeModel.
Model
.SubModel
TrainerEstimators\TreeEstimators.cs (19)
123
Assert.Equal(sigmoid, -model.
Model
.Calibrator.Slope);
377
Assert.True(model.
Model
.SubModelParameters.All(predictor =>
754
var numOfSubParameters = (model.LastTransformer.
Model
as OneVersusAllModelParameters).SubModelParameters.Length;
761
numOfSubParameters = (model.LastTransformer.
Model
as OneVersusAllModelParameters).SubModelParameters.Length;
768
numOfSubParameters = (model.LastTransformer.
Model
as OneVersusAllModelParameters).SubModelParameters.Length;
914
var trainedTreeEnsemble = transformer.
Model
.TrainedTreeEnsemble;
916
var modelParameters = transformer.
Model
as ICanGetSummaryAsIDataView;
932
var trainedTreeEnsemble = transformer.
Model
.TrainedTreeEnsemble;
934
var modelParameters = transformer.
Model
as ICanGetSummaryAsIDataView;
950
var trainedTreeEnsemble = transformer.
Model
.TrainedTreeEnsemble;
952
var modelParameters = transformer.
Model
as ICanGetSummaryAsIDataView;
975
var trainedTreeEnsemble = transformer.
Model
.TrainedTreeEnsemble;
977
var modelParameters = transformer.
Model
as ICanGetSummaryAsIDataView;
993
var trainedTreeEnsemble = transformer.LastTransformer.
Model
.SubModel.TrainedTreeEnsemble;
995
var modelParameters = transformer.LastTransformer.
Model
.SubModel as ICanGetSummaryAsIDataView;
1011
var trainedTreeEnsemble = transformer.LastTransformer.
Model
.TrainedTreeEnsemble;
1013
var modelParameters = transformer.LastTransformer.
Model
as ICanGetSummaryAsIDataView;
1059
var trainedTreeEnsemble = transformer.LastTransformer.
Model
.SubModel.TrainedTreeEnsemble;
1061
var modelParameters = transformer.LastTransformer.
Model
.SubModel as ICanGetSummaryAsIDataView;
Transformers\CountTargetEncodingTests.cs (3)
87
.Append(ML.BinaryClassification.Trainers.AveragedPerceptron().WithOnFitDelegate(x => weights = x.
Model
.Weights));
95
.Append(ML.BinaryClassification.Trainers.AveragedPerceptron().WithOnFitDelegate(x => weightsNoNoise = x.
Model
.Weights));
104
.Append(ML.BinaryClassification.Trainers.AveragedPerceptron().WithOnFitDelegate(x => weightsNoNoise2 = x.
Model
.Weights));