diff --git a/index.html b/index.html index 4cafff4..29fb6eb 100644 --- a/index.html +++ b/index.html @@ -82,11 +82,122 @@

InstallationUsage

-

Univariate +

Example: native forecast learner

+

First lets create a helper function to generate new data for forecasting tasks.

 library(mlr3forecast)
-library(mlr3learners)
+#> Loading required package: mlr3
+
+generate_newdata = function(task, n = 1L, resolution = "day") {
+  assert_count(n)
+  assert_string(resolution)
+  assert_choice(
+    resolution, c("second", "minute", "hour", "day", "week", "month", "quarter", "year")
+  )
+
+  order_cols = task$col_roles$order
+  target = task$target_names
+  max_index = max(task$data(cols = order_cols)[[1L]])
+
+  unit = switch(resolution,
+    second = "sec",
+    minute = "min",
+    hour = ,
+    day = ,
+    week = ,
+    month = ,
+    quarter = ,
+    year = identity(resolution),
+    stopf("Invalid resolution")
+  )
+  unit = sprintf("1 %s", unit)
+  index = seq(max_index, length.out = n + 1L, by = unit)
+  index = index[2:length(index)]
+
+  newdata = data.table(index = index, target = rep(NA_real_, n))
+  setnames(newdata, c(order_cols, target))
+  setDF(newdata)[]
+}
+
+task = tsk("airpassengers")
+newdata = generate_newdata(task, 12L, "month")
+newdata
+#>          date passengers
+#> 1  1961-01-01         NA
+#> 2  1961-02-01         NA
+#> 3  1961-03-01         NA
+#> 4  1961-04-01         NA
+#> 5  1961-05-01         NA
+#> 6  1961-06-01         NA
+#> 7  1961-07-01         NA
+#> 8  1961-08-01         NA
+#> 9  1961-09-01         NA
+#> 10 1961-10-01         NA
+#> 11 1961-11-01         NA
+#> 12 1961-12-01         NA
+

Currently, we support native forecasting learners from the forecast package. In the future, we plan to support more forecasting learners.

+
+task = tsk("airpassengers")
+learner = lrn("fcst.arima", order = c(2L, 1L, 2L))$train(task)
+#> Registered S3 method overwritten by 'quantmod':
+#>   method            from
+#>   as.zoo.data.frame zoo
+prediction = learner$predict(task, 140:144)
+prediction$score(msr("regr.rmse"))
+#> regr.rmse 
+#>  50.62826
+newdata = generate_newdata(task, 12L, "month")
+learner$predict_newdata(newdata, task)
+#> <PredictionRegr> for 12 observations:
+#>  row_ids truth response
+#>        1    NA 483.8637
+#>        2    NA 465.9727
+#>        3    NA 469.4676
+#>      ---   ---      ---
+#>       10    NA 466.3308
+#>       11    NA 466.2953
+#>       12    NA 466.2723
+
+learner = lrn("fcst.auto_arima")$train(task)
+prediction = learner$predict(task, 140:144)
+prediction$score(msr("regr.rmse"))
+#> regr.rmse 
+#>  39.62379
+newdata = generate_newdata(task, 12L, "month")
+learner$predict_newdata(newdata, task)
+#> <PredictionRegr> for 12 observations:
+#>  row_ids truth response
+#>        1    NA 483.3799
+#>        2    NA 490.9993
+#>        3    NA 520.2773
+#>      ---   ---      ---
+#>       10    NA 500.2729
+#>       11    NA 507.3034
+#>       12    NA 512.9829
+
+# works with quantile response
+learner = lrn("fcst.auto_arima",
+  predict_type = "quantiles",
+  quantiles = c(0.1, 0.15, 0.5, 0.85, 0.9),
+  quantile_response = 0.5
+)$train(task)
+learner$predict_newdata(newdata, task)
+#> <PredictionRegr> for 12 observations:
+#>  row_ids truth     q0.1    q0.15     q0.5    q0.85     q0.9 response
+#>        1    NA 449.3201 455.8346 483.3799 510.9252 517.4397 483.3799
+#>        2    NA 439.6752 449.4918 490.9993 532.5069 542.3235 490.9993
+#>        3    NA 464.0693 474.8200 520.2773 565.7347 576.4854 520.2773
+#>      ---   ---      ---      ---      ---      ---      ---      ---
+#>       10    NA 440.1583 451.6562 500.2729 548.8896 560.3875 500.2729
+#>       11    NA 446.7823 458.3580 507.3034 556.2489 567.8246 507.3034
+#>       12    NA 452.1168 463.7584 512.9829 562.2074 573.8491 512.9829
+
+
+

machine learning forecasting +

+
+library(mlr3learners)
 
 task = tsk("airpassengers")
 task$select(setdiff(task$feature_names, "date"))
@@ -96,39 +207,38 @@ 

Univariateprediction #> <PredictionRegr> for 3 observations: #> row_ids truth response -#> 1 NA 435.7156 -#> 2 NA 435.9651 -#> 3 NA 455.7526 +#> 1 NA 434.0749 +#> 2 NA 436.2586 +#> 3 NA 456.6124 prediction = flrn$predict(task, 142:144) prediction #> <PredictionRegr> for 3 observations: #> row_ids truth response -#> 1 461 456.1817 -#> 2 390 412.6326 -#> 3 432 429.3494 +#> 1 461 456.0759 +#> 2 390 410.5727 +#> 3 432 430.4355 prediction$score(msr("regr.rmse")) #> regr.rmse -#> 13.44712 +#> 12.2465 flrn = ForecastLearner$new(lrn("regr.ranger"), 1:12) resampling = rsmp("forecast_holdout", ratio = 0.9) rr = resample(task, flrn, resampling) rr$aggregate(msr("regr.rmse")) #> regr.rmse -#> 48.43771 +#> 46.06935 resampling = rsmp("forecast_cv") rr = resample(task, flrn, resampling) rr$aggregate(msr("regr.rmse")) #> regr.rmse -#> 26.80632

+#> 27.64328

Multivariate

-
-library(mlr3learners)
-library(mlr3pipelines)
+
+library(mlr3pipelines)
 
 task = tsk("airpassengers")
 # datefeatures currently requires POSIXct
@@ -141,39 +251,39 @@ 

Multivariateprediction = flrn$predict(new_task, 142:144) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 13.92394 +#> 15.12504 row_ids = new_task$nrow - 0:2 flrn$predict_newdata(new_task$data(rows = row_ids), new_task) #> <PredictionRegr> for 3 observations: #> row_ids truth response -#> 1 432 432.6353 -#> 2 390 434.4334 -#> 3 461 456.4304 +#> 1 432 434.7273 +#> 2 390 434.9359 +#> 3 461 454.7645 newdata = new_task$data(rows = row_ids, cols = new_task$feature_names) flrn$predict_newdata(newdata, new_task) #> <PredictionRegr> for 3 observations: #> row_ids truth response -#> 1 NA 432.6353 -#> 2 NA 434.4334 -#> 3 NA 456.4304 +#> 1 NA 434.7273 +#> 2 NA 434.9359 +#> 3 NA 454.7645 resampling = rsmp("forecast_holdout", ratio = 0.9) rr = resample(new_task, flrn, resampling) rr$aggregate(msr("regr.rmse")) #> regr.rmse -#> 47.94459 +#> 49.02976 resampling = rsmp("forecast_cv") rr = resample(new_task, flrn, resampling) rr$aggregate(msr("regr.rmse")) #> regr.rmse -#> 26.71381

+#> 24.71841

mlr3pipelines integration

-
+
 graph = ppl("convert_types", "Date", "POSIXct") %>>%
   po("datefeatures",
     param_vals = list(is_day = FALSE, hour = FALSE, minute = FALSE, second = FALSE)
@@ -183,12 +293,12 @@ 

mlr3pipelines integrationprediction = glrn$predict(task, 142:144) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 13.68004

+#> 13.82437

Example: Forecasting electricity demand

-
+
 library(mlr3learners)
 library(mlr3pipelines)
 
@@ -204,7 +314,7 @@ 

Example: Forecasting electricity ), by = date ] |> - as_task_fcst(target = "demand", index = "date") + as_task_fcst(id = "vic_elec", target = "demand", order = "date") graph = ppl("convert_types", "Date", "POSIXct") %>>% po("datefeatures", @@ -226,18 +336,18 @@

Example: Forecasting electricity prediction #> <PredictionRegr> for 14 observations: #> row_ids truth response -#> 1 NA 187.4035 -#> 2 NA 191.8731 -#> 3 NA 183.8377 +#> 1 NA 187.4741 +#> 2 NA 192.1220 +#> 3 NA 184.4865 #> --- --- --- -#> 12 NA 215.6015 -#> 13 NA 220.0975 -#> 14 NA 220.1057

+#> 12 NA 213.7619 +#> 13 NA 218.1695 +#> 14 NA 219.3505

Global Forecasting

-
+
 library(mlr3learners)
 library(mlr3pipelines)
 library(tsibble) # needs not be loaded for it to somehow work
@@ -248,7 +358,7 @@ 

Global Forecasting_[, month := as.Date(month)] |> _[, .(count = sum(count)), by = .(state, month)] |> setorder(state, month) |> - as_task_fcst(target = "count", index = "month", key = "state") + as_task_fcst(id = "aus_livestock", target = "count", order = "month", key = "state") graph = ppl("convert_types", "Date", "POSIXct") %>>% po("datefeatures", @@ -265,19 +375,20 @@

Global Forecastingprediction = flrn$predict(task, 4460:4464) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 21464.2 +#> 22703.54 flrn = ForecastLearner$new(lrn("regr.ranger"), 1:3) resampling = rsmp("forecast_holdout", ratio = 0.9) rr = resample(task, flrn, resampling) rr$aggregate(msr("regr.rmse")) #> regr.rmse -#> 90619.28

+#> 94349.09

Example: Global vs Local Forecasting

-
+

In machine learning forecasting the difference between forecasting a time series and longitudinal data is often refered to local and global forecasting.

+
 # TODO: find better task example, since the effect is minor here
 
 graph = ppl("convert_types", "Date", "POSIXct") %>>%
@@ -296,7 +407,7 @@ 

Example: Global vs Local Forecastin _[, month := as.Date(month)] |> _[state == "Western Australia", .(count = sum(count)), by = .(month)] |> setorder(month) |> - as_task_fcst(target = "count", index = "month") + as_task_fcst(id = "aus_livestock", target = "count", order = "month") task = graph$train(task)[[1L]] flrn = ForecastLearner$new(lrn("regr.ranger"), 1L)$train(task) tab = task$backend$data( @@ -307,7 +418,7 @@

Example: Global vs Local Forecastin prediction = flrn$predict(task, row_ids) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 32641.16 +#> 32282.74 # global forecasting task = tsibbledata::aus_livestock |> @@ -316,7 +427,7 @@

Example: Global vs Local Forecastin _[, month := as.Date(month)] |> _[, .(count = sum(count)), by = .(state, month)] |> setorder(state, month) |> - as_task_fcst(target = "count", index = "month", key = "state") + as_task_fcst(id = "aus_livestock", target = "count", order = "month", key = "state") task = graph$train(task)[[1L]] task$col_roles$key = "state" flrn = ForecastLearner$new(lrn("regr.ranger"), 1L)$train(task) @@ -328,192 +439,7 @@

Example: Global vs Local Forecastin prediction = flrn$predict(task, row_ids) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 32908.08

-
-
-

Example: generate new data -

-
-library(checkmate)
-
-generate_newdata = function(task, n = 1L, resolution = "day") {
-  assert_count(n)
-  assert_string(resolution)
-  assert_choice(
-    resolution, c("second", "minute", "hour", "day", "week", "month", "quarter", "year")
-  )
-
-  order_cols = task$col_roles$order
-  target = task$target_names
-  max_index = max(task$data(cols = order_cols)[[1L]])
-
-  unit = switch(resolution,
-    second = "sec",
-    minute = "min",
-    hour = ,
-    day = ,
-    week = ,
-    month = ,
-    quarter = ,
-    year = identity(resolution),
-    stopf("Invalid resolution")
-  )
-  unit = sprintf("1 %s", unit)
-  index = seq(max_index, length.out = n + 1L, by = unit)
-  index = index[2:length(index)]
-
-  newdata = data.table(index = index, target = rep(NA_real_, n))
-  setnames(newdata, c(order_cols, target))
-  setDF(newdata)[]
-}
-
-task = tsk("airpassengers")
-newdata = generate_newdata(task, 12L, "month")
-newdata
-#>          date passengers
-#> 1  1961-01-01         NA
-#> 2  1961-02-01         NA
-#> 3  1961-03-01         NA
-#> 4  1961-04-01         NA
-#> 5  1961-05-01         NA
-#> 6  1961-06-01         NA
-#> 7  1961-07-01         NA
-#> 8  1961-08-01         NA
-#> 9  1961-09-01         NA
-#> 10 1961-10-01         NA
-#> 11 1961-11-01         NA
-#> 12 1961-12-01         NA
-
-
-

Example: Native Forecasting Learners -

-
-task = tsk("airpassengers")
-learner = lrn("fcst.arima", order = c(2L, 1L, 2L))$train(task)
-#> Registered S3 method overwritten by 'quantmod':
-#>   method            from
-#>   as.zoo.data.frame zoo
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  50.62826
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 483.8637
-#>        2    NA 465.9727
-#>        3    NA 469.4676
-#>      ---   ---      ---
-#>       10    NA 466.3308
-#>       11    NA 466.2953
-#>       12    NA 466.2723
-
-learner = lrn("fcst.auto_arima")$train(task)
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  39.62379
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 483.3799
-#>        2    NA 490.9993
-#>        3    NA 520.2773
-#>      ---   ---      ---
-#>       10    NA 500.2729
-#>       11    NA 507.3034
-#>       12    NA 512.9829
-
-# works with quantile response
-learner = lrn("fcst.auto_arima",
-  predict_type = "quantiles",
-  quantiles = c(0.1, 0.15, 0.5, 0.85, 0.9),
-  quantile_response = 0.5
-)$train(task)
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth     q0.1    q0.15     q0.5    q0.85     q0.9 response
-#>        1    NA 449.3201 455.8346 483.3799 510.9252 517.4397 483.3799
-#>        2    NA 439.6752 449.4918 490.9993 532.5069 542.3235 490.9993
-#>        3    NA 464.0693 474.8200 520.2773 565.7347 576.4854 520.2773
-#>      ---   ---      ---      ---      ---      ---      ---      ---
-#>       10    NA 440.1583 451.6562 500.2729 548.8896 560.3875 500.2729
-#>       11    NA 446.7823 458.3580 507.3034 556.2489 567.8246 507.3034
-#>       12    NA 452.1168 463.7584 512.9829 562.2074 573.8491 512.9829
-
-task = tsk("airpassengers")
-learner = lrn("fcst.arfima")$train(task)
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  54.93583
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 470.3903
-#>        2    NA 449.1027
-#>        3    NA 452.4956
-#>      ---   ---      ---
-#>       10    NA 408.8267
-#>       11    NA 405.3927
-#>       12    NA 402.0429
-
-task = tsk("airpassengers")
-learner = lrn("fcst.ets")$train(task)
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  61.44108
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 431.9958
-#>        2    NA 431.9958
-#>        3    NA 431.9958
-#>      ---   ---      ---
-#>       10    NA 431.9958
-#>       11    NA 431.9958
-#>       12    NA 431.9958
-
-task = tsk("airpassengers")
-learner = lrn("fcst.tbats")$train(task)
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  40.89975
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 502.2486
-#>        2    NA 545.0701
-#>        3    NA 610.7134
-#>      ---   ---      ---
-#>       10    NA 592.3269
-#>       11    NA 613.4432
-#>       12    NA 633.9967
-
-task = tsk("airpassengers")
-learner = lrn("fcst.bats")$train(task)
-prediction = learner$predict(task, 140:144)
-prediction$score(msr("regr.rmse"))
-#> regr.rmse 
-#>  40.89975
-newdata = generate_newdata(task, 12L, "month")
-learner$predict_newdata(newdata, task)
-#> <PredictionRegr> for 12 observations:
-#>  row_ids truth response
-#>        1    NA 502.2486
-#>        2    NA 545.0701
-#>        3    NA 610.7134
-#>      ---   ---      ---
-#>       10    NA 592.3269
-#>       11    NA 613.4432
-#>       12    NA 633.9967
+#> 32095.1

Example: Custom PipeOps @@ -590,19 +516,19 @@

Example: Custom PipeOpsprediction = glrn$predict(task, 142:144) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 24.22745 +#> 26.41252 newdata = generate_newdata(task, 12L, "month") glrn$predict_newdata(newdata, task) #> <PredictionRegr> for 12 observations: #> row_ids truth response -#> 1 NA 435.7197 -#> 2 NA 441.3132 -#> 3 NA 457.2861 +#> 1 NA 436.5384 +#> 2 NA 439.9788 +#> 3 NA 458.0152 #> --- --- --- -#> 10 NA 469.7691 -#> 11 NA 442.5062 -#> 12 NA 443.2276

+#> 10 NA 473.4481 +#> 11 NA 443.1554 +#> 12 NA 443.2785

Example: common target transformations @@ -641,7 +567,26 @@

Example: common target transforma prediction = glrn$predict(task, 142:144) prediction$score(msr("regr.rmse")) #> regr.rmse -#> 35.94069

+#> 35.41751 +
+graph = po("fcst.lag", lag = 1:12) %>>%
+  ppl("convert_types", "Date", "POSIXct") %>>%
+  po("datefeatures",
+    param_vals = list(
+      week_of_year = FALSE, day_of_week = FALSE, day_of_month = FALSE,
+      day_of_year = FALSE, is_day = FALSE, hour = FALSE, minute = FALSE,
+      second = FALSE
+    )
+  )
+
+task = tsk("airpassengers")
+flrn = ForecastRecursiveLearner$new(lrn("regr.ranger"))
+glrn = as_learner(graph %>>% flrn)
+trafo = po("fcst.targetdiff", lag = 12L)
+pipeline = ppl("targettrafo", graph = glrn, trafo_pipeop = trafo)
+glrn = as_learner(pipeline)$train(task)
+prediction = glrn$predict(task, 142:144)
+prediction$score(msr("regr.rmse"))
diff --git a/pkgdown.yml b/pkgdown.yml index 6de902e..b76a584 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2025-01-11T23:08Z +last_built: 2025-01-14T09:55Z urls: reference: https://mlr3forecast.mlr-org.com/reference article: https://mlr3forecast.mlr-org.com/articles diff --git a/reference/LearnerFcst.html b/reference/LearnerFcst.html index 1b0bb14..0dc773f 100644 --- a/reference/LearnerFcst.html +++ b/reference/LearnerFcst.html @@ -1,7 +1,7 @@ -Forecast Learner — LearnerFcst • mlr3forecast +Abstract class for forecast package learner — LearnerFcst • mlr3forecast Skip to contents @@ -40,20 +40,20 @@
-

Forecast Learner

-

Forecast Learner

+

Abstract class for forecast package learner

+

Abstract class for forecast package learner

-

Super class

-

mlr3::Learner -> LearnerFcst

+

Super classes

+

mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst

Methods

diff --git a/reference/LearnerRegrForecast.html b/reference/LearnerRegrForecast.html index da82f3d..59add06 100644 --- a/reference/LearnerRegrForecast.html +++ b/reference/LearnerRegrForecast.html @@ -53,7 +53,7 @@

Abstract class for forecast package learner

Super classes

-

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrForecast

+

mlr3::Learner -> mlr3::LearnerRegr -> mlr3forecast::LearnerFcst -> LearnerRegrForecast

Methods

@@ -72,7 +72,7 @@

Public methodsmlr3::Learner$print()
  • mlr3::Learner$reset()
  • mlr3::Learner$train()
  • -
  • mlr3::LearnerRegr$initialize()
  • +
  • mlr3forecast::LearnerFcst$initialize()

  • Method clone()

    The objects of this class are cloneable with this method.

    diff --git a/reference/TaskFcst.html b/reference/TaskFcst.html index a10a90b..c864966 100644 --- a/reference/TaskFcst.html +++ b/reference/TaskFcst.html @@ -1,12 +1,12 @@ -Forecast Task — TaskFcst • mlr3forecast Skip to contents @@ -52,10 +52,10 @@

    Forecast Task

    -

    This task specializes Task and TaskSupervised for forecast problems. +

    This task specializes Task and TaskSupervised for regression problems. The target column is assumed to be numeric. -The task_type is set to "fcst".

    -

    It is recommended to use as_task_fcst() for construction. +The task_type is set to "regr".

    +

    It is recommended to use as_task_regr() for construction. Predefined tasks are stored in the dictionary mlr_tasks.

    @@ -80,15 +80,6 @@

    See also

    Super classes

    mlr3::Task -> mlr3::TaskSupervised -> mlr3::TaskRegr -> TaskFcst

    -

    -
    -

    Public fields

    -

    key
    -

    (character(1))
    -Key of data.

    - - -

    Methods

    @@ -121,16 +112,9 @@

    Public methods


    Method new()

    Creates a new instance of this R6 class. -The function as_task_fcst() provides an alternative way to construct forecast tasks.

    +The function as_task_regr() provides an alternative way to construct regression tasks.

    Usage

    -

    TaskFcst$new(
    -  id,
    -  backend,
    -  target,
    -  key = NULL,
    -  label = NA_character_,
    -  extra_args = list()
    -)

    +

    TaskFcst$new(id, backend, target, label = NA_character_, extra_args = list())

    @@ -151,10 +135,6 @@

    ArgumentsArguments

    Examples

    -
    airpassengers = tsbox::ts_dt(AirPassengers)
    -data.table::setnames(airpassengers, c("date", "passengers"))
    -task = as_task_fcst(airpassengers, target = "passengers", index = "date")
    +    
    task = as_task_regr(palmerpenguins::penguins, target = "bill_length_mm")
     task$task_type
     #> [1] "regr"
     task$formula()
    -#> passengers ~ .
    +#> bill_length_mm ~ .
     #> NULL
     task$truth()
    -#>   [1] 112 118 132 129 121 135 148 148 136 119 104 118 115 126 141 135 125 149
    -#>  [19] 170 170 158 133 114 140 145 150 178 163 172 178 199 199 184 162 146 166
    -#>  [37] 171 180 193 181 183 218 230 242 209 191 172 194 196 196 236 235 229 243
    -#>  [55] 264 272 237 211 180 201 204 188 235 227 234 264 302 293 259 229 203 229
    -#>  [73] 242 233 267 269 270 315 364 347 312 274 237 278 284 277 317 313 318 374
    -#>  [91] 413 405 355 306 271 306 315 301 356 348 355 422 465 467 404 347 305 336
    -#> [109] 340 318 362 348 363 435 491 505 404 359 310 337 360 342 406 396 420 472
    -#> [127] 548 559 463 407 362 405 417 391 419 461 472 535 622 606 508 461 390 432
    -task$data(rows = 1:3)
    -#>    passengers       date
    -#>         <num>     <Date>
    -#> 1:        112 1949-01-01
    -#> 2:        118 1949-02-01
    -#> 3:        132 1949-03-01
    +#>   [1] 39.1 39.5 40.3   NA 36.7 39.3 38.9 39.2 34.1 42.0 37.8 37.8 41.1 38.6 34.6
    +#>  [16] 36.6 38.7 42.5 34.4 46.0 37.8 37.7 35.9 38.2 38.8 35.3 40.6 40.5 37.9 40.5
    +#>  [31] 39.5 37.2 39.5 40.9 36.4 39.2 38.8 42.2 37.6 39.8 36.5 40.8 36.0 44.1 37.0
    +#>  [46] 39.6 41.1 37.5 36.0 42.3 39.6 40.1 35.0 42.0 34.5 41.4 39.0 40.6 36.5 37.6
    +#>  [61] 35.7 41.3 37.6 41.1 36.4 41.6 35.5 41.1 35.9 41.8 33.5 39.7 39.6 45.8 35.5
    +#>  [76] 42.8 40.9 37.2 36.2 42.1 34.6 42.9 36.7 35.1 37.3 41.3 36.3 36.9 38.3 38.9
    +#>  [91] 35.7 41.1 34.0 39.6 36.2 40.8 38.1 40.3 33.1 43.2 35.0 41.0 37.7 37.8 37.9
    +#> [106] 39.7 38.6 38.2 38.1 43.2 38.1 45.6 39.7 42.2 39.6 42.7 38.6 37.3 35.7 41.1
    +#> [121] 36.2 37.7 40.2 41.4 35.2 40.6 38.8 41.5 39.0 44.1 38.5 43.1 36.8 37.5 38.1
    +#> [136] 41.1 35.6 40.2 37.0 39.7 40.2 40.6 32.1 40.7 37.3 39.0 39.2 36.6 36.0 37.8
    +#> [151] 36.0 41.5 46.1 50.0 48.7 50.0 47.6 46.5 45.4 46.7 43.3 46.8 40.9 49.0 45.5
    +#> [166] 48.4 45.8 49.3 42.0 49.2 46.2 48.7 50.2 45.1 46.5 46.3 42.9 46.1 44.5 47.8
    +#> [181] 48.2 50.0 47.3 42.8 45.1 59.6 49.1 48.4 42.6 44.4 44.0 48.7 42.7 49.6 45.3
    +#> [196] 49.6 50.5 43.6 45.5 50.5 44.9 45.2 46.6 48.5 45.1 50.1 46.5 45.0 43.8 45.5
    +#> [211] 43.2 50.4 45.3 46.2 45.7 54.3 45.8 49.8 46.2 49.5 43.5 50.7 47.7 46.4 48.2
    +#> [226] 46.5 46.4 48.6 47.5 51.1 45.2 45.2 49.1 52.5 47.4 50.0 44.9 50.8 43.4 51.3
    +#> [241] 47.5 52.1 47.5 52.2 45.5 49.5 44.5 50.8 49.4 46.9 48.4 51.1 48.5 55.9 47.2
    +#> [256] 49.1 47.3 46.8 41.7 53.4 43.3 48.1 50.5 49.8 43.5 51.5 46.2 55.1 44.5 48.8
    +#> [271] 47.2   NA 46.8 50.4 45.2 49.9 46.5 50.0 51.3 45.4 52.7 45.2 46.1 51.3 46.0
    +#> [286] 51.3 46.6 51.7 47.0 52.0 45.9 50.5 50.3 58.0 46.4 49.2 42.4 48.5 43.2 50.6
    +#> [301] 46.7 52.0 50.5 49.5 46.4 52.8 40.9 54.2 42.5 51.0 49.7 47.5 47.6 52.0 46.9
    +#> [316] 53.5 49.0 46.2 50.9 45.5 50.9 50.8 50.1 49.0 51.5 49.8 48.1 51.4 45.7 50.7
    +#> [331] 42.5 52.2 45.2 49.3 50.2 45.6 51.9 46.8 45.7 55.8 43.5 49.6 50.8 50.2
    +task$data(rows = 1:3, cols = task$feature_names[1:2])
    +#>    bill_depth_mm body_mass_g
    +#>            <num>       <int>
    +#> 1:          18.7        3750
    +#> 2:          17.4        3800
    +#> 3:          18.0        3250