This Learner specializes mlr3::LearnerRegr for forecast problems:
task_typeis set to"fcst".Creates mlr3::Predictions of class mlr3::PredictionRegr.
Possible values for
predict_typesare:"response": Predicts a numeric response for each observation in the test set."se": Predicts the standard error for each value of response for each observation in the test set."distr": Probability distribution asVectorDistributionobject (requires packagedistr6, available via repository https://raphaels1.r-universe.dev).
Predefined learners can be found in the dictionary mlr3::mlr_learners.
See also
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
as.data.table(mlr_learners)for a table of available Learners in the running session (depending on the loaded packages).mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
mlr_learners_fcst.adam,
mlr_learners_fcst.arfima,
mlr_learners_fcst.arima,
mlr_learners_fcst.auto_adam,
mlr_learners_fcst.auto_arima,
mlr_learners_fcst.auto_ces,
mlr_learners_fcst.bats,
mlr_learners_fcst.ces,
mlr_learners_fcst.ets,
mlr_learners_fcst.nnetar,
mlr_learners_fcst.tbats
Super classes
mlr3::Learner -> mlr3::LearnerRegr -> LearnerFcst
Methods
Inherited methods
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()
Method new()
Creates a new instance of this R6 class.
Usage
LearnerFcst$new(
id,
param_set = ps(),
predict_types = "response",
feature_types = character(),
properties = character(),
packages = character(),
label = NA_character_,
man = NA_character_
)Arguments
id(
character(1))
Identifier for the new instance.param_set(paradox::ParamSet)
Set of hyperparameters.predict_types(
character())
Supported predict types. Must be a subset ofmlr_reflections$learner_predict_types.feature_types(
character())
Feature types the learner operates on. Must be a subset ofmlr_reflections$task_feature_types.properties(
character())
Set of properties of the mlr3::Learner. Must be a subset ofmlr_reflections$learner_properties. The following properties are currently standardized and understood by learners in mlr3:"missings": The learner can handle missing values in the data."weights": The learner supports observation weights."importance": The learner supports extraction of importance scores, i.e. comes with an$importance()extractor function (see section on optional extractors in mlr3::Learner)."selected_features": The learner supports extraction of the set of selected features, i.e. comes with a$selected_features()extractor function (see section on optional extractors in mlr3::Learner)."oob_error": The learner supports extraction of estimated out of bag error, i.e. comes with aoob_error()extractor function (see section on optional extractors in mlr3::Learner)."validation": The learner can use a validation task during training."internal_tuning": The learner is able to internally optimize hyperparameters (those are also tagged with"internal_tuning")."marshal": To save learners with this property, you need to call$marshal()first. If a learner is in a marshaled state, you call first need to call$unmarshal()to use its model, e.g. for prediction.
packages(
character())
Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand viarequireNamespace().label(
character(1))
Label for the new instance.man(
character(1))
String in the format[pkg]::[topic]pointing to a manual page for this object. The referenced help package can be opened via method$help().
Examples
# get all forecast learners from mlr_learners:
lrns = mlr_learners$mget(mlr_learners$keys("^fcst"))
names(lrns)
#> [1] "fcst.adam" "fcst.arfima" "fcst.arima" "fcst.auto_adam"
#> [5] "fcst.auto_arima" "fcst.auto_ces" "fcst.bats" "fcst.ces"
#> [9] "fcst.ets" "fcst.nnetar" "fcst.tbats"
# get a specific learner from mlr_learners:
mlr_learners$get("fcst.ets")
#>
#> ── <LearnerFcstEts> (fcst.ets): ETS ────────────────────────────────────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3, mlr3forecast, and forecast
#> • Predict Types: [response] and quantiles
#> • Feature Types: logical, integer, numeric, character, factor, ordered,
#> POSIXct, and Date
#> • Encapsulation: none (fallback: -)
#> • Properties: featureless and missings
#> • Other settings: use_weights = 'error'
lrn("fcst.auto_arima")
#>
#> ── <LearnerFcstAutoArima> (fcst.auto_arima): Auto ARIMA ────────────────────────
#> • Model: -
#> • Parameters: list()
#> • Packages: mlr3, mlr3forecast, and forecast
#> • Predict Types: [response] and quantiles
#> • Feature Types: logical, integer, and numeric
#> • Encapsulation: none (fallback: -)
#> • Properties: exogenous, featureless, and missings
#> • Other settings: use_weights = 'error'