1 write to Model
Microsoft.ML.Data (1)
MLContext.cs (1)
151
Model
= new ModelOperationsCatalog(_env);
319 references to Model
DnnAnalyzer (1)
DnnAnalyzer.cs (1)
32
var tensorFlowModel = mlContext.
Model
.LoadTensorFlowModel(modelPath);
Microsoft.Extensions.ML (3)
ModelLoaders\FileModelLoader.cs (1)
140
_model = _context.
Model
.Load(fs, out _);
ModelLoaders\UriModelLoader.cs (1)
146
_model = _context.
Model
.Load(stream, out _);
PredictionEnginePoolPolicy.cs (1)
37
_mlContext.
Model
.CreatePredictionEngine<TData, TPrediction>(_model);
Microsoft.Extensions.ML.Tests (1)
FileLoaderTests.cs (1)
52
var engine = context.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Microsoft.ML.AutoML (6)
AutoMLExperiment\AutoMLExperiment.cs (1)
47
_settings.Seed = ((IHostEnvironmentInternal)_context.
Model
.GetEnvironment()).Seed;
AutoMLExperiment\IMLContextManager.cs (1)
36
var seed = ((IHostEnvironmentInternal)_mainContext.
Model
.GetEnvironment()).Seed;
Experiment\Experiment.cs (2)
82
if ((_context.
Model
.GetEnvironment() as ICancelable).IsCanceled)
143
int? mainContextSeed = ((IHostEnvironmentInternal)_context.
Model
.GetEnvironment()).Seed;
Experiment\ModelContainer.cs (2)
29
_mlContext.
Model
.Save(model, modelInputSchema, fs);
45
model = _mlContext.
Model
.Load(stream, out var modelInputSchema);
Microsoft.ML.AutoML.Samples (10)
AutoFit\BinaryClassificationExperiment.cs (2)
45
mlContext.
Model
.Save(bestRun.Model, trainDataView.Schema, fs);
48
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<SentimentIssue, SentimentPrediction>(bestRun.Model);
AutoFit\MulticlassClassificationExperiment.cs (2)
46
mlContext.
Model
.Save(bestRun.Model, trainDataView.Schema, fs);
49
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<PixelData, PixelPrediction>(bestRun.Model);
AutoFit\RankingExperiment.cs (2)
53
mlContext.
Model
.Save(bestRun.Model, trainDataView.Schema, ModelPath);
56
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<SearchData, SearchDataPrediction>(bestRun.Model);
AutoFit\RecommendationExperiment.cs (2)
57
mlContext.
Model
.Save(bestRun.Model, trainDataView.Schema, ModelPath);
60
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<Movie, MovieRatingPrediction>(bestRun.Model);
AutoFit\RegressionExperiment.cs (2)
46
mlContext.
Model
.Save(bestRun.Model, trainDataView.Schema, fs);
49
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(bestRun.Model);
Microsoft.ML.AutoML.Tests (1)
MLContextManagerTests.cs (1)
40
((IHostEnvironmentInternal)childContext.
Model
.GetEnvironment()).Seed.Should().Be(10);
Microsoft.ML.Core.Tests (9)
UnitTests\TestCustomTypeRegister.cs (5)
193
ML.
Model
.Save(model, tribeDataView.Schema, "customTransform.zip");
194
modelForPrediction = ML.
Model
.Load("customTransform.zip", out var tribeDataViewSchema);
205
var engine = ML.
Model
.CreatePredictionEngine<AlienHero, SuperAlienHero>(modelForPrediction);
226
var trainedModel = ML.
Model
.Load(modelPath, out var dataViewSchema);
228
var engine = ML.
Model
.CreatePredictionEngine<AlienHero, SuperAlienHero>(trainedModel);
UnitTests\TestEntryPoints.cs (4)
1379
mlContext.
Model
.Save(model, data.Schema, modelPath);
4726
ML.
Model
.Save(transformer, data.Schema, countsModel);
4768
ML.
Model
.Save(transformer, data.Schema, countsModel);
6589
loadedModel = ml.
Model
.Load(stream, out var inputSchema);
Microsoft.ML.IntegrationTests (46)
Explainability.cs (2)
53
mlContext.
Model
.Save(model, data.Schema, modelAndSchemaPath);
54
loadedModel = mlContext.
Model
.Load(modelAndSchemaPath, out var schema);
ModelFiles.cs (27)
57
mlContext.
Model
.Save(model, data.Schema, modelPath);
104
mlContext.
Model
.Save(model, data.Schema, modelPath);
110
serializedModel = mlContext.
Model
.Load(file, out var serializedSchema);
115
var originalPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
116
var serializedPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, ScoreColumn>(serializedModel);
151
mlContext.
Model
.Save(transformerModel, data.Schema, modelAndSchemaPath);
156
mlContext.
Model
.Save(null, compositeLoaderModel, compositeLoaderModelPath);
160
mlContext.
Model
.Save(transformerModel, loader, loaderAndTransformerModelPath);
166
loadedTransformerModel = mlContext.
Model
.Load(fs, out var loadedSchema);
171
var t = mlContext.
Model
.LoadWithDataLoader(fs, out loadedCompositeLoader);
176
var t1 = mlContext.
Model
.Load(fs, out var s);
187
var t = mlContext.
Model
.Load(fs, out var s);
190
loadedTransformerModel1 = mlContext.
Model
.LoadWithDataLoader(fs, out var l);
241
trainedModel = mlContext.
Model
.Load(TestCommon.GetDataPath(DataDir, "backcompat", "modelwithoptionalcolumntransform.zip"), out dataViewSchema);
251
var model = mlContext.
Model
.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchemaDefinition: inputSchemaDefinition);
255
var model2 = mlContext.
Model
.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchema: dataViewSchema);
279
mlContext.
Model
.Save(model, loader, modelPath);
287
loadedModelWithLoader = mlContext.
Model
.LoadWithDataLoader(fs, out loadedLoader);
289
loadedModelWithoutLoader = mlContext.
Model
.Load(fs, out loadedSchema);
336
mlContext.
Model
.Save(model, loader, modelPath);
341
loadedModel = mlContext.
Model
.Load(fs, out loadedSchema);
361
mlContext.
Model
.Save(null, loader, modelPath);
392
mlContext.
Model
.Save(null, loaderWithEmbeddedModel, modelPath);
438
mlContext.
Model
.Save(model, loader, modelPath);
463
mlContext.
Model
.Save(model, loader.GetOutputSchema(), modelPath);
481
loadedWithSchema = mlContext.
Model
.Load(fs, out loadedSchema);
484
loadedWithLoader = mlContext.
Model
.LoadWithDataLoader(fs, out loadedLoaderWithTransformer);
ONNX.cs (9)
53
mlContext.
Model
.ConvertToOnnx(model, data, file);
64
var originalPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
65
var onnxPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel);
103
mlContext.
Model
.ConvertToOnnx(model, data, file);
115
var originalPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(model);
117
var onnxPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxWorkaroundPipeline);
155
mlContext.
Model
.ConvertToOnnx(model, data, file);
162
var originalPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
164
var onnxPredictionEngine = mlContext.
Model
.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel);
Prediction.cs (6)
57
var engine = mlContext.
Model
.CreatePredictionEngine<TweetSentiment, Prediction>(model);
70
var newEngine = mlContext.
Model
.CreatePredictionEngine<TweetSentiment, Prediction>(newModel);
89
var engine = mlContext.
Model
.CreatePredictionEngine<TypeTestData, Prediction>(model);
94
var newEngine = mlContext.
Model
.CreatePredictionEngine<TypeTestData, Prediction>(newModel);
110
var engine = mlContext.
Model
.CreatePredictionEngine<TypeTestData, Prediction>(model, new PredictionEngineOptions());
130
engine = mlContext.
Model
.CreatePredictionEngine<TypeTestData, Prediction>(model, options);
SchemaDefinitionTests.cs (2)
46
var engine1 = _ml.
Model
.CreatePredictionEngine<InputData, OutputData>(model1, outputSchemaDefinition: outputSchemaDefinition);
50
var engine2 = _ml.
Model
.CreatePredictionEngine<InputData, OutputData>(model2, outputSchemaDefinition: outputSchemaDefinition);
Microsoft.ML.OnnxTransformerTest (9)
DnnImageFeaturizerTest.cs (3)
237
ML.
Model
.Save(model, data.Schema, modelPath);
238
var loadedModel = ML.
Model
.Load(modelPath, out var inputSchema);
240
var predEngine = ML.
Model
.CreatePredictionEngine<ModelInput, ModelOutput>(loadedModel);
OnnxTransformTests.cs (6)
266
ML.
Model
.Save(model, data.Schema, tempPath);
267
var loadedModel = ML.
Model
.Load(tempPath, out DataViewSchema modelSchema);
317
ML.
Model
.Save(model, data.Schema, tempPath);
318
var loadedModel = ML.
Model
.Load(tempPath, out DataViewSchema modelSchema);
1084
ML.
Model
.Save(model, null, fs);
1088
loadedModel = ML.
Model
.Load(fs, out var schema);
Microsoft.ML.PerformanceTests (10)
HashBench.cs (1)
104
var estimator = _env.
Model
.Load(modelPath, out var schema);
PredictionEngineBench.cs (3)
64
_irisModel = env.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(model);
99
_sentimentModel = mlContext.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
133
_breastCancerModel = env.
Model
.CreatePredictionEngine<BreastCancerData, BreastCancerPrediction>(model);
StochasticDualCoordinateAscentClassifierBench.cs (1)
127
_predictionEngine = _mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(_trainedModel);
TextPredictionEngineCreation.cs (5)
38
_context.
Model
.Save(model, data.Schema, modelPath);
41
_trainedModel = _context.
Model
.Load(modelPath, out var inputSchema);
43
_trainedModelOldFormat = _context.
Model
.Load(Path.Combine("TestModels", "SentimentModel.zip"), out inputSchema);
49
return _context.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(_trainedModel);
55
return _context.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(_trainedModelOldFormat);
Microsoft.ML.Samples (60)
Dynamic\ModelOperations\OnnxConversion.cs (2)
72
mlContext.
Model
.ConvertToOnnx(transformer, originalData, stream);
80
mlContext.
Model
.ConvertToOnnx(transformer, originalData, customOpSetVersion, stream);
Dynamic\ModelOperations\SaveLoadModel.cs (3)
32
mlContext.
Model
.Save(model, dataView.Schema, "model.zip");
36
model = mlContext.
Model
.Load(file, out DataViewSchema schema);
39
var engine = mlContext.
Model
Dynamic\ModelOperations\SaveLoadModelFile.cs (3)
32
mlContext.
Model
.Save(model, dataView.Schema, "model.zip");
35
model = mlContext.
Model
.Load("model.zip", out DataViewSchema schema);
38
var engine = mlContext.
Model
Dynamic\TensorFlow\ImageClassification.cs (1)
42
using var model = mlContext.
Model
.LoadTensorFlowModel(modelLocation);
Dynamic\TensorFlow\TextClassification.cs (2)
63
using var tensorFlowModel = mlContext.
Model
.LoadTensorFlowModel(
119
var engine = mlContext.
Model
.CreatePredictionEngine<IMDBSentiment,
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachine.cs (1)
80
var engine = mlContext.
Model
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachineWithOptions.cs (1)
91
var engine = mlContext.
Model
Dynamic\Trainers\BinaryClassification\PermutationFeatureImportanceLoadFromDisk.cs (2)
33
mlContext.
Model
.Save(model0, data.Schema, modelPath);
36
var model = mlContext.
Model
.Load(modelPath, out var schema);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (3)
91
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
98
loadedModel = mlContext.
Model
.Load(file, out schema);
130
var predictionEngine = mlContext.
Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (3)
126
mlContext.
Model
.Save(trainedModel, testDataset.Schema,
133
loadedModel = mlContext.
Model
.Load(file, out schema);
156
var predictionEngine = mlContext.
Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (3)
116
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
123
loadedModel = mlContext.
Model
.Load(file, out schema);
152
var predictionEngine = mlContext.
Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (3)
108
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
115
loadedModel = mlContext.
Model
.Load(file, out schema);
139
var predictionEngine = mlContext.
Model
Dynamic\Trainers\MulticlassClassification\PermutationFeatureImportanceLoadFromDisk.cs (2)
41
mlContext.
Model
.Save(model0, data.Schema, modelPath);
44
var model = mlContext.
Model
.Load(modelPath, out var schema);
Dynamic\Trainers\Ranking\PermutationFeatureImportanceLoadFromDisk.cs (2)
40
mlContext.
Model
.Save(model0, data.Schema, modelPath);
43
var model = mlContext.
Model
.Load(modelPath, out var schema);
Dynamic\Trainers\Regression\PermutationFeatureImportanceLoadFromDisk.cs (2)
39
mlContext.
Model
.Save(model0, data.Schema, modelPath);
42
var model = mlContext.
Model
.Load(modelPath, out var schema);
Dynamic\Transforms\CalculateFeatureContribution.cs (1)
62
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<Data,
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
64
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<Data,
Dynamic\Transforms\CustomMappingSaveAndLoad.cs (2)
54
mlContext.
Model
.Save(transformer, data.Schema, "customTransform.zip");
55
var loadedTransform = mlContext.
Model
.Load("customTransform.zip", out
Dynamic\Transforms\CustomMappingWithInMemoryCustomType.cs (1)
49
var engine = mlContext.
Model
.CreatePredictionEngine<AlienHero,
Dynamic\Transforms\Text\ApplyCustomWordEmbedding.cs (1)
58
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
48
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\FeaturizeText.cs (1)
61
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\FeaturizeTextWithOptions.cs (1)
79
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\LatentDirichletAllocation.cs (1)
55
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\NormalizeText.cs (1)
37
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
61
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
60
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
69
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
66
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\RemoveDefaultStopWords.cs (1)
41
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\RemoveStopWords.cs (1)
40
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\TokenizeIntoCharactersAsKeys.cs (1)
39
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\TokenizeIntoWords.cs (1)
37
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData,
Dynamic\Transforms\TimeSeries\DetectAnomalyBySrCnn.cs (1)
96
model = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\DetectChangePointBySsa.cs (1)
105
model = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\DetectChangePointBySsaStream.cs (1)
109
model = ml.
Model
.Load(stream, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\DetectIidChangePoint.cs (1)
103
model = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\DetectIidSpike.cs (1)
88
model = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\DetectSpikeBySsa.cs (1)
99
model = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\Forecasting.cs (1)
79
modelCopy = ml.
Model
.Load(file, out DataViewSchema schema);
Dynamic\Transforms\TimeSeries\ForecastingWithConfidenceInterval.cs (1)
84
modelCopy = ml.
Model
.Load(file, out DataViewSchema schema);
Microsoft.ML.Samples.GPU (15)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
42
using var model = mlContext.
Model
.LoadTensorFlowModel(modelLocation);
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (2)
63
using var tensorFlowModel = mlContext.
Model
.LoadTensorFlowModel(
119
var engine = mlContext.
Model
.CreatePredictionEngine<IMDBSentiment,
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (3)
91
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
98
loadedModel = mlContext.
Model
.Load(file, out schema);
130
var predictionEngine = mlContext.
Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (3)
126
mlContext.
Model
.Save(trainedModel, testDataset.Schema,
133
loadedModel = mlContext.
Model
.Load(file, out schema);
156
var predictionEngine = mlContext.
Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (3)
116
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
123
loadedModel = mlContext.
Model
.Load(file, out schema);
152
var predictionEngine = mlContext.
Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (3)
108
mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
115
loadedModel = mlContext.
Model
.Load(file, out schema);
139
var predictionEngine = mlContext.
Model
Microsoft.ML.TensorFlow.Tests (51)
TensorFlowEstimatorTests.cs (7)
81
using var model = ML.
Model
.LoadTensorFlowModel(modelFile);
123
using var model = ML.
Model
.LoadTensorFlowModel(modelFile);
165
.Append(ML.
Model
.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"));
208
.Append(ML.
Model
.LoadTensorFlowModel(modelLocation, false).ScoreTensorFlowModel("Output", "Input"));
222
.Append(ML.
Model
.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"));
288
TensorFlowModel model1 = context.
Model
.LoadTensorFlowModel(modelFile1);
289
TensorFlowModel model2 = context.
Model
.LoadTensorFlowModel(modelFile2);
TensorflowTests.cs (44)
151
.Append(_mlContext.
Model
.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"))
164
var predictFunction = _mlContext.
Model
.CreatePredictionEngine<CifarData, CifarPrediction>(transformer);
199
using var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
291
using var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
413
using var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
510
using var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
556
using var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
669
.Append(_mlContext.
Model
.LoadTensorFlowModel("mnist_model/frozen_saved_model.pb").ScoreTensorFlowModel(new[] { "Softmax", "dense/Relu" }, new[] { "Placeholder", "reshape_input" }))
682
var predictFunction = _mlContext.
Model
.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
711
.Append(_mlContext.
Model
.RetrainDnnModel(
732
var predictionFunction = _mlContext.
Model
.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
824
.Append(_mlContext.
Model
.RetrainDnnModel(
856
var predictFunction = _mlContext.
Model
.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
893
.Append(_mlContext.
Model
.LoadTensorFlowModel("mnist_model").ScoreTensorFlowModel(new[] { "Softmax", "dense/Relu" }, new[] { "Placeholder", "reshape_input" }))
908
var predictFunction = _mlContext.
Model
.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
1002
using var tensorFlowModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
1061
using var tensorFlowModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
1105
using var tensorFlowModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
1161
.Append(_mlContext.
Model
.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel("Output", "Input"))
1175
var predictFunction = _mlContext.
Model
.CreatePredictionEngine<CifarData, CifarPrediction>(transformer);
1185
_mlContext.
Model
.Save(transformer, data.Schema, mlModelLocation);
1191
var testTransformer = _mlContext.
Model
.Load(mlModelLocation, out loadedInputschema);
1196
var testPredictFunction = _mlContext.
Model
.CreatePredictionEngine<CifarData, CifarPrediction>(testTransformer);
1234
using TensorFlowModel model = _mlContext.
Model
.LoadTensorFlowModel(modelLocation);
1284
var dataPipe = _mlContext.
Model
.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(model);
1289
using var pipelineModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation).ScoreTensorFlowModel(new[] { "Prediction/Softmax" }, new[] { "Features" })
1292
using var tfEnginePipe = _mlContext.
Model
.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(pipelineModel);
1343
using var tensorFlowModel = _mlContext.
Model
.LoadTensorFlowModel(@"model_string_test");
1352
var transformer = _mlContext.
Model
.CreatePredictionEngine<TextInput, TextOutput>(pipeline.Fit(dataview));
1370
using var tensorFlowModel = _mlContext.
Model
.LoadTensorFlowModel(@"model_primitive_input_test");
1382
var transformer = _mlContext.
Model
.CreatePredictionEngine<PrimitiveInput, PrimitiveOutput>(pipeline.Fit(dataview));
1424
_mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
1430
loadedModel = _mlContext.
Model
.Load(file, out schema);
1527
_mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
1533
loadedModel = _mlContext.
Model
.Load(file, out schema);
1545
using var predictionEngine = _mlContext.
Model
1686
_mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
1692
loadedModel = _mlContext.
Model
.Load(file, out schema);
1704
using var predictionEngine = _mlContext.
Model
1817
_mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
1823
loadedModel = _mlContext.
Model
.Load(file, out schema);
1888
_mlContext.
Model
.Save(trainedModel, shuffledFullImagesDataset.Schema,
1894
loadedModel = _mlContext.
Model
.Load(file, out schema);
2060
using (var tfModel = _mlContext.
Model
.LoadTensorFlowModel(modelLocation))
Microsoft.ML.TestFramework (2)
DataPipe\TestDataPipeBase.cs (2)
83
ML.
Model
.Save(transformer, validFitInput.Schema, modelPath);
88
loadedTransformer = ML.
Model
.Load(fs, out loadedInputSchema);
Microsoft.ML.Tests (91)
CalibratedModelParametersTests.cs (6)
31
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
33
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
53
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
55
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
76
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
78
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
DatabaseLoaderTests.cs (5)
75
var engine = mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(model);
111
var engine = mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(model);
147
var engine = mlContext.
Model
.CreatePredictionEngine<IrisVectorData, IrisPrediction>(model);
179
var engine = mlContext.
Model
.CreatePredictionEngine<IrisVectorData, IrisPrediction>(model);
211
var engine = mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(model);
ImagesTests.cs (4)
86
ML.
Model
.Save(model, null, fs);
89
model2 = ML.
Model
.Load(fs, out var schema);
276
var engine = ML.
Model
.CreatePredictionEngine<ImageDataPoint, ImageDataPoint>(model);
1195
var predEngine = mlContext.
Model
.CreatePredictionEngine<InMemoryImage, InMemoryImageOutput>(model);
OnnxConversionTest.cs (11)
978
var onnxModel = mlContext.
Model
.ConvertToOnnxProtobuf(model, dataView, customOpSetVersion);
1506
var onnxModel = mlContext.
Model
.ConvertToOnnxProtobuf(model, dataView);
1731
mlContext.
Model
.ConvertToOnnx(mlmodel, dataView, stream, "Target1");
1796
mlContext.
Model
.ConvertToOnnx(model, reloadedData, stream);
1799
var onnxProtoBufModel = mlContext.
Model
.ConvertToOnnxProtobuf(model, reloadedData);
1818
mlContext.
Model
.ConvertToOnnx(model, mappedData, stream);
2036
mlContext.
Model
.ConvertToOnnx(model, dataView, 9, stream);
2049
mlContext.
Model
.ConvertToOnnx(model, dataView, 13, stream);
2060
var onnxModel = mlContext.
Model
.ConvertToOnnxProtobuf(model, dataView, 9);
2071
var onnxModel = mlContext.
Model
.ConvertToOnnxProtobuf(model, dataView, 13);
2243
var onnxModel = ML.
Model
.ConvertToOnnxProtobuf(model, dataView);
OnnxSequenceTypeWithAttributesTest.cs (2)
53
return ctx.
Model
.CreatePredictionEngine<FloatInput, OutputObj>(model);
92
return ctx.
Model
.CreatePredictionEngine<FloatInput, WrongOutputObj>(model);
PermutationFeatureImportanceTests.cs (20)
46
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
48
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
114
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
116
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
188
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
190
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
276
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
278
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
351
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
353
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
425
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
427
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
533
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
535
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
606
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
608
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
684
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
686
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
753
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
755
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (5)
198
mlContext.
Model
.Save(model, trainData.Schema, modelPath);
203
ITransformer loadedModel = mlContext.
Model
.Load(modelPath, out var schema);
280
var predictionFunc = mlContext.
Model
.CreatePredictionEngine<IrisInput, IrisPrediction>(model);
752
mlContext.
Model
.Save(model, cachedTrainData.Schema, modelPath);
762
ITransformer loadedModel = newContext.
Model
.Load(modelPath, out var schema);
Scenarios\Api\Estimators\DecomposableTrainAndPredict.cs (1)
40
var engine = ml.
Model
.CreatePredictionEngine<IrisDataNoLabel, IrisPrediction>(model);
Scenarios\Api\Estimators\Extensibility.cs (1)
49
var engine = ml.
Model
.CreatePredictionEngine<IrisDataNoLabel, IrisPrediction>(model);
Scenarios\Api\Estimators\MultithreadedPrediction.cs (1)
40
var engine = ml.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Scenarios\Api\Estimators\PredictAndMetadata.cs (1)
37
var engine = ml.
Model
.CreatePredictionEngine<IrisDataNoLabel, IrisPredictionNotCasted>(model);
Scenarios\Api\Estimators\SimpleTrainAndPredict.cs (2)
38
var engine = ml.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
77
var engine = ml.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Scenarios\ClusteringTests.cs (1)
73
var predictFunction = mlContext.
Model
.CreatePredictionEngine<ClusteringData, ClusteringPrediction>(trainedModel);
Scenarios\IrisPlantClassificationTests.cs (1)
49
var predictFunction = mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(trainedModel);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (1)
48
var predictFunction = mlContext.
Model
.CreatePredictionEngine<IrisDataWithStringLabel, IrisPredictionWithStringLabel>(trainedModel);
Scenarios\WordBagTest.cs (2)
39
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData, TransformedTextData>(textTransformer);
74
var predictionEngine = mlContext.
Model
.CreatePredictionEngine<TextData, TransformedTextData>(textTransformer);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (1)
50
var predictFunction = mlContext.
Model
.CreatePredictionEngine<IrisData, IrisPrediction>(trainedModel);
TrainerEstimators\CalibratorEstimators.cs (1)
259
oldPlattCalibratorTransformer = ML.
Model
.Load(fs, out var schema);
TrainerEstimators\LbfgsTests.cs (4)
122
ML.
Model
.Save(transformer, dataView.Schema, modelAndSchemaPath);
126
transformerChain = ML.
Model
.Load(fs, out var schema);
216
ML.
Model
.Save(transformer, dataView.Schema, modelAndSchemaPath);
221
transformerChain = ML.
Model
.Load(fs, out var schema);
TrainerEstimators\MatrixFactorizationTests.cs (1)
543
model = ML.
Model
.Load(fs, out var schema);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (4)
622
ML.
Model
.Save(model, null, fs);
625
loadedModel = ML.
Model
.Load(fs, out var schema);
679
ML.
Model
.Save(model, null, fs);
682
loadedModel = ML.
Model
.Load(fs, out var schema);
Transformers\ConvertTests.cs (1)
396
modelOld = ML.
Model
.Load(fs, out var schema);
Transformers\CopyColumnEstimatorTests.cs (2)
103
env.
Model
.Save(transformer, null, ms);
105
var loadedTransformer = env.
Model
.Load(ms, out var schema);
Transformers\HashTests.cs (2)
338
var model = ML.
Model
.Load(modelPath, out var _);
363
var model = ML.
Model
.Load(modelPath, out _);
Transformers\NormalizerTests.cs (3)
1006
var normalizer = ML.
Model
.Load(modelPath, out var schema);
1059
ML.
Model
.Save(model, data.Schema, modelAndSchemaPath);
1060
var loadedModel = ML.
Model
.Load(modelAndSchemaPath, out var schema);
Transformers\SelectColumnsTests.cs (4)
183
ML.
Model
.Save(transformer, null, ms);
185
var loadedTransformer = ML.
Model
.Load(ms, out var schema);
203
ML.
Model
.Save(transformer, null, ms);
205
var loadedTransformer = ML.
Model
.Load(ms, out var schema);
Transformers\TextFeaturizerTests.cs (2)
751
var model = ML.
Model
.Load(modelPath, out var inputSchema);
760
var engine = ML.
Model
.CreatePredictionEngine<SentimentData, SentimentPrediction>(model, inputSchema);
Transformers\ValueMappingTests.cs (2)
698
ML.
Model
.Save(transformer, null, ms);
700
var loadedTransformer = ML.
Model
.Load(ms, out var schema);
Microsoft.ML.TimeSeries.Tests (4)
TimeSeriesDirectApi.cs (4)
252
model2 = ml.
Model
.Load(file, out var schema);
272
model3 = ml.
Model
.Load(file, out var schema);
340
model2 = ml.
Model
.Load(file, out var schema);
495
modelCopy = ml.
Model
.Load(file, out DataViewSchema schema);