I have a dataset with columns for
and from this dataset I want to train a data model that given a number of items, weight and category can predict a duration (end time - start time).
How can I transform or set my label column to the duration, so that I get an EstimatorChain
that I can call Fit
on with an IDataView
that I've loaded from CSV?
You can use the ML.NET CustomMapping functionality, to calculate the duration, and call that Label. This contains an example of how to use it.
Action<Data, Data> mapping =
(input, output) => output.Label= input.End - Input.Start;
where Data would be your data model that contains a Label property, in addition to the other properties.