Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MLNet050SampleProgram.cs
static void Main(string[] args)
{
var fileName = "AgeRanges.csv";
var pipeline = new LearningPipeline();
pipeline.Add(new TextLoader(fileName).CreateFrom<AgeRange>(separator: ',', useHeader: true));
pipeline.Add(new Dictionarizer("Label"));
pipeline.Add(new ColumnConcatenator("Features", "Age"));
pipeline.Add(new StochasticDualCoordinateAscentClassifier());
pipeline.Add(new PredictedLabelColumnOriginalValueConverter {PredictedLabelColumn = "PredictedLabel" });
var model = pipeline.Train<AgeRange, AgeRangePrediction>();
Predict(model, "john", 9, "M");
Predict(model, "mary", 14, "M");
Predict(model, "laura", 2, "M");
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.