Skip to content

how to load 25k features using TextLoader? #420

Closed
@vivekpradhan

Description

@vivekpradhan

System information

.NET Core SDK:
Version: 2.1.301
Commit: 59524873d6

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04

Issue

  • What did you do?
    Loaded a subset of columns of my data using one of the examples (Iris data). I have a total of 25k features in the CSV file. I don't want to list all 25k of them in public class IrisData. Is there a better way to load this dataset?
public class IrisData
{
    [Column("0")]
    [ColumnName("Feature0")]
    public float Feature0;
    [Column("1")]
    [ColumnName("Feature1")]
    public float Feature1;
    [Column("2")]
    [ColumnName("Feature2")]
    public float Feature2;
    [Column("3")]
    [ColumnName("Feature3")]
    public float Feature3;
    [Column("4")]
    [ColumnName("Label")]
    public bool Label;
}
string dataPath = "../../../data/train.csv";
string testPath = "../../../data/test.csv";
pipeline.Add(new TextLoader(dataPath).CreateFrom<IrisData>(separator: ','));
pipeline.Add(new ColumnConcatenator("Features", "Feature0", "Feature1", "Feature2", "Feature3"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions