1 instantiation of PredictionEngine
Microsoft.ML.Data (1)
Model\PredictionEngineExtensions.cs (1)
32
=> new
PredictionEngine
<TSrc, TDst>(env, transformer, ignoreMissingColumns, inputSchemaDefinition, outputSchemaDefinition, ownsTransformer);
121 references to PredictionEngine
Microsoft.Extensions.ML (14)
Builder\PredictionEnginePoolBuilder.cs (1)
13
/// of ML.NET <see cref="
PredictionEngine
{TData, TPrediction}"/> objects.
PoolLoader.cs (3)
22
private DefaultObjectPool<
PredictionEngine
<TData, TPrediction>> _pool;
40
public ObjectPool<
PredictionEngine
<TData, TPrediction>> PredictionEnginePool { get { return _pool; } }
45
Interlocked.Exchange(ref _pool, new DefaultObjectPool<
PredictionEngine
<TData, TPrediction>>(predictionEnginePolicy));
PredictionEnginePool.cs (5)
14
/// Provides a pool of <see cref="
PredictionEngine
{TSrc, TDst}"/> objects
73
public
PredictionEngine
<TData, TPrediction> GetPredictionEngine()
86
public
PredictionEngine
<TData, TPrediction> GetPredictionEngine(string modelName)
123
public void ReturnPredictionEngine(
PredictionEngine
<TData, TPrediction> engine)
137
public void ReturnPredictionEngine(string modelName,
PredictionEngine
<TData, TPrediction> engine)
PredictionEnginePoolExtensions.cs (1)
44
var
predictionEngine = predictionEnginePool.GetPredictionEngine(modelName);
PredictionEnginePoolPolicy.cs (4)
11
/// <see cref="PooledObjectPolicy{T}"/> for <see cref="
PredictionEngine
{TData, TPrediction}"/>
15
: PooledObjectPolicy<
PredictionEngine
<TData, TPrediction>>
36
public override
PredictionEngine
<TData, TPrediction> Create() =>
40
public override bool Return(
PredictionEngine
<TData, TPrediction> obj) => true;
Microsoft.Extensions.ML.Tests (1)
FileLoaderTests.cs (1)
52
var
engine = context.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Microsoft.ML.AutoML.Samples (5)
AutoFit\BinaryClassificationExperiment.cs (1)
48
var
predictionEngine = mlContext.Model.CreatePredictionEngine<SentimentIssue, SentimentPrediction>(bestRun.Model);
AutoFit\MulticlassClassificationExperiment.cs (1)
49
var
predictionEngine = mlContext.Model.CreatePredictionEngine<PixelData, PixelPrediction>(bestRun.Model);
AutoFit\RankingExperiment.cs (1)
56
var
predictionEngine = mlContext.Model.CreatePredictionEngine<SearchData, SearchDataPrediction>(bestRun.Model);
AutoFit\RecommendationExperiment.cs (1)
60
var
predictionEngine = mlContext.Model.CreatePredictionEngine<Movie, MovieRatingPrediction>(bestRun.Model);
AutoFit\RegressionExperiment.cs (1)
49
var
predictionEngine = mlContext.Model.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(bestRun.Model);
Microsoft.ML.Core.Tests (2)
UnitTests\TestCustomTypeRegister.cs (2)
205
var
engine = ML.Model.CreatePredictionEngine<AlienHero, SuperAlienHero>(modelForPrediction);
228
var
engine = ML.Model.CreatePredictionEngine<AlienHero, SuperAlienHero>(trainedModel);
Microsoft.ML.Data (5)
Model\ModelOperationsCatalog.cs (3)
312
public
PredictionEngine
<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer,
329
public
PredictionEngine
<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer, DataViewSchema inputSchema)
346
public
PredictionEngine
<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer, PredictionEngineOptions options)
Model\PredictionEngineExtensions.cs (1)
28
public static
PredictionEngine
<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(this ITransformer transformer,
Prediction\PredictionEngine.cs (1)
180
/// Options for the <see cref="
PredictionEngine
{TSrc, TDst}"/>
Microsoft.ML.IntegrationTests (17)
ModelFiles.cs (4)
115
var
originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
116
var
serializedPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(serializedModel);
251
var
model = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchemaDefinition: inputSchemaDefinition);
255
var
model2 = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchema: dataViewSchema);
ONNX.cs (6)
64
var
originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
65
var
onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel);
115
var
originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(model);
117
var
onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxWorkaroundPipeline);
162
var
originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model);
164
var
onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel);
Prediction.cs (5)
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());
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 (1)
DnnImageFeaturizerTest.cs (1)
240
var
predEngine = ML.Model.CreatePredictionEngine<ModelInput, ModelOutput>(loadedModel);
Microsoft.ML.PerformanceTests (6)
PredictionEngineBench.cs (3)
17
private
PredictionEngine
<IrisData, IrisPrediction> _irisModel;
20
private
PredictionEngine
<SentimentData, SentimentPrediction> _sentimentModel;
23
private
PredictionEngine
<BreastCancerData, BreastCancerPrediction> _breastCancerModel;
StochasticDualCoordinateAscentClassifierBench.cs (1)
37
private
PredictionEngine
<IrisData, IrisPrediction> _predictionEngine;
TextPredictionEngineCreation.cs (2)
47
public
PredictionEngine
<SentimentData, SentimentPrediction> CreatePredictionEngine()
53
public
PredictionEngine
<SentimentData, SentimentPrediction> CreatePredictionEngineFromOldFormat()
Microsoft.ML.Samples (26)
Dynamic\ModelOperations\SaveLoadModel.cs (1)
39
var
engine = mlContext.Model
Dynamic\ModelOperations\SaveLoadModelFile.cs (1)
38
var
engine = mlContext.Model
Dynamic\TensorFlow\TextClassification.cs (1)
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\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
130
var
predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
156
var
predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
152
var
predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
139
var
predictionEngine = mlContext.Model
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\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,
Microsoft.ML.Samples.GPU (5)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
119
var
engine = mlContext.Model.CreatePredictionEngine<IMDBSentiment,
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
130
var
predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
156
var
predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
152
var
predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
139
var
predictionEngine = mlContext.Model
Microsoft.ML.TensorFlow.Tests (13)
TensorflowTests.cs (13)
164
var
predictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(transformer);
682
var
predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
732
var
predictionFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
856
var
predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
908
var
predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel);
1175
var
predictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(transformer);
1196
var
testPredictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(testTransformer);
1284
var
dataPipe = _mlContext.Model.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(model);
1292
using
var
tfEnginePipe = _mlContext.Model.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(pipelineModel);
1352
var
transformer = _mlContext.Model.CreatePredictionEngine<TextInput, TextOutput>(pipeline.Fit(dataview));
1382
var
transformer = _mlContext.Model.CreatePredictionEngine<PrimitiveInput, PrimitiveOutput>(pipeline.Fit(dataview));
1545
using
var
predictionEngine = _mlContext.Model
1704
using
var
predictionEngine = _mlContext.Model
Microsoft.ML.Tests (26)
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 (2)
276
var
engine = ML.Model.CreatePredictionEngine<ImageDataPoint, ImageDataPoint>(model);
1195
var
predEngine = mlContext.Model.CreatePredictionEngine<InMemoryImage, InMemoryImageOutput>(model);
OnnxSequenceTypeWithAttributesTest.cs (4)
41
public static
PredictionEngine
<FloatInput, OutputObj> LoadModel(string onnxModelFilePath)
60
var
predictor = LoadModel(modelFile);
80
public static
PredictionEngine
<FloatInput, WrongOutputObj> LoadModelWithWrongCustomType(string onnxModelFilePath)
104
var
predictor = LoadModelWithWrongCustomType(modelFile);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
280
var
predictionFunc = mlContext.Model.CreatePredictionEngine<IrisInput, IrisPrediction>(model);
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 (2)
50
var
predictFunction = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(trainedModel);
54
private void ComparePredictions(
PredictionEngine
<IrisData, IrisPrediction> model)
Transformers\TextFeaturizerTests.cs (1)
760
var
engine = ML.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model, inputSchema);