Skip to content

Better docs/samples for Data.SaveAsText & Data.SaveAsBinary #3661

@sergey-tihon

Description

@sergey-tihon

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.

Let's say we I defined model class

private class IrisInputAllFeatures
{
    [ColumnName("Label"), LoadColumn(4)]
    public string IgnoredLabel { get; set; }

    [LoadColumn(0, 3)]
    public float Features { get; set; }
}

then I wrote the code that generate / export data

var dataSet = new [] {
   new IrisInputAllFeatures() { ... },
   new IrisInputAllFeatures() { ... } 
}

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?

Metadata

Metadata

Assignees

Labels

documentationRelated to documentation of ML.NET

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions