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)
22private DefaultObjectPool<PredictionEngine<TData, TPrediction>> _pool; 40public ObjectPool<PredictionEngine<TData, TPrediction>> PredictionEnginePool { get { return _pool; } } 45Interlocked.Exchange(ref _pool, new DefaultObjectPool<PredictionEngine<TData, TPrediction>>(predictionEnginePolicy));
PredictionEnginePool.cs (5)
14/// Provides a pool of <see cref="PredictionEngine{TSrc, TDst}"/> objects 73public PredictionEngine<TData, TPrediction> GetPredictionEngine() 86public PredictionEngine<TData, TPrediction> GetPredictionEngine(string modelName) 123public void ReturnPredictionEngine(PredictionEngine<TData, TPrediction> engine) 137public void ReturnPredictionEngine(string modelName, PredictionEngine<TData, TPrediction> engine)
PredictionEnginePoolExtensions.cs (1)
44var predictionEngine = predictionEnginePool.GetPredictionEngine(modelName);
PredictionEnginePoolPolicy.cs (4)
11/// <see cref="PooledObjectPolicy{T}"/> for <see cref="PredictionEngine{TData, TPrediction}"/> 15: PooledObjectPolicy<PredictionEngine<TData, TPrediction>> 36public override PredictionEngine<TData, TPrediction> Create() => 40public override bool Return(PredictionEngine<TData, TPrediction> obj) => true;
Microsoft.Extensions.ML.Tests (1)
FileLoaderTests.cs (1)
52var engine = context.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Microsoft.ML.AutoML.Samples (5)
AutoFit\BinaryClassificationExperiment.cs (1)
48var predictionEngine = mlContext.Model.CreatePredictionEngine<SentimentIssue, SentimentPrediction>(bestRun.Model);
AutoFit\MulticlassClassificationExperiment.cs (1)
49var predictionEngine = mlContext.Model.CreatePredictionEngine<PixelData, PixelPrediction>(bestRun.Model);
AutoFit\RankingExperiment.cs (1)
56var predictionEngine = mlContext.Model.CreatePredictionEngine<SearchData, SearchDataPrediction>(bestRun.Model);
AutoFit\RecommendationExperiment.cs (1)
60var predictionEngine = mlContext.Model.CreatePredictionEngine<Movie, MovieRatingPrediction>(bestRun.Model);
AutoFit\RegressionExperiment.cs (1)
49var predictionEngine = mlContext.Model.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(bestRun.Model);
Microsoft.ML.Core.Tests (2)
UnitTests\TestCustomTypeRegister.cs (2)
205var engine = ML.Model.CreatePredictionEngine<AlienHero, SuperAlienHero>(modelForPrediction); 228var engine = ML.Model.CreatePredictionEngine<AlienHero, SuperAlienHero>(trainedModel);
Microsoft.ML.Data (5)
Model\ModelOperationsCatalog.cs (3)
312public PredictionEngine<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer, 329public PredictionEngine<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer, DataViewSchema inputSchema) 346public PredictionEngine<TSrc, TDst> CreatePredictionEngine<TSrc, TDst>(ITransformer transformer, PredictionEngineOptions options)
Model\PredictionEngineExtensions.cs (1)
28public 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)
115var originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model); 116var serializedPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(serializedModel); 251var model = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchemaDefinition: inputSchemaDefinition); 255var model2 = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(trainedModel, inputSchema: dataViewSchema);
ONNX.cs (6)
64var originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model); 65var onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel); 115var originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(model); 117var onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxWorkaroundPipeline); 162var originalPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, ScoreColumn>(model); 164var onnxPredictionEngine = mlContext.Model.CreatePredictionEngine<HousingRegression, VectorScoreColumn>(onnxModel);
Prediction.cs (5)
57var engine = mlContext.Model.CreatePredictionEngine<TweetSentiment, Prediction>(model); 70var newEngine = mlContext.Model.CreatePredictionEngine<TweetSentiment, Prediction>(newModel); 89var engine = mlContext.Model.CreatePredictionEngine<TypeTestData, Prediction>(model); 94var newEngine = mlContext.Model.CreatePredictionEngine<TypeTestData, Prediction>(newModel); 110var engine = mlContext.Model.CreatePredictionEngine<TypeTestData, Prediction>(model, new PredictionEngineOptions());
SchemaDefinitionTests.cs (2)
46var engine1 = _ml.Model.CreatePredictionEngine<InputData, OutputData>(model1, outputSchemaDefinition: outputSchemaDefinition); 50var engine2 = _ml.Model.CreatePredictionEngine<InputData, OutputData>(model2, outputSchemaDefinition: outputSchemaDefinition);
Microsoft.ML.OnnxTransformerTest (1)
DnnImageFeaturizerTest.cs (1)
240var predEngine = ML.Model.CreatePredictionEngine<ModelInput, ModelOutput>(loadedModel);
Microsoft.ML.PerformanceTests (6)
PredictionEngineBench.cs (3)
17private PredictionEngine<IrisData, IrisPrediction> _irisModel; 20private PredictionEngine<SentimentData, SentimentPrediction> _sentimentModel; 23private PredictionEngine<BreastCancerData, BreastCancerPrediction> _breastCancerModel;
StochasticDualCoordinateAscentClassifierBench.cs (1)
37private PredictionEngine<IrisData, IrisPrediction> _predictionEngine;
TextPredictionEngineCreation.cs (2)
47public PredictionEngine<SentimentData, SentimentPrediction> CreatePredictionEngine() 53public PredictionEngine<SentimentData, SentimentPrediction> CreatePredictionEngineFromOldFormat()
Microsoft.ML.Samples (26)
Dynamic\ModelOperations\SaveLoadModel.cs (1)
39var engine = mlContext.Model
Dynamic\ModelOperations\SaveLoadModelFile.cs (1)
38var engine = mlContext.Model
Dynamic\TensorFlow\TextClassification.cs (1)
119var engine = mlContext.Model.CreatePredictionEngine<IMDBSentiment,
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachine.cs (1)
80var engine = mlContext.Model
Dynamic\Trainers\BinaryClassification\FieldAwareFactorizationMachineWithOptions.cs (1)
91var engine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
130var predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
156var predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
152var predictionEngine = mlContext.Model
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
139var predictionEngine = mlContext.Model
Dynamic\Transforms\CalculateFeatureContribution.cs (1)
62var predictionEngine = mlContext.Model.CreatePredictionEngine<Data,
Dynamic\Transforms\CalculateFeatureContributionCalibrated.cs (1)
64var predictionEngine = mlContext.Model.CreatePredictionEngine<Data,
Dynamic\Transforms\CustomMappingWithInMemoryCustomType.cs (1)
49var engine = mlContext.Model.CreatePredictionEngine<AlienHero,
Dynamic\Transforms\Text\ApplyCustomWordEmbedding.cs (1)
58var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
48var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\FeaturizeText.cs (1)
61var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\FeaturizeTextWithOptions.cs (1)
79var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\LatentDirichletAllocation.cs (1)
55var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\NormalizeText.cs (1)
37var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
61var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
60var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
69var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
66var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\RemoveDefaultStopWords.cs (1)
41var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\RemoveStopWords.cs (1)
40var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\TokenizeIntoCharactersAsKeys.cs (1)
39var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Dynamic\Transforms\Text\TokenizeIntoWords.cs (1)
37var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData,
Microsoft.ML.Samples.GPU (5)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
119var engine = mlContext.Model.CreatePredictionEngine<IMDBSentiment,
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
130var predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
156var predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
152var predictionEngine = mlContext.Model
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
139var predictionEngine = mlContext.Model
Microsoft.ML.TensorFlow.Tests (13)
TensorflowTests.cs (13)
164var predictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(transformer); 682var predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel); 732var predictionFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel); 856var predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel); 908var predictFunction = _mlContext.Model.CreatePredictionEngine<MNISTData, MNISTPrediction>(trainedModel); 1175var predictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(transformer); 1196var testPredictFunction = _mlContext.Model.CreatePredictionEngine<CifarData, CifarPrediction>(testTransformer); 1284var dataPipe = _mlContext.Model.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(model); 1292using var tfEnginePipe = _mlContext.Model.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(pipelineModel); 1352var transformer = _mlContext.Model.CreatePredictionEngine<TextInput, TextOutput>(pipeline.Fit(dataview)); 1382var transformer = _mlContext.Model.CreatePredictionEngine<PrimitiveInput, PrimitiveOutput>(pipeline.Fit(dataview)); 1545using var predictionEngine = _mlContext.Model 1704using var predictionEngine = _mlContext.Model
Microsoft.ML.Tests (26)
DatabaseLoaderTests.cs (5)
75var engine = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(model); 111var engine = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(model); 147var engine = mlContext.Model.CreatePredictionEngine<IrisVectorData, IrisPrediction>(model); 179var engine = mlContext.Model.CreatePredictionEngine<IrisVectorData, IrisPrediction>(model); 211var engine = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(model);
ImagesTests.cs (2)
276var engine = ML.Model.CreatePredictionEngine<ImageDataPoint, ImageDataPoint>(model); 1195var predEngine = mlContext.Model.CreatePredictionEngine<InMemoryImage, InMemoryImageOutput>(model);
OnnxSequenceTypeWithAttributesTest.cs (4)
41public static PredictionEngine<FloatInput, OutputObj> LoadModel(string onnxModelFilePath) 60var predictor = LoadModel(modelFile); 80public static PredictionEngine<FloatInput, WrongOutputObj> LoadModelWithWrongCustomType(string onnxModelFilePath) 104var predictor = LoadModelWithWrongCustomType(modelFile);
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
280var predictionFunc = mlContext.Model.CreatePredictionEngine<IrisInput, IrisPrediction>(model);
Scenarios\Api\Estimators\DecomposableTrainAndPredict.cs (1)
40var engine = ml.Model.CreatePredictionEngine<IrisDataNoLabel, IrisPrediction>(model);
Scenarios\Api\Estimators\Extensibility.cs (1)
49var engine = ml.Model.CreatePredictionEngine<IrisDataNoLabel, IrisPrediction>(model);
Scenarios\Api\Estimators\MultithreadedPrediction.cs (1)
40var engine = ml.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Scenarios\Api\Estimators\PredictAndMetadata.cs (1)
37var engine = ml.Model.CreatePredictionEngine<IrisDataNoLabel, IrisPredictionNotCasted>(model);
Scenarios\Api\Estimators\SimpleTrainAndPredict.cs (2)
38var engine = ml.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model); 77var engine = ml.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model);
Scenarios\ClusteringTests.cs (1)
73var predictFunction = mlContext.Model.CreatePredictionEngine<ClusteringData, ClusteringPrediction>(trainedModel);
Scenarios\IrisPlantClassificationTests.cs (1)
49var predictFunction = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(trainedModel);
Scenarios\IrisPlantClassificationWithStringLabelTests.cs (1)
48var predictFunction = mlContext.Model.CreatePredictionEngine<IrisDataWithStringLabel, IrisPredictionWithStringLabel>(trainedModel);
Scenarios\WordBagTest.cs (2)
39var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData, TransformedTextData>(textTransformer); 74var predictionEngine = mlContext.Model.CreatePredictionEngine<TextData, TransformedTextData>(textTransformer);
ScenariosWithDirectInstantiation\IrisPlantClassificationTests.cs (2)
50var predictFunction = mlContext.Model.CreatePredictionEngine<IrisData, IrisPrediction>(trainedModel); 54private void ComparePredictions(PredictionEngine<IrisData, IrisPrediction> model)
Transformers\TextFeaturizerTests.cs (1)
760var engine = ML.Model.CreatePredictionEngine<SentimentData, SentimentPrediction>(model, inputSchema);