Attempting to Create a model with unknown columns count.

jon manrique 1 Reputation point
2022-05-13T06:39:21.887+00:00

I would like to create a model in ML.net with unknown count of columns.

I load the data from a text file. The first column will always be the result label. After that, it can be 2, 3 or even 20 columns with custom names(Header).

I tried creating a class like this

public class NewData
    {
        [LoadColumn(0)]
        public float Label { get; set; }

        [LoadColumn(1, 100)]
        [VectorType(100)]
        public float[] Features { get; set; }
    }

I wrote 100 because it will never be more than 100 columns.
After that, how could I create the pipeline and the model?
Would I need to concatenate all the columns inside Features?

Thanks

.NET Machine learning
.NET Machine learning
.NET: Microsoft Technologies based on the .NET software framework.Machine learning: A type of artificial intelligence focused on enabling computers to use observed data to evolve new behaviors that have not been explicitly programmed.
150 questions
0 comments No comments
{count} votes