Hi,
I want to load data from memory, so I can connect it with sql server, webservice etc.
pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ','));
but this is only method that I can find! It only works with file on the disk!
I want to add data from variable like:
string x = "116.76000,0.00000,116.76000,0.00000,116.76000,UP"
I hope it is possible right now?
Thanks advance!
If you're getting data from SQL or a web service and they are of IList, then the CollectionDataSource should be what you need.
There's an example in 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!
Thank you very much!
Most helpful comment
If you're getting data from SQL or a web service and they are of
IList, then theCollectionDataSourceshould be what you need.There's an example in the 0.2 release blog post:
Hope that helps!