Machinelearning: there's an alternative to the TextLoader class?I would like to add the data to the pipeline without to use a file. Regards

Created on 3 Jul 2018  路  2Comments  路  Source: dotnet/machinelearning

System information

  • OS version/distro:
  • .NET Version (eg., dotnet --info):

Issue

  • What did you do?
  • What happened?
  • What did you expect?

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

question

Most helpful comment

Perhaps CollectionDataSource is what you need. Here's an example from the 0.2 release blog post.

var pipeline = new LearningPipeline();
var data = new List() {
           new IrisData { SepalLength = 1f, SepalWidth = 1f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=1},
           new IrisData { SepalLength = 1f, SepalWidth = 1f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=1},
           new IrisData { SepalLength = 1.2f, SepalWidth = 0.5f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=0}
           };
var collection = CollectionDataSource.Create(data);
pipeline.Add(collection); 

Hope that helps!

All 2 comments

Perhaps CollectionDataSource is what you need. Here's an example from the 0.2 release blog post.

var pipeline = new LearningPipeline();
var data = new List() {
           new IrisData { SepalLength = 1f, SepalWidth = 1f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=1},
           new IrisData { SepalLength = 1f, SepalWidth = 1f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=1},
           new IrisData { SepalLength = 1.2f, SepalWidth = 0.5f 
                         ,PetalLength=0.3f, PetalWidth=5.1f, Label=0}
           };
var collection = CollectionDataSource.Create(data);
pipeline.Add(collection); 

Hope that helps!

Great, many thanks @jwood803

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rogancarr picture rogancarr  路  18Comments

jkotas picture jkotas  路  23Comments

TomFinley picture TomFinley  路  23Comments

Ivanidzo4ka picture Ivanidzo4ka  路  29Comments

TomFinley picture TomFinley  路  18Comments