JuliaAI / MLJModels.jl

Home of the MLJ model registry and tools for model queries and mode code loading
MIT License
80 stars 27 forks source link

Automatically convert `Date` in `ContinuousEncoder` #535

Open ParadaCarleton opened 11 months ago

ParadaCarleton commented 11 months ago

Right now, inputting a date into a ContinuousEncoder just drops it, but it seems more reasonable to handle by converting dates into a number of days.

[ Info: Some features cannot be replaced with `Continuous` features and will be dropped: [:Year]. 
ablaom commented 11 months ago

In principle this sounds like a good idea. However, we do have UnivariateTimeTypeToContinuous and I would prefer to avoid code duplication.

Perhaps we could add date_time_encoder=UnivariateTimeTypeToContinous() as a new ContinuousEncoder hyperparameter, and use that to treat columns with scitype ScientificTimeType (corresponding to any machine type <: Dates.TimeType).

What do you think?

ParadaCarleton commented 11 months ago

Sounds good!