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