Created
May 17, 2018 00:23
-
-
Save elbruno/247220ec155c8b152637beef8d5872c9 to your computer and use it in GitHub Desktop.
MLNetSaveModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var agesRangesCsv = "AgeRangeData.csv"; | |
var pipeline = new LearningPipeline(); | |
pipeline.Add(new TextLoader<AgeRangeData>(agesRangesCsv, separator: ",")); | |
pipeline.Add(new Dictionarizer("Label")); | |
pipeline.Add(new ColumnConcatenator("Features", "AgeStart", "AgeEnd")); | |
pipeline.Add(new StochasticDualCoordinateAscentClassifier()); | |
pipeline.Add(new PredictedLabelColumnOriginalValueConverter {PredictedLabelColumn = "PredictedLabel"}); | |
var model = pipeline.Train<AgeRangeData, AgeRangePrediction>(); | |
var modelFilePath = "AgeRangeDataModel.zip"; | |
model.WriteAsync(modelFilePath); | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment