machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Binary Training Data

Open jcapellman opened this issue 8 years ago • 9 comments

As shown during the .NET Overview Session today at BUILD and as discussed with the ML Team there is only a text based reader for training data. Having a binary reader for training data would be highly beneficial to my use case.

jcapellman avatar May 08 '18 02:05 jcapellman

Which file format do you have in mind for us to support?

markusweimer avatar May 08 '18 04:05 markusweimer

We met him at BUILD and his data is in raw binary format, the reason being he has several thousand features, so may be to keep the dataset compact.

codemzs avatar May 08 '18 05:05 codemzs

Jarred, (@jcapellman) that's an interesting suggestion. Are you looking at custom binary deserialization reader?
There are couple of options for you. One is erformant, but complex, and another is slower, but simpler. If you are looking for ultimate performance, you will need to implement a IDataLoader interface. This will be a loader component that returns back a special datatype, IDataView. you can use the ParquetLoader as a template.

Alternatively, you can use your existing code that deserializes a binary file and make it return an IEnumerable< T > where T is the type that carries your features to the LearningPipeline. you can look at the HousePriceData example to see what T should look like. Let us know if you have any sparse data, as we have special methods to handle that as well

glebuk avatar May 08 '18 05:05 glebuk

DRI RESPONSE: This is something what we want to have. But it doesn't look like a major priority for us right now, considering what we allow user to use enumeration of classes(List or Array) as data source.

abgoswam avatar Oct 15 '18 22:10 abgoswam

Sorry for not looping back on this earlier - been crazy time for me since BUILD.

As we keep evaluating ML.NET vs XGBoost, one of the biggest things is our training data is now over 300 million files to do feature extraction and then train a model. As @codemzs mentioned these files are binary to begin with and keeping it in binary would save a ton of space over having 24k features written to a text file like we do today for those 300 million files.

jcapellman avatar Oct 16 '18 01:10 jcapellman

Would the addition of the binary saving and loading PR help with this?

jwood803 avatar Mar 02 '19 12:03 jwood803

@jwood803 Yes it would

jcapellman avatar Mar 03 '19 17:03 jcapellman

Closing this issue as we already have this functionality here: https://github.com/dotnet/machinelearning/tree/master/src/Microsoft.ML.Data/DataLoadSave/Binary

codemzs avatar Jun 30 '19 02:06 codemzs

@codemzs Thank you - on a side note, really appreciate you, the ML.NET and the community for making this an incredible framework to work with. Transformed my side projects and am going to use it for my DSc starting in August.

jcapellman avatar Jun 30 '19 12:06 jcapellman