mlr-org / mlr3temporal

Forecasting for mlr3
https://mlr3temporal.mlr-org.com
GNU Lesser General Public License v3.0
20 stars 2 forks source link

date_col argument in TaskForecast task #68

Closed MislavSag closed 2 years ago

MislavSag commented 3 years ago

Hi,

I am not sure how to set Task for forecasting.

If I use:

task = TaskForecast$new(id = 'excess',
                        backend = sp500_indicators[, .(index, excess)],
                        target = 'excess')

where index is datetime column and excess is numeric vector. I get an error:

Error in df_to_backend(backend, target, time_col) : 
  Assertion on 'date_col' failed: Must be a subset of {'index','excess'}, not 'NULL'.

But than, if I use:

task = TaskForecast$new(id = 'excess',
                        backend = sp500_indicators[, .(index, excess)],
                        target = 'excess',
                        date_col = 'index')

it returns and error:

Error in initialize(...) : unused argument (date_col = "index")
pfistfl commented 2 years ago

This seems to be addressed and fixed now. Feel free to re-open if the problem persists. I have also improved documentation in TaskForecast in that regard.