Learning ML.NET(1): Building Learning Machine Pipeline with LearningPipeline The

LearningPipeline class is used to define the steps required to perform the required machine learning tasks, making the machine learning process intuitive.

Create a workflow

Create a LearningPipeline instance, add steps to the pipeline via the Add method, each step inherits from the ILearningPipelineItem interface.

where the blue part is an optional step.


Invoke the Training method of the LearningPipeline instance, you can get the prediction model PredictionModel<TInput,TOutput> according to the loaded and processed dataset.

var pipeline = new LearningPipeline();
pipeline.Add(new TextLoader <SentimentData> (dataPath, separator: ","));
pipeline.Add(new TextFeaturizer("Features", "SentimentText"));
pipeline.Add(new FastTreeBinaryClassifier());
var model = pipeline.Train<SentimentData, SentimentPrediction>();