Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MLNetLoadFromList.cs
static void Main(string[] args)
{
var fileName = "AgeRanges.csv";
var pipeline = new LearningPipeline();
// standard load from file
pipeline.Add(new TextLoader(fileName).CreateFrom<AgeRange>(separator: ',', useHeader: true));
// load data from List<>()
var data = new List<AgeRange>
{
new AgeRange { Name = "John", Age = 12, Sex = "M", Label = "boy"},
new AgeRange { Name = "Laslo", Age = 2, Sex = "M", Label = "baby"},
new AgeRange { Name = "Mary", Age = 16, Sex = "F", Label = "teenager"},
new AgeRange { Name = "Gracie", Age = 6, Sex = "F", Label = "girl"}
};
var collection = CollectionDataSource.Create(data);
pipeline.Add(collection);
}
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.