You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better docs/samples for Data.SaveAsText & Data.SaveAsBinary #3661
I do classification of MS Office document, in my case feature generation is relatively slow process, that why I want to do in once and save my data set to file like data.tsv and then experiment with different models and parameters.
the next thing that I expect is to be able to save all my data in file in format supported by LoadFromTextFile method (to be able reuse IrisInputAllFeatures class in both places), like
Data.SaveToTextFile("DataSet.tsv",dataSet);
Is there a way to save data to the file based on ColumnName, LoadColumn attributes?
I don't think ML.NET has an api to save the data.
The best way to go about it is to use C# csv libraries to save the data in csv format.
We can probably add such API. Adding the enhancement label.
@najeeb-kazmi Thank you, it was not easy to find at all.
Looks like we can save & load IDataView to text or binary format
varmlContext=newMLContext();IEnumerable<IrisInputAllFeatures>myData=GenerateData();IDataViewdataView=mlContext.Data.LoadFromEnumerable(myData);// Save & Load from text fileusing(varstream=File.Create(textFileName))mlContext.Data.SaveAsText(data,stream);// Note: Here is important to use non-generic version of LoadFromTextFileIDataViewdataViewFromTextFile=mlContext.Data.LoadFromTextFile(textFileName);// Save & Load from binary fileusing(varstream=File.Create(binFileName))mlContext.Data.SaveAsBinary(data,stream);IDataViewdataViewFromBinFile=mlContext.Data.LoadFromBinary(binFileName);
@sfilipi Can we mark this issue as documentation improvement request?
Activity
sfilipi commentedon May 6, 2019
I don't think ML.NET has an api to save the data.
The best way to go about it is to use C# csv libraries to save the data in csv format.
We can probably add such API. Adding the enhancement label.
najeeb-kazmi commentedon May 6, 2019
@sfilipi Don't we have
MLContext.Data.SaveAsTextextension in the TextLoaderSaverCatalog?machinelearning/src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderSaverCatalog.cs
Line 189 in 205eb1d
sergey-tihon commentedon May 7, 2019
@najeeb-kazmi Thank you, it was not easy to find at all.
Looks like we can save & load
IDataViewto text or binary format@sfilipi Can we mark this issue as documentation improvement request?
Thanks @sfilipi & @najeeb-kazmi
[-]Data.SaveToTextFile[/-][+]Better docs/samples for Data.SaveAsText & Data.SaveAsBinary[/+]jwood803 commentedon May 7, 2019
Would #2811 help with the
SaveAsBinarypart?