dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.02k stars 1.88k forks source link

Make it easier to apply transforms to vectors of the same size. #6845

Open luisquintanilla opened 1 year ago

luisquintanilla commented 1 year ago

Is your feature request related to a problem? Please describe.

In general, trainers such as KMeans, expect the feature vector to be a vector of known size. The quickest way to provide this information is in the class that defines the model input schema, you can use the [VectorType(n)] attribute where n is the size of your vector. Alternatively, you can use SchemaDefinition similar to this sample. In this second approach, you still need to have an object to define the schema of objects.

Describe the solution you'd like

For dense vectors where the size is the same, there's two approaches we might consider:

Describe alternatives you've considered