Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment