From 5f2764fccd93d2ba08ba0b2102f5576fc9f45c64 Mon Sep 17 00:00:00 2001 From: Nima Hejazi Date: Thu, 23 Dec 2021 01:54:55 -0500 Subject: [PATCH] rebuild site --- NAMESPACE | 1 - R/importance.R | 8 +- README.md | 118 +-- docs/404.html | 137 +-- docs/CONTRIBUTING.html | 175 +--- docs/LICENSE-text.html | 115 +- docs/articles/custom_lrnrs.html | 157 +-- docs/articles/index.html | 121 +-- docs/articles/intro_sl3.html | 448 ++++---- docs/authors.html | 198 ++-- docs/index.html | 268 ++--- docs/news/index.html | 270 ++--- docs/pkgdown.css | 83 +- docs/pkgdown.js | 4 +- docs/pkgdown.yml | 6 +- docs/reference/CV_lrnr_sl.html | 150 +-- docs/reference/Custom_chain.html | 312 +++--- docs/reference/Lrnr_HarmonicReg.html | 371 +++---- docs/reference/Lrnr_arima.html | 342 +++--- docs/reference/Lrnr_bartMachine.html | 330 +++--- docs/reference/Lrnr_base.html | 459 ++++---- docs/reference/Lrnr_bayesglm.html | 320 +++--- docs/reference/Lrnr_bilstm.html | 329 +++--- docs/reference/Lrnr_bound.html | 191 ++-- docs/reference/Lrnr_caret.html | 316 +++--- docs/reference/Lrnr_cv.html | 284 ++--- docs/reference/Lrnr_cv_selector.html | 369 +++---- docs/reference/Lrnr_dbarts.html | 404 ++++--- docs/reference/Lrnr_define_interactions.html | 312 +++--- docs/reference/Lrnr_density_discretize.html | 298 +++--- docs/reference/Lrnr_density_hse.html | 300 +++--- .../Lrnr_density_semiparametric.html | 300 +++--- docs/reference/Lrnr_earth.html | 337 +++--- docs/reference/Lrnr_expSmooth.html | 336 +++--- docs/reference/Lrnr_ga.html | 338 +++--- docs/reference/Lrnr_gam.html | 331 +++--- docs/reference/Lrnr_gbm.html | 331 +++--- docs/reference/Lrnr_glm.html | 330 +++--- docs/reference/Lrnr_glm_fast.html | 323 +++--- docs/reference/Lrnr_glmnet.html | 349 +++---- docs/reference/Lrnr_grf.html | 348 +++---- docs/reference/Lrnr_gru_keras.html | 350 +++---- docs/reference/Lrnr_gts.html | 330 +++--- docs/reference/Lrnr_h2o_glm.html | 349 +++---- docs/reference/Lrnr_h2o_grid.html | 340 +++--- docs/reference/Lrnr_hal9001.html | 314 +++--- docs/reference/Lrnr_haldensify.html | 366 +++---- docs/reference/Lrnr_hts.html | 330 +++--- docs/reference/Lrnr_independent_binomial.html | 302 +++--- docs/reference/Lrnr_lightgbm.html | 341 +++--- docs/reference/Lrnr_lstm_keras.html | 350 +++---- docs/reference/Lrnr_mean.html | 306 +++--- docs/reference/Lrnr_multiple_ts.html | 284 ++--- docs/reference/Lrnr_multivariate.html | 300 +++--- docs/reference/Lrnr_nnet.html | 326 +++--- docs/reference/Lrnr_nnls.html | 330 +++--- docs/reference/Lrnr_optim.html | 320 +++--- docs/reference/Lrnr_pca.html | 312 +++--- docs/reference/Lrnr_polspline.html | 292 ++---- docs/reference/Lrnr_pooled_hazards.html | 300 +++--- docs/reference/Lrnr_randomForest.html | 296 +++--- docs/reference/Lrnr_ranger.html | 361 +++---- docs/reference/Lrnr_revere_task.html | 280 ++--- docs/reference/Lrnr_rpart.html | 294 ++---- docs/reference/Lrnr_rugarch.html | 352 +++---- docs/reference/Lrnr_screener_augment.html | 288 ++--- docs/reference/Lrnr_screener_coefs.html | 298 +++--- docs/reference/Lrnr_screener_correlation.html | 296 +++--- docs/reference/Lrnr_screener_importance.html | 366 +++---- docs/reference/Lrnr_sl.html | 316 +++--- docs/reference/Lrnr_solnp.html | 336 +++--- docs/reference/Lrnr_solnp_density.html | 302 +++--- docs/reference/Lrnr_stratified.html | 284 ++--- docs/reference/Lrnr_subset_covariates.html | 300 +++--- docs/reference/Lrnr_svm.html | 339 +++--- docs/reference/Lrnr_tsDyn.html | 288 ++--- docs/reference/Lrnr_ts_weights.html | 304 +++--- docs/reference/Lrnr_xgboost.html | 337 +++--- docs/reference/Pipeline.html | 300 +++--- docs/reference/Shared_Data.html | 119 +-- docs/reference/Stack.html | 300 +++--- docs/reference/SuperLearner_interface.html | 312 +++--- docs/reference/args_to_list.html | 128 +-- docs/reference/bound.html | 151 +-- docs/reference/bsds.html | 169 +-- docs/reference/call_with_args.html | 176 +--- docs/reference/cpp.html | 343 +++--- docs/reference/cpp_1yr.html | 208 ++-- docs/reference/cv_helpers.html | 150 +-- docs/reference/cv_risk.html | 152 +-- docs/reference/debug_helpers.html | 158 +-- docs/reference/default_metalearner.html | 154 +-- docs/reference/density_dat.html | 150 +-- docs/reference/drop_offsets_chain.html | 138 +-- docs/reference/factors_to_indicators.html | 152 +-- docs/reference/importance.html | 365 +++---- docs/reference/importance_plot-1.png | Bin 35781 -> 35198 bytes docs/reference/importance_plot.html | 195 ++-- docs/reference/index.html | 983 ++++-------------- docs/reference/inverse_sample.html | 150 +-- docs/reference/keep_only_fun_args.html | 146 +-- docs/reference/learner_helpers.html | 194 +--- docs/reference/list_learners.html | 145 +-- docs/reference/loss_functions.html | 160 +-- docs/reference/make_learner_stack.html | 181 +--- docs/reference/metalearners.html | 154 +-- docs/reference/pack_predictions.html | 144 +-- docs/reference/pooled_hazard_task.html | 144 +-- docs/reference/predict_classes.html | 145 +-- docs/reference/prediction_plot.html | 143 +-- docs/reference/reduce_fit_test.html | 140 +-- docs/reference/replace_add_user_args.html | 127 +-- docs/reference/risk.html | 154 +-- docs/reference/risk_functions.html | 181 +--- docs/reference/safe_dim.html | 138 +-- docs/reference/sl3Options.html | 168 +-- docs/reference/sl3_Task.html | 336 +++--- docs/reference/sl3_revere_Task.html | 126 +-- docs/reference/subset_dt_cols.html | 149 +-- docs/reference/subset_folds.html | 144 +-- docs/reference/true_obj_size.html | 145 +-- docs/reference/undocumented_learner.html | 275 ++--- docs/reference/variable_type.html | 166 +-- docs/reference/write_learner_template.html | 147 +-- docs/sitemap.xml | 42 +- man/importance.Rd | 110 +- man/importance_plot.Rd | 19 +- man/risk_functions.Rd | 8 +- 128 files changed, 11570 insertions(+), 19812 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 8ee17316..1e97c684 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -146,7 +146,6 @@ importFrom(data.table,data.table) importFrom(data.table,set) importFrom(data.table,setcolorder) importFrom(data.table,setnames) -importFrom(data.table,setorder) importFrom(data.table,setorderv) importFrom(digest,digest) importFrom(dplyr,"%>%") diff --git a/R/importance.R b/R/importance.R index b471e4de..669a8c06 100644 --- a/R/importance.R +++ b/R/importance.R @@ -21,7 +21,7 @@ utils::globalVariables(c("score")) #' @rdname importance #' @keywords variable importance #' -#' @importFrom data.table data.table setorder setnames +#' @importFrom data.table data.table setorderv setnames #' #' @return A \code{data.table} of variable importance for each covariate. #' @@ -228,11 +228,13 @@ importance <- function(fit, eval_fun = NULL, ############################## prep output ################################### # importance results ordered by decreasing importance - result <- data.table::data.table(covariate = names(X), metric = unlist(res_list)) + result <- data.table::data.table( + covariate = names(X), metric = unlist(res_list) + ) if (!is.null(covariate_groups)) { colnames(result)[1] <- "covariate_group" } - data.table::setorder(result, -metric) + data.table::setorderv(result, cols = "metric", order = -1L) # name the importance metric appropriately metric_name <- paste0("risk_", importance_metric) diff --git a/README.md b/README.md index 3d0b5e74..508817b5 100644 --- a/README.md +++ b/README.md @@ -131,12 +131,12 @@ stack_fit <- learner_stack$train(task) preds <- stack_fit$predict() head(preds) #> Lrnr_pkg_SuperLearner_SL.glmnet Lrnr_glm_TRUE -#> 1: 0.35767321 0.36298498 -#> 2: 0.35767321 0.36298498 -#> 3: 0.25185377 0.25993072 -#> 4: 0.25185377 0.25993072 -#> 5: 0.25185377 0.25993072 -#> 6: 0.04220823 0.05680264 +#> 1: 0.3525946 0.36298498 +#> 2: 0.3525946 0.36298498 +#> 3: 0.2442593 0.25993072 +#> 4: 0.2442593 0.25993072 +#> 5: 0.2442593 0.25993072 +#> 6: 0.0269504 0.05680264 #> Pipeline(Lrnr_pkg_SuperLearner_screener_screen.glmnet->Lrnr_glm_TRUE) #> 1: 0.36228209 #> 2: 0.36228209 @@ -1816,106 +1816,6 @@ x -Lrnr\_ga - - - - - -√ - - - - - -√ - - - - - -√ - - - - - -x - - - - - -x - - - - - -x - - - - - -x - - - - - -x - - - - - -√ - - - - - -x - - - - - -x - - - - - -x - - - - - -x - - - - - -√ - - - - - -x - - - - - - - - - Lrnr\_gam @@ -4022,7 +3922,7 @@ Lrnr\_nnls -√ +x @@ -6634,7 +6534,7 @@ prior to submitting a pull request. After using the `sl3` R package, please cite the following: ``` - @software{coyle2021sl3-rpkg, + @software{coyle2021sl3-rpkg, author = {Coyle, Jeremy R and Hejazi, Nima S and Malenica, Ivana and Phillips, Rachael V and Sofrygin, Oleg}, title = {{sl3}: Modern Pipelines for Machine Learning and {Super @@ -6664,7 +6564,7 @@ See file `LICENSE` for details. ## References -
+
diff --git a/docs/404.html b/docs/404.html index c1f2c029..3083f044 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,76 +1,33 @@ - - - - + + + + - Page not found (404) • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + + - - - - + +
+ - - -
+
+
-
- +
+ + - - diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index a25c433e..7dcbc889 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -1,76 +1,18 @@ - - - - - - - -Contributing to sl3 development • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Contributing to sl3 development • sl3 - - - - - - + + - - -
-
- -
- -
+
+
-
- +
- - + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 485c8930..ec6cb602 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,76 +1,18 @@ - - - - - - - -License • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -License • sl3 - - - - - - + + - - -
-
- -
- -
+
+
-
- +
- - + + diff --git a/docs/articles/custom_lrnrs.html b/docs/articles/custom_lrnrs.html index 8ab0f9e8..2c11253f 100644 --- a/docs/articles/custom_lrnrs.html +++ b/docs/articles/custom_lrnrs.html @@ -25,6 +25,8 @@ + +
+
-
-

-Introduction

+
+

Introduction +

This guide describes the process of implementing a learner class for a new machine learning algorithm. By writing a learner class for your favorite machine learning algorithm, you will be able to use it in all the places you could otherwise use any other sl3 learners, including Pipelines, Stacks, and Super Learner. We have done our best to streamline the process of creating new sl3 learners.

-

Before diving into defining a new learner, it will likely be helpful to read some background material. If you haven’t already read it, the “Modern Machine Learning in R” vignette is a good introduction to the sl3 package and it’s underlying architecture. The R6 documentation will help you understand how R6 classes are defined. In addition, the help files for sl3_Task and Lrnr_base are good resources for how those objects can be used. If you’re interested in defining learners that fit sub-learners, reading the documentation of the delayed package will be helpful.

+

Before diving into defining a new learner, it will likely be helpful to read some background material. If you haven’t already read it, the “Modern Machine Learning in R” vignette is a good introduction to the sl3 package and it’s underlying architecture. The R6 documentation will help you understand how R6 classes are defined. In addition, the help files for sl3_Task and Lrnr_base are good resources for how those objects can be used. If you’re interested in defining learners that fit sub-learners, reading the documentation of the delayed package will be helpful.

In the following sections, we introduce and review a template for a new sl3 learner, describing the sections that can be used to define your new learner. This is followed by a discussion of the important task of documenting and testing your new learner. Finally, we conclude by explaining how you can add your learner to sl3 so that others may make use of it.

+library(sl3)
-
-

-Learner Template

+
+

Learner Template +

sl3 provides a template of a learner for use in defining new learners. You can make a copy of the template to work on by invoking write_learner_template:

 ## Not run:
@@ -165,7 +167,7 @@ 

portable = TRUE, class = TRUE, # Above, you should change Lrnr_template (in both the object name and the classname argument) # to a name that indicates what your learner does - public = list( + public = list( # you can define default parameter values here # if possible, your learner should define defaults for all required parameters initialize = function(param_1 = "default_1", param_2 = "default_2", ...) { @@ -179,13 +181,13 @@

special_function = function(arg_1) { } ), - private = list( + private = list( # list properties your learner supports here. # Use sl3_list_properties() for a list of options - .properties = c(""), + .properties = c(""), # list any packages required for your learner here. - .required_packages = c("my_package"), + .required_packages = c("my_package"), # .train takes task data and returns a fit object that can be used to generate predictions .train = function(task) { @@ -202,7 +204,7 @@

# add task data to the argument list # what these arguments are called depends on the learner you are wrapping - args$x <- as.matrix(task$X_intercept) + args$x <- as.matrix(task$X_intercept) args$y <- outcome_type$format(task$Y) # only add arguments on weights and offset @@ -222,7 +224,7 @@

# return the fit object, which will be stored # in a learner object and returned from the call # to learner$predict - return(fit_object) + return(fit_object) }, # .predict takes a task and returns predictions from that task @@ -231,53 +233,54 @@

self$training_outcome_type self$fit_object - predictions <- predict(self$fit_object, task$X) - return(predictions) + predictions <- predict(self$fit_object, task$X) + return(predictions) } ) )

The template has comments indicating where details specific to the learner you’re trying to implement should be filled in. In the next section, we will discuss those details further.

-
-

-Defining your Learner

-
-

-Learner Name and Class

-

At the top of the template, we define an object Lrnr_template and set classname = "Lrnr_template". You should modify these to match the name of your new learner, which should also match the name of the corresponding R file. Note that the name should be prefixed by Lrnr_ and use snake_case.

+
+

Defining your Learner +

+
+

Learner Name and Class +

+

At the top of the template, we define an object Lrnr_template and set classname = "Lrnr_template". You should modify these to match the name of your new learner, which should also match the name of the corresponding R file. Note that the name should be prefixed by Lrnr_ and use snake_case.

-
-

-public$initialize +
+

+public$initialize

-

This function defines the constructor for your learner, and it stores the arguments (if any) provided when a user calls make_learner(Lrnr_your_learner, ...). You can also provide default parameter values, just as the template does with param_1 = "default_1", and param_2 = "default_2". All parameters used by your newly defined learners should have defaults whenever possible. This will allow users to use your learner without having to figure out what reasonable parameter values might be. Parameter values should be documented; see the section below on documentation for details.

+

This function defines the constructor for your learner, and it stores the arguments (if any) provided when a user calls make_learner(Lrnr_your_learner, ...). You can also provide default parameter values, just as the template does with param_1 = "default_1", and param_2 = "default_2". All parameters used by your newly defined learners should have defaults whenever possible. This will allow users to use your learner without having to figure out what reasonable parameter values might be. Parameter values should be documented; see the section below on documentation for details.

-
-

-public$special_functions

+
+

+public$special_functions +

You can of course define functions for things only your learner can do. These should be public functions like the special_function defined in the example. These should be documented; see the section below on documentation for details.

-
-

-private$.properties +
+

+private$.properties

This field defines properties supported by your learner. This may include different outcome types that are supported, offsets and weights, amongst many other possibilities. To see a list of all properties supported/used by at least one learner, you may invoke sl3_list_properties:

-
##  [1] "binomial"      "categorical"   "continuous"    "cv"           
-##  [5] "density"       "h2o"           "ids"           "importance"   
-##  [9] "offset"        "preprocessing" "sampling"      "screener"     
-## [13] "timeseries"    "weights"       "wrapper"
+sl3_list_properties()
+
##  [1] "binomial"      "categorical"   "continuous"    "cv"           
+##  [5] "density"       "h2o"           "ids"           "importance"   
+##  [9] "offset"        "preprocessing" "sampling"      "screener"     
+## [13] "timeseries"    "weights"       "wrapper"

-
-

-private$.required_packages +
+

+private$.required_packages

This field defines other R packages required for your learner to work properly. These will be loaded when an object of your new learner class is initialized.

-
-

-User Interface for Learners

+
+

User Interface for Learners +

If you’ve used sl3 before, you may have noticed that while users are instructed to use learner$train, learner$predict, and learner$chain, to train, generate predictions, and generate a chained task for a given learner object, respectively, the template does not implement these methods. Instead, the template implements private methods called .train, .predict, and .chain. The specifics of these methods are explained below; however, it is helpful to first understand how the two sets of methods are related. At the risk of complicating things further, it is worth noting that there is actually a third set of methods (learner$base_train, learner$base_predict, and learner$base_chain) of which you may not be aware.

So, what happens when a user calls learner$train? That method generates a delayed object using the delayed_learner_train function, and then computes that delayed object. In turn, delayed_learner_train defines a delayed computation that calls base_train, a user-facing function that can be used to train tasks without using the facilities of the delayed package. base_train validates the user input, and in turn calls private$.train. When private$.train returns a fit_object, base_train takes that fit object, generates a learner fit object, and returns it to the user.

Each call to learner$train involves three separate training methods:

@@ -292,49 +295,49 @@

The logic in the user-facing learner$train and learner$base_train is defined in the Lrnr_base base class and is shared across all learners. As such, these methods need not be reimplemented in individual learners. By contrast, private$.train contains the behavior that is specific to each individual learner and should be reimplemented at the level of each individual learner. Since learner$base_train does not use delayed, it may be helpful to use it when debugging the training code in a new learner. The program flow used for prediction and chaining is analogous.

-
-

-private$.train +
+

+private$.train

This is the main training function, which takes in a task and returns a fit_object that contains all information needed to generate predictions. The fit object should not contain more data than is absolutely necessary, as including excess information will create needless inefficiencies. Many learner functions (like glm) store one or more copies of their training data – this uses unnecessary memory and will hurt learner performance for large sample sizes. Thus, these copies of the data should be removed from the fit object before it is returned. You may make use of true_obj_size to estimate the size of your fit_object. For most learners, fit_object size should not grow linearly with training sample size. If it does, and this is unexpected, please try to reduce the size of the fit_object.

Most of the time, the learner you are implementing will be fit using a function that already exists elsewhere. We’ve built some tools to facilitate passing parameter values directly to such functions. The private$.train function in the template uses a common pattern: it builds up an argument list starting with the parameter values and using data from the task, it then uses call_with_args to call my_ml_fun with that argument list. It’s not required that learners use this pattern, but it will be helpful in the common case where the learner is simply wrapping an underlying my_ml_fun.

By default, call_with_args will pass all arguments in the argument list matched by the definition of the function that it is calling. This allows the learner to silently drop irrelevant parameters from the call to my_ml_fun. Some learners either capture important arguments using dot arguments (...) or by passing important arguments through such dot arguments on to a secondary function. Both of these cases can be handled using the other_valid and keep_all options to call_with_args. The former allows you to list other valid arguments and the latter disables argument filtering altogether.

-
-

-private$.predict +
+

+private$.predict

This is the main prediction function, and takes in a task and generates predictions for that task using the fit_object. If those predictions are 1-dimensional, they will be coerced to a vector by base_predict.

-
-

-private$.chain +
+

+private$.chain

This is the main chaining function. It takes in a task and generates a chained task (based on the input task) using the given fit_object. If this method is not implemented, your learner will use the default chaining behavior, which is to return a new task where the covariates are defined as your learner’s predictions for the current task.

-
-

-Advanced: Learners with sub-learners

+
+

+Advanced: Learners with sub-learners +

Generally speaking, the above sections will be all that’s required for implementing a new learner in the sl3 framework. In some cases, it may be desirable to define learners that have “sub-learners” or other learners on which they depend. Examples of such learners are Stack, Pipeline, Lrnr_cv, and Lrnr_sl. In order to parallelize the fitting of these sub-learners using delayed, these learners implement a specialized private$.train_sublearners method that calls delayed_learner_train on their sub-learners, returning a single delayed object that, when evaluated, returns all relevant fit objects from these sub-learners. The result of that call is then passed as a second argument to their private$.train method, which now has the function prototype private$.train(task, trained_sublearners). Learners defined in such a manner usually have a much shorter computation time; the predict and chain methods are not currently parallelized in this way, although this is subject to change in the future.

If, like these learners, your learner depends on sub-learners, you have two options:

  1. Don’t worry about parallelizing sub-learners. Simply implement private$.train as discussed above, being sure to call sublearner$base_train and not sublearner$train, to avoid nesting calls to delayed, which may result in sub-optimal performance.
  2. -
  3. Implement private$.train_sublearners(task) and private$.train(task, trained_sublearners), to parallelize sub-learners using delayed. We suggest reviewing the implementations of the Stack, Pipeline, Lrnr_cv and Lrnr_sl to get a better understanding of how to implement parallelized sub-learners.
  4. +
  5. Implement private$.train_sublearners(task) and private$.train(task, trained_sublearners), to parallelize sub-learners using delayed. We suggest reviewing the implementations of the Stack, Pipeline, Lrnr_cv and Lrnr_sl to get a better understanding of how to implement parallelized sub-learners.

In either case, you should be careful to call sublearner$base_predict and sublearner$base_chain, instead of sublearner$predict and sublearner$chain, except in the context of the private$.train_sublearners function, where you should use delayed_learner_fit_predict and delayed_learner_fit_chain.

-
-

-Documenting and Testing your Learner

-

If you want other people to be able to use your learner, you will need to document and provide unit tests for it. The above template has example documentation, written in the roxygen format. Most importantly, you should describe what your learner does, reference any external code it uses, and document any parameters and public methods defined by it.

-

It’s also important to test your learner. You should write unit tests to verify that your learner can train and predict on new data, and, if applicable, generate a chained task. It might also be a good idea to use the risk function in sl3 to verify your learner’s performance on a sample dataset. That way, if you change your learner and performance drops, you know something may have gone wrong.

+
+

Documenting and Testing your Learner +

+

If you want other people to be able to use your learner, you will need to document and provide unit tests for it. The above template has example documentation, written in the roxygen format. Most importantly, you should describe what your learner does, reference any external code it uses, and document any parameters and public methods defined by it.

+

It’s also important to test your learner. You should write unit tests to verify that your learner can train and predict on new data, and, if applicable, generate a chained task. It might also be a good idea to use the risk function in sl3 to verify your learner’s performance on a sample dataset. That way, if you change your learner and performance drops, you know something may have gone wrong.

-
-

-Submitting your Learner to sl3 +
+

Submitting your Learner to sl3

-

Once you’ve implemented your new learner (and made sure that it has quality documentation and unit tests), please consider adding it to the sl3 project. This will make it possible for other sl3 users to use and build on your work. Make sure to add any R packages listed in .required_packages to the Suggests: field of the DESCRIPTION file of the sl3 package. Once this is done, please submit a Pull Request to the sl3 package on GitHub to request that your learned be added. If you’ve never made a “Pull Request” before, see this helpful guide: https://yangsu.github.io/pull-request-tutorial/.

+

Once you’ve implemented your new learner (and made sure that it has quality documentation and unit tests), please consider adding it to the sl3 project. This will make it possible for other sl3 users to use and build on your work. Make sure to add any R packages listed in .required_packages to the Suggests: field of the DESCRIPTION file of the sl3 package. Once this is done, please submit a Pull Request to the sl3 package on GitHub to request that your learned be added. If you’ve never made a “Pull Request” before, see this helpful guide: https://yangsu.github.io/pull-request-tutorial/.

From the sl3 team, thanks for your interest in extending sl3!

@@ -350,11 +353,13 @@

-

Site built with pkgdown 1.6.1.

+

+

Site built with pkgdown 2.0.1.

@@ -363,5 +368,7 @@

+ + diff --git a/docs/articles/index.html b/docs/articles/index.html index 515072bf..9b6864ab 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,76 +1,18 @@ - - - - - - - -Articles • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Articles • sl3 - - - - - - + + - - -
-
- -
- -
+
+
Defining New `sl3` Learners
+
+
Modern Machine Learning in R
+
+
-
- +
- - + + diff --git a/docs/articles/intro_sl3.html b/docs/articles/intro_sl3.html index d641f15f..67b6accc 100644 --- a/docs/articles/intro_sl3.html +++ b/docs/articles/intro_sl3.html @@ -25,6 +25,8 @@ + +
+
-
-

-Introduction

-

The sl3 package provides a modern framework for machine learning. This includes the Super Learner algorithm (van der Laan, Polley, and Hubbard 2007), a method for performing stacked regressions (Breiman 1996), combined with covariate screening and cross-validation. sl3 uses an Object Oriented Programming (OOP) approach and leverages R6 classes to define both Tasks (machine learning problems) and Learners (machine learning algorithms that attempt to solve those problems) in a way that is both flexible and extensible. The design of sl3 owes a lot to the SuperLearner and mlr packages, which also provide unified frameworks for Super Learning and machine learning, respectively.

-
-

-Example Data

+
+

Introduction +

+

The sl3 package provides a modern framework for machine learning. This includes the Super Learner algorithm (van der Laan, Polley, and Hubbard 2007), a method for performing stacked regressions (Breiman 1996), combined with covariate screening and cross-validation. sl3 uses an Object Oriented Programming (OOP) approach and leverages R6 classes to define both Tasks (machine learning problems) and Learners (machine learning algorithms that attempt to solve those problems) in a way that is both flexible and extensible. The design of sl3 owes a lot to the SuperLearner and mlr packages, which also provide unified frameworks for Super Learning and machine learning, respectively.

+
+

Example Data +

Throughout this vignette, we use data from the Collaborative Perinatal Project (CPP) to illustrate the features of sl3 as well as its proper usage. For convenience, we’ve included an imputed version of this dataset in the sl3 package. Below, we load some useful packages, load the cpp_imputed dataset, and define the variables (columns) from the data set we’re interested in:

-set.seed(49753)
+set.seed(49753)
 
 # packages we'll be using
-library(data.table)
-library(SuperLearner)
-library(origami)
-library(sl3)
+library(data.table)
+library(SuperLearner)
+library(origami)
+library(sl3)
 
 # load example data set
-data(cpp_imputed)
+data(cpp_imputed)
 
 # here are the covariates we are interested in and, of course, the outcome
-covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs",
+covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs",
             "sexn")
 outcome <- "haz"
-
-

-Basics of Object Oriented Programming

-

As mentioned above, sl3 is designed using basic OOP principles and the R6 OOP framework. While we’ve tried to make it easy to use sl3 without worrying much about OOP, it is helpful to have some intuition about how sl3 is structured. In this section, we briefly outline some key concepts from OOP. Readers familiar with OOP basics are invited to skip this section. The key concept of OOP is that of an object, a collection of data and functions that corresponds to some conceptual unit. Objects have two main types of elements, fields, which can be thought of as nouns, are information about an object, and methods, which can be thought of as verbs, are actions an object can perform. Objects are members of classes, which define what those specific fields and methods are. Classes can inherit elements from other classes (sometimes called base classes) – accordingly, classes that are similar, but not exactly the same, can share some parts of their definitions.

-

Many different implementations of OOP exist, with variations in how these concepts are implemented and used. R has several different implementations, including S3, S4, reference classes, and R6. sl3 uses the R6 implementation. In R6, methods and fields of a class object are accessed using the $ operator. The next section explains how these concepts are used in sl3 to model machine learning problems and algorithms.

+
+

Basics of Object Oriented Programming +

+

As mentioned above, sl3 is designed using basic OOP principles and the R6 OOP framework. While we’ve tried to make it easy to use sl3 without worrying much about OOP, it is helpful to have some intuition about how sl3 is structured. In this section, we briefly outline some key concepts from OOP. Readers familiar with OOP basics are invited to skip this section. The key concept of OOP is that of an object, a collection of data and functions that corresponds to some conceptual unit. Objects have two main types of elements, fields, which can be thought of as nouns, are information about an object, and methods, which can be thought of as verbs, are actions an object can perform. Objects are members of classes, which define what those specific fields and methods are. Classes can inherit elements from other classes (sometimes called base classes) – accordingly, classes that are similar, but not exactly the same, can share some parts of their definitions.

+

Many different implementations of OOP exist, with variations in how these concepts are implemented and used. R has several different implementations, including S3, S4, reference classes, and R6. sl3 uses the R6 implementation. In R6, methods and fields of a class object are accessed using the $ operator. The next section explains how these concepts are used in sl3 to model machine learning problems and algorithms.

-
-

-sl3 objects

-
-

-Tasks

+
+

+sl3 objects +

+
+

Tasks +

The sl3_Task class defines machine learning problems. An sl3_Task object keeps track of the task data, as well as what variables play what roles in the machine learning problem. We can see an example of that here, using the cpp dataset described above:

 task <- make_sl3_Task(data = cpp_imputed, covariates = covars,
@@ -153,30 +156,30 @@ 

Let’s take a look at this object:

 task
-
## A sl3 Task with 1441 obs and these nodes:
-## $covariates
-## [1] "apgar1"   "apgar5"   "parity"   "gagebrth" "mage"     "meducyrs" "sexn"    
-## 
-## $outcome
-## [1] "haz"
-## 
-## $id
-## NULL
-## 
-## $weights
-## NULL
-## 
-## $offset
-## NULL
-## 
-## $time
-## NULL
-

In addition to the simple usage demonstrated above, make_sl3_Task supports a range of options in order to facilitate the proper articulation of more advanced specifics potentially informative of the machine learning problem of interest. For example, we can specify the id, weights, and offset nodes listed above. These additional features are documented in the help for sl3_Task.

+
## A sl3 Task with 1441 obs and these nodes:
+## $covariates
+## [1] "apgar1"   "apgar5"   "parity"   "gagebrth" "mage"     "meducyrs" "sexn"    
+## 
+## $outcome
+## [1] "haz"
+## 
+## $id
+## NULL
+## 
+## $weights
+## NULL
+## 
+## $offset
+## NULL
+## 
+## $time
+## NULL
+

In addition to the simple usage demonstrated above, make_sl3_Task supports a range of options in order to facilitate the proper articulation of more advanced specifics potentially informative of the machine learning problem of interest. For example, we can specify the id, weights, and offset nodes listed above. These additional features are documented in the help for sl3_Task.

-
-

-Learners

+
+

Learners +

Lrnr_base is the base class for defining machine learning algorithms, as well as fits for those algorithms to particular sl3_Tasks. Different machine learning algorithms are defined in classes that inherit from Lrnr_base. For instance, the Lrnr_glm class inherits from Lrnr_base, and defines a learner that fits generalized linear models. We will use the term learners to refer to the family of classes that inherit from Lrnr_base. Learner objects can be constructed from their class definitions using the make_learner function:

 # make learner object
@@ -188,39 +191,39 @@ 

# verify that the learner is fit lrnr_glm_fit$is_trained

-
## [1] TRUE
+
## [1] TRUE

Here, we fit the learner to the CPP task we defined above. Both lrnr_glm and lrnr_glm_fit are objects of class Lrnr_glm, although the former defines a learner and the latter defines a fit of that learner. We can distiguish between the learners and learner fits using the is_trained field, which is true for fits but not for learners.

Now that we’ve fit a learner, we can generate predictions using the predict method:

 # get learner predictions
 preds <- lrnr_glm_fit$predict(task)
-head(preds)
-
## [1] 0.36298498 0.36298498 0.25993072 0.25993072 0.25993072 0.05680264
+head(preds)
+
## [1] 0.36298498 0.36298498 0.25993072 0.25993072 0.25993072 0.05680264

Here, we specified task as the task for which we wanted to generate predictions. If we had omitted this, we would have gotten the same predictions because predict defaults to using the task provided to train (called the training task). Alternatively, we could have provided a different task for which we want to generate predictions.

-

The final important learner method, chain, will be discussed below, in the section on learner composition. As with sl3_Task, learners have a variety of fields and methods we haven’t discussed here. More information on these is available in the help for Lrnr_base.

-
-

-Finding Learners

+

The final important learner method, chain, will be discussed below, in the section on learner composition. As with sl3_Task, learners have a variety of fields and methods we haven’t discussed here. More information on these is available in the help for Lrnr_base.

+
+

Finding Learners +

Learners have properties that indicate what features they support. You can use sl3_list_properties to get a list of all properties supported by at least one learner. You can then use sl3_list_learners to find learners supporting any set of properties. For example:

-
##  [1] "binomial"      "categorical"   "continuous"    "cv"           
-##  [5] "density"       "h2o"           "ids"           "importance"   
-##  [9] "offset"        "preprocessing" "sampling"      "screener"     
-## [13] "timeseries"    "weights"       "wrapper"
+sl3_list_properties()
+
##  [1] "binomial"      "categorical"   "continuous"    "cv"           
+##  [5] "density"       "h2o"           "ids"           "importance"   
+##  [9] "offset"        "preprocessing" "sampling"      "screener"     
+## [13] "timeseries"    "weights"       "wrapper"
-sl3_list_learners(c("binomial", "offset"))
-
##  [1] "Lrnr_bayesglm" "Lrnr_ga"       "Lrnr_glm"      "Lrnr_glm_fast"
-##  [5] "Lrnr_h2o_glm"  "Lrnr_h2o_grid" "Lrnr_lightgbm" "Lrnr_mean"    
-##  [9] "Lrnr_optim"    "Lrnr_solnp"    "Lrnr_xgboost"
+sl3_list_learners(c("binomial", "offset"))
+
##  [1] "Lrnr_bayesglm" "Lrnr_ga"       "Lrnr_glm"      "Lrnr_glm_fast"
+##  [5] "Lrnr_h2o_glm"  "Lrnr_h2o_grid" "Lrnr_lightgbm" "Lrnr_mean"    
+##  [9] "Lrnr_optim"    "Lrnr_solnp"    "Lrnr_xgboost"

The list of supported learners is currently somewhat limited. Despite current limitations, some learners not yet supported natively in sl3 can be used via their corresponding wrappers in the SuperLearner package. SuperLearner wrappers, screeners, and methods can all be used as sl3 learners via Lrnr_pkg_SuperLearner, Lrnr_pkg_SuperLearner_screener, and Lrnr_pkg_SuperLearner_method respectively. To learn more about SuperLearner wrappers, screeners, and methods, consult the documentation provided with that R package. Here’s an example of defining a sl3 learner that uses the SL.glmnet wrapper from SuperLearner.

 lrnr_sl_glmnet <- make_learner(Lrnr_pkg_SuperLearner, "SL.glmnet")

In most cases, using these wrappers will not be as efficient as their native sl3 counterparts. If your favorite learner is missing from sl3, please consider adding it by following the “Defining New Learners” vignette.

-
-

-Learner Parameters

+
+

Learner Parameters +

In general, learners can be instantiated without providing any additional parameters. We’ve tried to provide sensible defaults for each learner; however, if you would like to modify the learners’ behavior, you may do so by instantiating learners with different parameters.

sl3 Learners support some common parameters that work with all learners for which they are applicable:

    @@ -230,93 +233,93 @@

-
-

-Composing Learners

+
+

Composing Learners +

sl3 defines two special learners, Pipeline and Stack, that allow learners to be composed in a flexible manner.

-
-

-Pipelines

+
+

Pipelines +

A pipeline is a set of learners to be fit sequentially, where the fit from one learner is used to define the task for the next learner. There are many ways in which a learner can define the task for the downstream learner. The chain method defined by learners defines how this will work. Let’s look at the example of pre-screening variables. For now, we’ll rely on a screener from the SuperLearner package, although native sl3 screening algorithms will be implemented soon.

Below, we generate a screener object based on the SuperLearner function screen.corP and fit it to our task. Inspecting the fit, we see that it selected a subset of covariates:

-screen_cor <- Lrnr_pkg_SuperLearner_screener$new("screen.corP")
+screen_cor <- Lrnr_pkg_SuperLearner_screener$new("screen.corP")
 screen_fit <- screen_cor$train(task)
-print(screen_fit)
-
## [1] "Lrnr_pkg_SuperLearner_screener_screen.corP"
-## $selected
-## [1] "parity"   "gagebrth"
+print(screen_fit)
+
## [1] "Lrnr_pkg_SuperLearner_screener_screen.corP"
+## $selected
+## [1] "parity"   "gagebrth"

Now, chain may be called on this learner fit to define a downstream task:

 screened_task <- screen_fit$chain()
-print(screened_task)
-
## A sl3 Task with 1441 obs and these nodes:
-## $covariates
-## [1] "parity"   "gagebrth"
-## 
-## $outcome
-## [1] "haz"
-## 
-## $id
-## NULL
-## 
-## $weights
-## NULL
-## 
-## $offset
-## NULL
-## 
-## $time
-## NULL
+print(screened_task)
+
## A sl3 Task with 1441 obs and these nodes:
+## $covariates
+## [1] "parity"   "gagebrth"
+## 
+## $outcome
+## [1] "haz"
+## 
+## $id
+## NULL
+## 
+## $weights
+## NULL
+## 
+## $offset
+## NULL
+## 
+## $time
+## NULL

As with predict, we can omit a task from the call to chain, in which case the call defaults to using the same task that was used for training. We can see that the chained task reduces the covariates to the subset selected by the screener. We can fit this new task using the lrnr_glm we defined above:

 screened_glm_fit <- lrnr_glm$train(screened_task)
 screened_preds <- screened_glm_fit$predict()
-head(screened_preds)
-
## [1]  0.38084472  0.38084472  0.29887623  0.29887623  0.29887623 -0.00987784
+head(screened_preds)
+
## [1]  0.38084472  0.38084472  0.29887623  0.29887623  0.29887623 -0.00987784

The Pipeline class automates this process. It takes an arbitrary number of learners and fits them sequentially, training and chaining each one in turn. Since Pipeline is a learner like any other, it shares the same interface. We can define a pipeline using make_learner, and use train and predict just as we did before:

 sg_pipeline <- make_learner(Pipeline, screen_cor, lrnr_glm)
 sg_pipeline_fit <- sg_pipeline$train(task)
 sg_pipeline_preds <- sg_pipeline_fit$predict()
-head(sg_pipeline_preds)
-
## [1]  0.38084472  0.38084472  0.29887623  0.29887623  0.29887623 -0.00987784
+head(sg_pipeline_preds)
+
## [1]  0.38084472  0.38084472  0.29887623  0.29887623  0.29887623 -0.00987784

We see that the pipeline returns the same predictions as manually training glm on the chained task from the screening learner.

We can visualize the pipeline we defined above:

-
- +
+
-
-

-Stacks

+
+

Stacks +

Like Pipelines, Stacks combine multiple learners. Stacks train learners simultaneously, so that their predictions can be either combined or compared. Again, Stack is just a special learner and so has the same interface as all other learners:

 stack <- make_learner(Stack, lrnr_glm, sg_pipeline)
 stack_fit <- stack$train(task)
 stack_preds <- stack_fit$predict()
-head(stack_preds)
-
##    Lrnr_glm_TRUE
-## 1:    0.36298498
-## 2:    0.36298498
-## 3:    0.25993072
-## 4:    0.25993072
-## 5:    0.25993072
-## 6:    0.05680264
-##    Pipeline(Lrnr_pkg_SuperLearner_screener_screen.corP->Lrnr_glm_TRUE)
-## 1:                                                          0.38084472
-## 2:                                                          0.38084472
-## 3:                                                          0.29887623
-## 4:                                                          0.29887623
-## 5:                                                          0.29887623
-## 6:                                                         -0.00987784
+head(stack_preds)
+
##    Lrnr_glm_TRUE
+## 1:    0.36298498
+## 2:    0.36298498
+## 3:    0.25993072
+## 4:    0.25993072
+## 5:    0.25993072
+## 6:    0.05680264
+##    Pipeline(Lrnr_pkg_SuperLearner_screener_screen.corP->Lrnr_glm_TRUE)
+## 1:                                                          0.38084472
+## 2:                                                          0.38084472
+## 3:                                                          0.29887623
+## 4:                                                          0.29887623
+## 5:                                                          0.29887623
+## 6:                                                         -0.00987784

Above, we’ve defined and fit a stack comprised of a simple glm learner as well as a pipeline that combines a screening algorithm with that same learner. We could have included any abitrary set of learners and pipelines, the latter of which are themselves just learners. We can see that the predict method now returns a matrix, with a column for each learner included in the stack.

We can visualize the stack:

-
-

We see one “branch” for each learner in the stack.

+
+

We see one “branch” for each learner in the stack.

-
-

-Cross-validation

+
+

Cross-validation +

Having defined a stack, we might want to compare the performance of learners in the stack, which we may do using cross-validation. The Lrnr_cv learner wraps another learner and performs training and prediction in a cross-validated fashion, using separate training and validation splits as defined by task$folds.

Below, we define a new Lrnr_cv object based on the previously defined stack and train it and generate predictions on the validation set:

@@ -326,18 +329,18 @@ 

We can also use the special Lrnr_cv function cv_risk to estimate cross-validated risk values:

 risks <- cv_fit$cv_risk(loss_squared_error)
-print(risks)
-
##                                                                learner
-## 1:                                                       Lrnr_glm_TRUE
-## 2: Pipeline(Lrnr_pkg_SuperLearner_screener_screen.corP->Lrnr_glm_TRUE)
-##    coefficients      MSE        se   fold_sd fold_min_MSE fold_max_MSE
-## 1:           NA 1.600368 0.1042245 0.3521137     1.062662     2.139263
-## 2:           NA 1.601804 0.1032100 0.3419678     1.066897     2.108442
+print(risks)

+
##                                                                learner
+## 1:                                                       Lrnr_glm_TRUE
+## 2: Pipeline(Lrnr_pkg_SuperLearner_screener_screen.corP->Lrnr_glm_TRUE)
+##    coefficients      MSE        se   fold_sd fold_min_MSE fold_max_MSE
+## 1:           NA 1.603528 0.1047656 0.3075915     1.199039     2.220739
+## 2:           NA 1.604261 0.1032685 0.3024194     1.211052     2.235441

In this example, we don’t see much difference between the two learners, suggesting the addition of the screening step in the pipeline learner didn’t improve performance much.

-
-

-The Super Learner Algorithm

+
+

The Super Learner Algorithm +

We can combine all of the above elements, Pipelines, Stacks, and cross-validation using Lrnr_cv, to easily define a Super Learner. The Super Learner algorithm works by fitting a “meta-learner”, which combines predictions from multiple stacked learners. It does this while avoiding overfitting by training the meta-learner on validation-set predictions in a manner that is cross-validated. Using some of the objects we defined in the above examples, this becomes a very simple operation:

 metalearner <- make_learner(Lrnr_nnls)
@@ -348,101 +351,106 @@ 

 sl_pipeline <- make_learner(Pipeline, stack_fit, ml_fit)
 sl_preds <- sl_pipeline$predict()
-head(sl_preds)
-
## [1] 0.34125504 0.34125504 0.25355166 0.25355166 0.25355166 0.02901442
+head(sl_preds)

+
## [1] 0.3338819 0.3338819 0.2485932 0.2485932 0.2485932 0.0270070

A Super Learner may be fit in a more streamlined manner using the Lrnr_sl learner. For simplicity, we will use the same set of learners and meta-learning algorithm as we did before:

 sl <- Lrnr_sl$new(learners = stack,
                   metalearner = metalearner)
 sl_fit <- sl$train(task)
 lrnr_sl_preds <- sl_fit$predict()
-head(lrnr_sl_preds)
-
## [1] 0.34125504 0.34125504 0.25355166 0.25355166 0.25355166 0.02901442
+head(lrnr_sl_preds)
+
## [1] 0.3338819 0.3338819 0.2485932 0.2485932 0.2485932 0.0270070

We can see that this generates the same predictions as the more hands-on definition above.

-
-

-Computation with delayed +
+

Computation with delayed

Fitting a Super Learner is composed of many different training and prediction steps, as the procedure requires that the learners in the stack and the meta-learner be fit on cross-validation folds and on the full data. For large datasets, this can be extremely time-consuming. To alleviate this complication, we’ve developed a specialized parallelization framework delayed that parallelizes across these tasks in a way that takes into account their inter-dependent nature. Consider a Super Learner with three learners:

 lrnr_rf <- make_learner(Lrnr_randomForest)
 lrnr_glmnet <- make_learner(Lrnr_glmnet)
-sl <- Lrnr_sl$new(learners = list(lrnr_glm, lrnr_rf, lrnr_glmnet),
+sl <- Lrnr_sl$new(learners = list(lrnr_glm, lrnr_rf, lrnr_glmnet),
                   metalearner = metalearner)

We can plot the network of tasks required to train this Super Learner:

-delayed_sl_fit <- delayed_learner_train(sl, task)
-plot(delayed_sl_fit)
-
-

delayed then allows us to parallelize the procedure across these tasks using the future package. For more information on specifying future plans for parallelization, see the documentation of the future package. Performance comparisons can be found in the “SuperLearner Benchmarks” vignette that accompanies this package. This feature is currently experimental and hasn’t yet been throughly tested on a range of parallel backends.

+delayed_sl_fit <- delayed_learner_train(sl, task) +plot(delayed_sl_fit)
+
+

delayed then allows us to parallelize the procedure across these tasks using the future package. For more information on specifying future plans for parallelization, see the documentation of the future package. Performance comparisons can be found in the “SuperLearner Benchmarks” vignette that accompanies this package. This feature is currently experimental and hasn’t yet been throughly tested on a range of parallel backends.


-
-

-Session Information

-
## R version 4.0.3 (2020-10-10)
-## Platform: x86_64-apple-darwin17.0 (64-bit)
-## Running under: macOS Big Sur 10.16
-## 
-## Matrix products: default
-## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
-## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
-## 
-## locale:
-## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
-## 
-## attached base packages:
-## [1] splines   stats     graphics  grDevices utils     datasets  methods  
-## [8] base     
-## 
-## other attached packages:
-## [1] origami_1.0.5       SuperLearner_2.0-28 gam_1.20           
-## [4] foreach_1.5.1       nnls_1.4            data.table_1.14.2  
-## [7] sl3_1.4.4          
-## 
-## loaded via a namespace (and not attached):
-##   [1] nlme_3.1-149         fs_1.5.0             lubridate_1.8.0     
-##   [4] progress_1.2.2       rprojroot_2.0.2      tools_4.0.3         
-##   [7] backports_1.4.0      bslib_0.2.4          utf8_1.2.2          
-##  [10] R6_2.5.1             rpart_4.1-15         DBI_1.1.0           
-##  [13] colorspace_2.0-2     nnet_7.3-14          withr_2.4.3         
-##  [16] tidyselect_1.1.1     prettyunits_1.1.1    compiler_4.0.3      
-##  [19] glmnet_4.1-2         textshaping_0.2.1    desc_1.3.0          
-##  [22] sass_0.3.1           scales_1.1.1         checkmate_2.0.0     
-##  [25] randomForest_4.6-14  pkgdown_1.6.1        systemfonts_0.3.2   
-##  [28] stringr_1.4.0        digest_0.6.29        rmarkdown_2.7.2     
-##  [31] pkgconfig_2.0.3      htmltools_0.5.2      parallelly_1.29.0   
-##  [34] fastmap_1.1.0        htmlwidgets_1.5.4    rlang_0.4.12        
-##  [37] BBmisc_1.11          shape_1.4.6          visNetwork_2.1.0    
-##  [40] jquerylib_0.1.3      generics_0.1.1       jsonlite_1.7.2      
-##  [43] dplyr_1.0.7          ModelMetrics_1.2.2.2 magrittr_2.0.1      
-##  [46] delayed_0.3.0        Matrix_1.2-18        Rcpp_1.0.7          
-##  [49] munsell_0.5.0        fansi_0.5.0          abind_1.4-5         
-##  [52] lifecycle_1.0.1      pROC_1.18.0          stringi_1.7.6       
-##  [55] yaml_2.2.1           MASS_7.3-53          plyr_1.8.6          
-##  [58] recipes_0.1.17       grid_4.0.3           parallel_4.0.3      
-##  [61] listenv_0.8.0        crayon_1.4.2         lattice_0.20-41     
-##  [64] hms_1.1.1            knitr_1.33           pillar_1.6.4        
-##  [67] igraph_1.2.9         uuid_1.0-3           stats4_4.0.3        
-##  [70] future.apply_1.8.1   reshape2_1.4.4       codetools_0.2-16    
-##  [73] glue_1.5.1           evaluate_0.14        vctrs_0.3.8         
-##  [76] Rdpack_2.1.2         gtable_0.3.0         purrr_0.3.4         
-##  [79] rstackdeque_1.1.1    future_1.23.0        assertthat_0.2.1    
-##  [82] ggplot2_3.3.5        xfun_0.22            gower_0.2.2         
-##  [85] rbibutils_2.2.5      prodlim_2019.11.13   ragg_0.4.0          
-##  [88] class_7.3-17         survival_3.2-7       timeDate_3043.102   
-##  [91] tibble_3.1.6         iterators_1.0.13     memoise_1.1.0       
-##  [94] lava_1.6.10          globals_0.14.0       imputeMissings_0.0.3
-##  [97] ellipsis_0.3.2       caret_6.0-90         ROCR_1.0-11         
-## [100] ipred_0.9-12
+
+

Session Information +

+
## R version 4.1.2 (2021-11-01)
+## Platform: x86_64-pc-linux-gnu (64-bit)
+## Running under: Ubuntu 20.04.3 LTS
+## 
+## Matrix products: default
+## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
+## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
+## 
+## locale:
+##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
+##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
+##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
+##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
+##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
+## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
+## 
+## attached base packages:
+## [1] splines   stats     graphics  grDevices utils     datasets  methods  
+## [8] base     
+## 
+## other attached packages:
+## [1] origami_1.0.5       SuperLearner_2.0-28 gam_1.20           
+## [4] foreach_1.5.1       nnls_1.4            data.table_1.14.2  
+## [7] sl3_1.4.4          
+## 
+## loaded via a namespace (and not attached):
+##   [1] nlme_3.1-153         fs_1.5.2             lubridate_1.8.0     
+##   [4] progress_1.2.2       rprojroot_2.0.2      tools_4.1.2         
+##   [7] backports_1.4.1      bslib_0.3.1          utf8_1.2.2          
+##  [10] R6_2.5.1             rpart_4.1-15         DBI_1.1.2           
+##  [13] colorspace_2.0-2     nnet_7.3-16          withr_2.4.3         
+##  [16] tidyselect_1.1.1     prettyunits_1.1.1    compiler_4.1.2      
+##  [19] glmnet_4.1-3         textshaping_0.3.6    desc_1.4.0          
+##  [22] sass_0.4.0           scales_1.1.1         checkmate_2.0.0     
+##  [25] randomForest_4.6-14  pkgdown_2.0.1        systemfonts_1.0.3   
+##  [28] stringr_1.4.0        digest_0.6.29        rmarkdown_2.11      
+##  [31] R.utils_2.11.0       pkgconfig_2.0.3      htmltools_0.5.2     
+##  [34] parallelly_1.30.0    fastmap_1.1.0        htmlwidgets_1.5.4   
+##  [37] rlang_0.4.12         BBmisc_1.11          shape_1.4.6         
+##  [40] visNetwork_2.1.0     jquerylib_0.1.4      generics_0.1.1      
+##  [43] jsonlite_1.7.2       ModelMetrics_1.2.2.2 dplyr_1.0.7         
+##  [46] R.oo_1.24.0          magrittr_2.0.1       delayed_0.4.0       
+##  [49] Matrix_1.4-0         Rcpp_1.0.7           munsell_0.5.0       
+##  [52] fansi_0.5.0          abind_1.4-5          lifecycle_1.0.1     
+##  [55] R.methodsS3_1.8.1    pROC_1.18.0          stringi_1.7.6       
+##  [58] yaml_2.2.1           MASS_7.3-54          plyr_1.8.6          
+##  [61] recipes_0.1.17       grid_4.1.2           parallel_4.1.2      
+##  [64] listenv_0.8.0        crayon_1.4.2         lattice_0.20-45     
+##  [67] hms_1.1.1            knitr_1.37           pillar_1.6.4        
+##  [70] igraph_1.2.10        uuid_1.0-3           stats4_4.1.2        
+##  [73] reshape2_1.4.4       future.apply_1.8.1   codetools_0.2-18    
+##  [76] glue_1.6.0           evaluate_0.14        vctrs_0.3.8         
+##  [79] Rdpack_2.1.3         gtable_0.3.0         purrr_0.3.4         
+##  [82] rstackdeque_1.1.1    future_1.23.0        assertthat_0.2.1    
+##  [85] cachem_1.0.6         ggplot2_3.3.5        xfun_0.29           
+##  [88] gower_0.2.2          prodlim_2019.11.13   rbibutils_2.2.7     
+##  [91] ragg_1.2.1           class_7.3-19         survival_3.2-13     
+##  [94] timeDate_3043.102    tibble_3.1.6         iterators_1.0.13    
+##  [97] memoise_2.0.1        lava_1.6.10          globals_0.14.0      
+## [100] imputeMissings_0.0.3 ellipsis_0.3.2       caret_6.0-90        
+## [103] ROCR_1.0-11          ipred_0.9-12

-
-

-References

-
+
+

References +

+

Breiman, Leo. 1996. “Stacked Regressions.” Machine Learning 24 (1): 49–64.

@@ -464,11 +472,13 @@

-

Site built with pkgdown 1.6.1.

+

+

Site built with pkgdown 2.0.1.

@@ -477,5 +487,7 @@

+ + diff --git a/docs/authors.html b/docs/authors.html index 41f60458..1a684b10 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,76 +1,18 @@ - - - - - - - -Citation and Authors • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Authors and Citation • sl3 - - - - - - + + - - -
-
- -
- -
+
-
-
- +
- - + + diff --git a/docs/index.html b/docs/index.html index 8cf7b090..ceccf1d6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,6 +27,8 @@ + +
-
- +
+

A flexible implementation of the Super Learner ensemble machine learning system

-

Authors: Jeremy Coyle, Nima Hejazi, Ivana Malenica, Rachael Phillips, and Oleg Sofrygin

+

Authors: Jeremy Coyle, Nima Hejazi, Ivana Malenica, Rachael Phillips, and Oleg Sofrygin


-
-

-What’s sl3?

+
+

What’s sl3? +

sl3 is an implementation of the Super Learner ensemble machine learning algorithm of van der Laan, Polley, and Hubbard (2007). The Super Learner algorithm performs ensemble learning in one of two fashions:

-
    +
    1. The discrete Super Learner can be used to select the best prediction algorithm from among a supplied library of machine learning algorithms (“learners” in the sl3 nomenclature) – that is, the discrete Super Learner is the single learning algorithm that minimizes the cross-validated risk.
    2. The ensemble Super Learner can be used to assign weights to a set of specified learning algorithms (from a user-supplied library of such algorithms) so as to create a combination of these learners that minimizes the cross-validated risk. This notion of weighted combinations has also been referred to as stacked regression (Breiman 1996) and stacked generalization (Wolpert 1992).
    -

    Looking for long-form documentation or a walkthrough of the sl3 package? Don’t worry! Just browse the chapter in our book.

    +

    Looking for long-form documentation or a walkthrough of the sl3 package? Don’t worry! Just browse the chapter in our book.


-
-

-Installation

+
+

Installation +

-

Install the most recent version from the master branch on GitHub via remotes:

+

Install the most recent version from the master branch on GitHub via remotes:

-remotes::install_github("tlverse/sl3")
-

Past stable releases may be located via the releases page on GitHub and may be installed by including the appropriate major version tag. For example,

+remotes::install_github("tlverse/sl3")
+

Past stable releases may be located via the releases page on GitHub and may be installed by including the appropriate major version tag. For example,

-remotes::install_github("tlverse/sl3@v1.3.7")
+remotes::install_github("tlverse/sl3@v1.3.7")

To contribute, check out the devel branch and consider submitting a pull request.


-
-

-Issues

-

If you encounter any bugs or have any specific feature requests, please file an issue.

+
+

Issues +

+

If you encounter any bugs or have any specific feature requests, please file an issue.


-
-

-Examples

+
+

Examples +

sl3 makes the process of applying screening algorithms, learning algorithms, combining both types of algorithms into a stacked regression model, and cross-validating this whole process essentially trivial. The best way to understand this is to see the sl3 package in action:

-set.seed(49753)
-library(tidyverse)
-library(data.table)
-library(SuperLearner)
-library(origami)
-library(sl3)
+set.seed(49753)
+library(tidyverse)
+library(data.table)
+library(SuperLearner)
+library(origami)
+library(sl3)
 
 # load example data set
-data(cpp)
-cpp <- cpp %>%
-  dplyr::filter(!is.na(haz)) %>%
-  mutate_all(~ replace(., is.na(.), 0))
+data(cpp)
+cpp <- cpp %>%
+  dplyr::filter(!is.na(haz)) %>%
+  mutate_all(~ replace(., is.na(.), 0))
 
 # use covariates of intest and the outcome to build a task object
-covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs",
+covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs",
             "sexn")
 task <- sl3_Task$new(
   data = cpp,
@@ -170,23 +172,23 @@ 

) # set up screeners and learners via built-in functions and pipelines -slscreener <- Lrnr_pkg_SuperLearner_screener$new("screen.glmnet") +slscreener <- Lrnr_pkg_SuperLearner_screener$new("screen.glmnet") glm_learner <- Lrnr_glm$new() screen_and_glm <- Pipeline$new(slscreener, glm_learner) -SL.glmnet_learner <- Lrnr_pkg_SuperLearner$new(SL_wrapper = "SL.glmnet") +SL.glmnet_learner <- Lrnr_pkg_SuperLearner$new(SL_wrapper = "SL.glmnet") # stack learners into a model (including screeners and pipelines) learner_stack <- Stack$new(SL.glmnet_learner, glm_learner, screen_and_glm) stack_fit <- learner_stack$train(task) preds <- stack_fit$predict() -head(preds) +head(preds) #> Lrnr_pkg_SuperLearner_SL.glmnet Lrnr_glm_TRUE -#> 1: 0.35767321 0.36298498 -#> 2: 0.35767321 0.36298498 -#> 3: 0.25185377 0.25993072 -#> 4: 0.25185377 0.25993072 -#> 5: 0.25185377 0.25993072 -#> 6: 0.04220823 0.05680264 +#> 1: 0.3525946 0.36298498 +#> 2: 0.3525946 0.36298498 +#> 3: 0.2442593 0.25993072 +#> 4: 0.2442593 0.25993072 +#> 5: 0.2442593 0.25993072 +#> 6: 0.0269504 0.05680264 #> Pipeline(Lrnr_pkg_SuperLearner_screener_screen.glmnet->Lrnr_glm_TRUE) #> 1: 0.36228209 #> 2: 0.36228209 @@ -194,22 +196,22 @@

#> 4: 0.25870995 #> 5: 0.25870995 #> 6: 0.05600958

-
-

-Parallelization with futures

-

While it’s straightforward to fit a stack of learners (as above), it’s easy to take advantage of sl3’s built-in parallelization support too. To do this, you can simply choose a plan() from the future ecosystem.

+
+

Parallelization with futures +

+

While it’s straightforward to fit a stack of learners (as above), it’s easy to take advantage of sl3’s built-in parallelization support too. To do this, you can simply choose a plan() from the future ecosystem.

 # let's load the future package and set 4 cores for parallelization
-library(future)
-plan(multicore, workers = 4L)
+library(future)
+plan(multicore, workers = 4L)
 
 # now, let's re-train our Stack in parallel
 stack_fit <- learner_stack$train(task)
 preds <- stack_fit$predict()
-
-

-Controlling the number of CV folds

+
+

Controlling the number of CV folds +

In the above examples, we fit stacks of learners, but didn’t create a Super Learner ensemble, which uses cross-validation (CV) to build the ensemble model. For the sake of computational expedience, we may be interested in lowering the number of CV folds (from 10). Let’s take a look at how to do both below.

 # first, let's instantiate some more learners and create a Super Learner
@@ -229,17 +231,16 @@ 

# now, let's fit the Super Learner with just 5-fold CV, then get predictions sl_fit <- sl$train(task) sl_preds <- sl_fit$predict()

-

The folds argument to sl3_Task supports both integers (for V-fold

-

CV) and all of the CV schemes supported in the origami package. To see the full list, query ?fold_funs from within R or take a look at origami’s online documentation.

+

The folds argument to sl3_Task supports both integers (for V-fold CV) and all of the CV schemes supported in the origami package. To see the full list, query ?fold_funs from within R or take a look at origami’s online documentation.


-
-

-Learner Properties

+
+

Learner Properties +

Properties supported by sl3 learners are presented in the following table:

- +
@@ -1042,56 +1043,6 @@

- - - - - - - - - - - - - - - - - -
-

Lrnr_ga

-
-

-
-

-
-

-
-

x

-
-

x

-
-

x

-
-

x

-
-

x

-
-

-
-

x

-
-

x

-
-

x

-
-

x

-
-

-
-

x

-

Lrnr_gam

@@ -2145,7 +2096,7 @@

Lrnr_nnls

-

+

x

x

@@ -3445,17 +3396,17 @@


-
-

-Contributions

-

Contributions are very welcome. Interested contributors should consult our contribution guidelines prior to submitting a pull request.

+
+

Contributions +

+

Contributions are very welcome. Interested contributors should consult our contribution guidelines prior to submitting a pull request.


-
-

-Citation

+
+

Citation +

After using the sl3 R package, please cite the following:

-
    @software{coyle2021sl3-rpkg,
+
 @software{coyle2021sl3-rpkg,
       author = {Coyle, Jeremy R and Hejazi, Nima S and Malenica, Ivana and
         Phillips, Rachael V and Sofrygin, Oleg},
       title = {{sl3}: Modern Pipelines for Machine Learning and {Super
@@ -3468,17 +3419,17 @@ 

}


-
-

-License

-

© 2017-2021 Jeremy R. Coyle, Nima S. Hejazi, Ivana Malenica, Rachael V. Phillips, Oleg Sofrygin

+
+

License +

+

© 2017-2021 Jeremy R. Coyle, Nima S. Hejazi, Ivana Malenica, Rachael V. Phillips, Oleg Sofrygin

The contents of this repository are distributed under the GPL-3 license. See file LICENSE for details.


-
-

-References

-
+
+

References +

+

Breiman, Leo. 1996. “Stacked Regressions.” Machine Learning 24 (1): 49–64.

@@ -3495,64 +3446,69 @@

-

Site built with pkgdown 1.6.1.

+

+

Site built with pkgdown 2.0.1.

@@ -3561,5 +3517,7 @@

Dev status

+ + diff --git a/docs/news/index.html b/docs/news/index.html index f29a3231..96af966c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,76 +1,18 @@ - - - - - - - -Changelog • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Changelog • sl3 - - - - - - - - + + -
-
- -
- -
+
-
-

-sl3 1.4.3

-
    -
  • Additional arguments for ‘Keras’ learners Lrnr_lstm_keras and Lrnr_gru_keras provide support for callback functions list and 2-layer networks. Default callbacks list provides early stopping criteria with respect to ‘Keras’ defaults and patience of 10 epochs. Also, these two ‘Keras’ learners now call args_to_list upon initialization, and set verbose argument according to options("keras.fit_verbose") or options("sl3.verbose").
  • +
    + +
    • Updates to Lrnr_nnls to support binary outcomes, including support for convexity of the resultant model fit and warnings on prediction quality.
    • +
    • Refined, clearer documentation for Lrnr_define_interactions +
    • +
    • Tweaks to Lrnr_bound to better support more flexible bounding for continuous outcomes (automatically setting a maximum of infinity).
    • +
    • Changes to Lrnr_cv_selector to support improved computation of the CV-risk, averaging the risk strictly across validation/holdout sets.
    • +
    • Bug fixes for Lrnr_earth (improving formals recognition), Lrnr_glmnet (allowing offsets), and Lrnr_caret (reformatting of arguments).
    • +
    +
    + +
    • Additional arguments for ‘Keras’ learners Lrnr_lstm_keras and Lrnr_gru_keras provide support for callback functions list and 2-layer networks. Default callbacks list provides early stopping criteria with respect to ‘Keras’ defaults and patience of 10 epochs. Also, these two ‘Keras’ learners now call args_to_list upon initialization, and set verbose argument according to options("keras.fit_verbose") or options("sl3.verbose").
    • Update Lrnr_xgboost to support prediction tasks consisting of one observation (e.g., leave-one-out cross-validation).
    • Update Lrnr_sl by adding a new private slot .cv_risk to store the risk estimates, using this to avoid unnecessary re-computation in the print method (the .cv_risk slot is populated on the first print call, and only ever re-printed thereafter).
    • Update documentation of default_metalearner to use native markdown tables.
    • Fix Lrnr_screener_importance’s pairing of (a) covariates returned by the importance function with (b) covariates as they are defined in the task. This issue only arose when discrete covariates were automatically one-hot encoded upon task initiation (i.e., when colnames(task$X) != task$nodes$covariates).
    • Reformat importance_plot to plot variables in decreasing order of importance, so most important variables are placed at the top of the dotchart.
    • Enhanced functionality in sl3 task’s add_interactions method to support interactions that involve factors. This method is most commonly used by Lrnr_define_interactions, which is intended for use with another learner (e.g., Lrnr_glmnet or Lrnr_glm) in a Pipeline.
    • -
    • Modified Lrnr_gam formula (if not specified by user) to not use mgcv’s default k=10 degrees of freedom for each smooth s term when there are less than k=10 degrees of freedom. This bypasses an mgcv::gam error, and tends to be relevant only for small n. 
    • -
    • Added options(java.parameters = "-Xmx2500m") and warning message when Lrnr_bartMachine is initialized, if this option has not already been set. This option was incorporated since the default RAM of 500MB for a Java virtual machine often errors due to memory issues with Lrnr_bartMachine.
    • +
    • Modified Lrnr_gam formula (if not specified by user) to not use mgcv’s default k=10 degrees of freedom for each smooth s term when there are less than k=10 degrees of freedom. This bypasses an mgcv::gam error, and tends to be relevant only for small n.
    • +
    • Added options(java.parameters = "-Xmx2500m") and warning message when Lrnr_bartMachine is initialized, if this option has not already been set. This option was incorporated since the default RAM of 500MB for a Java virtual machine often errors due to memory issues with Lrnr_bartMachine.
    • Incorporated stratify_cv argument in Lrnr_glmnet, which stratifies internal cross-validation folds such that binary outcome prevalence in training and validation folds roughly matches the prevalence in the training task.
    • Incorporated min_screen argument Lrnr_screener_coefs, which tries to ensure that at least min_screen number of covariates are selected. If this argument is specified and the learner argument in Lrnr_screener_coefs is a Lrnr_glmnet, then lambda is increased until min_screen number of covariates are selected and a warning is produced. If min_screen is specified and the learner argument in Lrnr_screener_coefs is not a Lrnr_glmnet then it will error.
    • Updated Lrnr_hal9001 to work with v0.4.0 of the hal9001 package.
    • -
    • Added formula parameter and process_formula function to the base learner, Lrnr_base, whose methods carry over to all other learners. When a formula is supplied as a learner parameter, the process_formula function constructs a design matrix by supplying the formula to model.matrix. This implementation allows formula to be supplied to all learners, even those without native formula support. The formula should be an object of class “formula”, or a character string that can be coerced to that class.
    • +
    • Added formula parameter and process_formula function to the base learner, Lrnr_base, whose methods carry over to all other learners. When a formula is supplied as a learner parameter, the process_formula function constructs a design matrix by supplying theformulatomodel.matrix. This implementation allowsformulato be supplied to all learners, even those without nativeformulasupport. Theformulashould be an object of class "formula`", or a character string that can be coerced to that class.
    • Added factory function for performance-based risks for binary outcomes with ROCR performance measures custom_ROCR_risk. Supports cutoff-dependent and scalar ROCR performance measures. The risk is defined as 1 - performance, and is transformed back to the performance measure in cv_risk and importance functions. This change prompted the revision of argument name loss_fun and loss_function to eval_fun and eval_function, respectively, since the evaluation of predictions relative to the observations can be either a risk or a loss function. This argument name change impacted the following: Lrnr_solnp, Lrnr_optim, Lrnr_cv_selector, cv_risk, importance, and CV_Lrnr_sl.
    • Added name attribute to all loss functions, where naming was defined in terms of the risk implied by each loss function (i.e., the common name for the expected loss). The names in cv_risk and importance tables now swap “risk” with this name attribute.
    • Incorporated stratified cross-validation when folds are not supplied to the sl3_Task and the outcome is a discrete (i.e., binary or categorical) variable.
    • Added to the importance method the option to evaluate importance over covariate_groups, by removing/permuting all covariates in the same group together.
    • Added Lrnr_ga as another metalearner.
    • -
    -
    -
    -

    -sl3 1.4.2

    -
      -
    • Updates to variable importance functionality, including calculation of risk ratio and risk differences under covariate deletion or permutation.
    • +
    +
    + +
    • Updates to variable importance functionality, including calculation of risk ratio and risk differences under covariate deletion or permutation.
    • Addition of a importance_plot to summarize variable importance findings.
    • Additions of new methods reparameterize and retrain to Lrnr_base, which allows modification of the covariate set while training on a conserved task and prediction on a new task using previously trained learners, respectively.
    • -
    -
    -
    -

    -sl3 1.4.1

    -
      -
    • [TODO]
    • -
    +
+
+ +

[missing]

-
-

-sl3 1.4.0

-
    -
  • [TODO]
  • -
+
+ +

[missing]

-
-

-sl3 1.3.9

-
    -
  • [TODO]
  • -
+
+ +

[missing]

-
-

-sl3 1.3.8

-
    -
  • Updates to variable importance functionality, including use of risk ratios.
  • +
    + +
    • Updates to variable importance functionality, including use of risk ratios.
    • Change Lrnr_hal9001 and Lrnr_glmnet to respect observation-level IDs.
    • Removal of Remotes and deprecation of Lrnr_rfcde and Lrnr_condensier: -
        -
      • Both of these learner classes provided support for conditional density estimation (CDE) and were useful when support for CDE was more limited. Unfortunately, both packages are un-maintained or updated only very sporadically, resulting in both frequent bugs and presenting an obstacle for an eventual CRAN release (both packages are GitHub-only).
      • +
        • Both of these learner classes provided support for conditional density estimation (CDE) and were useful when support for CDE was more limited. Unfortunately, both packages are un-maintained or updated only very sporadically, resulting in both frequent bugs and presenting an obstacle for an eventual CRAN release (both packages are GitHub-only).
        • -Lrnr_rfcde wrapped https://github.com/tpospisi/RFCDE, a sporadically maintained tool for conditional density estimation (CDE). Support for this has been removed in favor of built-in CDE tools, including, among others, Lrnr_density_semiparametric.
        • +Lrnr_rfcde wrapped https://github.com/tpospisi/RFCDE, a sporadically maintained tool for conditional density estimation (CDE). Support for this has been removed in favor of built-in CDE tools, including, among others, Lrnr_density_semiparametric.
        • -Lrnr_condensier wrapped https://github.com/osofr/condensier, which provided a pooled hazards approach to CDE. This package contained an implementation error (https://github.com/osofr/condensier/issues/15) and was removed from CRAN. Support for this has been removed in favor of Lrnr_density_semiparametric and Lrnr_haldensify, both of which more reliably provide CDE support.
        • -
        - -
      -
    -
    -

    -sl3 1.3.7

    -
      -
    • Sampling methods for Monte Carlo integration and related procedures.
    • +Lrnr_condensier wrapped https://github.com/osofr/condensier, which provided a pooled hazards approach to CDE. This package contained an implementation error (https://github.com/osofr/condensier/issues/15) and was removed from CRAN. Support for this has been removed in favor of Lrnr_density_semiparametric and Lrnr_haldensify, both of which more reliably provide CDE support. +
    +
+
+ +
  • Sampling methods for Monte Carlo integration and related procedures.
  • A metalearner for the cross-validation selector (discrete super learner).
  • A learner for bounding, including support for bounded losses.
  • -
  • Resolution of a number of older issues (see #264).
  • +
  • Resolution of a number of older issues (see #264).
  • Relaxation of checks inside Stack objects for time series learners.
  • Addition of a learner property table to README.Rmd.
  • Maintenance and documentation updates.
  • -
-
-
-

-sl3 1.3.5

-
    -
  • Overhaul of data preprocessing.
  • +
+
+ +
  • Overhaul of data preprocessing.
  • New screening methods and convex combination in Lrnr_nnls.
  • Bug fixes, including covariate subsetting and better handling of NAs.
  • Package and documentation cleanup; continuous integration and testing fixes.
  • Reproducibility updates (including new versioning and DOI minting).
  • -
-
-
-

-sl3 1.3.0

-
    -
  • Fixes incorrect handling of missingness in the automatic imputation procedure.
  • +
+
+ +
  • Fixes incorrect handling of missingness in the automatic imputation procedure.
  • Adds new standard learners, including from the gam and caret packages.
  • Adds custom learners for conditional density estimation, including semiparametric methods based on conditional mean and conditional mean/variance estimation as well as generalized functionality for density estimation via a pooled hazards approach.
  • -
-
-
-

-sl3 1.2.0

-
    -
  • Default metalearners based on task outcome types.
  • +
+
+ +
  • Default metalearners based on task outcome types.
  • Handling of imputation internally in task objects.
  • Addition of several new learners, including from the gbm, earth, polspline packages.
  • Fixing errors in existing learners (e.g., subtle parallelization in xgboost and ranger).
  • Support for multivariate outcomes
  • Sets default cross-validation to be revere-style.
  • Support for cross-validated super learner and variable importance.
  • -
-
-
-

-sl3 1.1.0

-
    -
  • A full-featured and stable release of the project.
  • +
+
+ +
  • A full-featured and stable release of the project.
  • Numerous learners are included and many bugs have been fixed relative to earlier versions (esp v1.0.0) of the software.
  • -
-
-
-

-sl3 1.0.0

-
    -
  • An initial stable release.
  • -
-
+
+
+ +
  • An initial stable release.
  • +
+
-
- +
- - + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css index 1273238d..80ea5b83 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -56,8 +56,10 @@ img.icon { float: right; } -img { +/* Ensure in-page images don't run outside their container */ +.contents img { max-width: 100%; + height: auto; } /* Fix bug in bootstrap (only seen in firefox) */ @@ -78,11 +80,10 @@ dd { /* Section anchors ---------------------------------*/ a.anchor { - margin-left: -30px; - display:inline-block; - width: 30px; - height: 30px; - visibility: hidden; + display: none; + margin-left: 5px; + width: 20px; + height: 20px; background-image: url(./link.svg); background-repeat: no-repeat; @@ -90,17 +91,15 @@ a.anchor { background-position: center center; } -.hasAnchor:hover a.anchor { - visibility: visible; -} - -@media (max-width: 767px) { - .hasAnchor:hover a.anchor { - visibility: hidden; - } +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; } - /* Fixes for fixed navbar --------------------------*/ .contents h1, .contents h2, .contents h3, .contents h4 { @@ -264,31 +263,26 @@ table { /* Syntax highlighting ---------------------------------------------------- */ -pre { - word-wrap: normal; - word-break: normal; - border: 1px solid #eee; -} - -pre, code { +pre, code, pre code { background-color: #f8f8f8; color: #333; } +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} -pre code { - overflow: auto; - word-wrap: normal; - white-space: pre; +pre { + border: 1px solid #eee; } -pre .img { +pre .img, pre .r-plt { margin: 5px 0; } -pre .img img { +pre .img img, pre .r-plt img { background-color: #fff; - display: block; - height: auto; } code a, pre a { @@ -305,9 +299,8 @@ a.sourceLine:hover { .kw {color: #264D66;} /* keyword */ .co {color: #888888;} /* comment */ -.message { color: black; font-weight: bolder;} -.error { color: orange; font-weight: bolder;} -.warning { color: #6A0366; font-weight: bolder;} +.error {font-weight: bolder;} +.warning {font-weight: bolder;} /* Clipboard --------------------------*/ @@ -365,3 +358,27 @@ mark { content: ""; } } + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 7e7048fa..6f0eee40 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -80,7 +80,7 @@ $(document).ready(function() { var copyButton = ""; - $(".examples, div.sourceCode").addClass("hasCopyButton"); + $("div.sourceCode").addClass("hasCopyButton"); // Insert copy buttons: $(copyButton).prependTo(".hasCopyButton"); @@ -91,7 +91,7 @@ // Initialize clipboard: var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { - return trigger.parentNode.textContent; + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 6abee29b..5bb5007d 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,10 +1,10 @@ -pandoc: 2.9.2.1 -pkgdown: 1.6.1 +pandoc: '2.5' +pkgdown: 2.0.1 pkgdown_sha: ~ articles: custom_lrnrs: custom_lrnrs.html intro_sl3: intro_sl3.html -last_built: 2021-12-14T03:18Z +last_built: 2021-12-23T06:38Z urls: reference: https://tlverse.org/sl3/reference article: https://tlverse.org/sl3/articles diff --git a/docs/reference/CV_lrnr_sl.html b/docs/reference/CV_lrnr_sl.html index 24c42ee6..a01fc919 100644 --- a/docs/reference/CV_lrnr_sl.html +++ b/docs/reference/CV_lrnr_sl.html @@ -1,77 +1,18 @@ - - - - - - - -Estimates cross-validated risk of the Super Learner — CV_lrnr_sl • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Estimates cross-validated risk of the Super Learner — CV_lrnr_sl • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,52 +80,42 @@

Estimates cross-validated risk of the Super Learner

Estimates cross-validated risk of the Super Learner

-
CV_lrnr_sl(lrnr_sl, task, eval_fun)
- -

Arguments

- - - - - - - - - - - - - - -
lrnr_sl

a Lrnr_sl object specifying the Super Learner.

task

the task used for training and performance assessment.

eval_fun

the evaluation function, either a loss or risk function, for -evaluating the Super Learner's predictions.

+
+
CV_lrnr_sl(lrnr_sl, task, eval_fun)
+
+
+

Arguments

+
lrnr_sl
+

a Lrnr_sl object specifying the Super Learner.

+
task
+

the task used for training and performance assessment.

+
eval_fun
+

the evaluation function, either a loss or risk function, for +evaluating the Super Learner's predictions.

+
+
-
- +
- - + + diff --git a/docs/reference/Custom_chain.html b/docs/reference/Custom_chain.html index 9b8ed0c0..98abfe99 100644 --- a/docs/reference/Custom_chain.html +++ b/docs/reference/Custom_chain.html @@ -1,79 +1,20 @@ - - - - - - - -Customize chaining for a learner — Custom_chain • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Customize chaining for a learner — Custom_chain • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -152,141 +84,137 @@

Customize chaining for a learner

learner$train and learner$predict are unaffected.

-
customize_chain(learner, chain_fun)
- -

Arguments

- - - - - - - - - - -
learner

A sl3 learner to modify.

chain_fun

A function with arguments learner and task -that defines the new chain behavior.

- -

Format

+
+
customize_chain(learner, chain_fun)
+
+
+

Format

R6Class object.

-

Value

- -

Lrnr_base object with methods for training and +

+
+

Arguments

+
learner
+

A sl3 learner to modify.

+
chain_fun
+

A function with arguments learner and task +that defines the new chain behavior.

+
+
+

Value

+

Lrnr_base object with methods for training and prediction

-

Fields

- +
+
+

Fields

-
-
params

A list of learners to chain.

+
params
+

A list of learners to chain.

-
-

Methods

+
+ +
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_HarmonicReg.html b/docs/reference/Lrnr_HarmonicReg.html index dfd8e51c..db06f981 100644 --- a/docs/reference/Lrnr_HarmonicReg.html +++ b/docs/reference/Lrnr_HarmonicReg.html @@ -1,46 +1,5 @@ - - - - - - - -Harmonic Regression — Lrnr_HarmonicReg • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Harmonic Regression — Lrnr_HarmonicReg • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner fits first harmonics in a Fourier expansion to one or more time series. Fourier decomposition relies on -fourier, and the time series is fit using -tslm. For further details on working with harmonic +fourier, and the time series is fit using +tslm. For further details on working with harmonic regression for time-series with package forecast, consider consulting Hyndman et al. (2021) ) and @@ -165,160 +97,161 @@

Harmonic Regression

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • K: Maximum order of the fourier terms. Passed to -fourier.

  • +
    • K: Maximum order of the fourier terms. Passed to +fourier.

    • freq: The frequency of the time series.

    • -
    • ...: Other parameters passed to fourier.

    • -
    - -

    References

    - +
  • ...: Other parameters passed to fourier.

  • +
+
+

References

Hyndman R, Athanasopoulos G, Bergmeir C, Caceres G, Chhay L, O'Hara-Wild M, Petropoulos F, Razbash S, Wang E, Yasmeen F (2021). forecast: Forecasting functions for time series and linear models. -R package version 8.14, https://pkg.robjhyndman.com/forecast/.

Hyndman RJ, Khandakar Y (2008). -“Automatic time series forecasting: the forecast package for R.” +R package version 8.14, https://pkg.robjhyndman.com/forecast/.

Hyndman RJ, Khandakar Y (2008). +“Automatic time series forecasting: the forecast package for R.” Journal of Statistical Software, 26(3), 1--22. -https://www.jstatsoft.org/article/view/v027i03.

-

See also

- - - -

Examples

-
#> origami v1.0.5: Generalized Framework for Cross-Validation
library(data.table) -data(bsds) - -# make folds appropriate for time-series cross-validation -folds <- make_folds(bsds, - fold_fun = folds_rolling_window, window_size = 500, - validation_size = 100, gap = 0, batch = 50 -) - -# build task by passing in external folds structure -task <- sl3_Task$new( - data = bsds, - folds = folds, - covariates = c( - "weekday", "temp" - ), - outcome = "cnt" -) - -# create tasks for taining and validation -train_task <- training(task, fold = task$folds[[1]]) -valid_task <- validation(task, fold = task$folds[[1]]) +https://www.jstatsoft.org/article/view/v027i03.

+
+ -# instantiate learner, then fit and predict -HarReg_learner <- Lrnr_HarmonicReg$new(K = 7, freq = 105) -
#> Registered S3 method overwritten by 'quantmod': -#> method from -#> as.zoo.data.frame zoo
HarReg_fit <- HarReg_learner$train(train_task) -HarReg_preds <- HarReg_fit$predict(valid_task) -
+
+

Examples

+
library(origami)
+#> origami v1.0.5: Generalized Framework for Cross-Validation
+library(data.table)
+data(bsds)
+
+# make folds appropriate for time-series cross-validation
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+# build task by passing in external folds structure
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+# create tasks for taining and validation
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+# instantiate learner, then fit and predict
+HarReg_learner <- Lrnr_HarmonicReg$new(K = 7, freq = 105)
+#> Registered S3 method overwritten by 'quantmod':
+#>   method            from
+#>   as.zoo.data.frame zoo 
+HarReg_fit <- HarReg_learner$train(train_task)
+HarReg_preds <- HarReg_fit$predict(valid_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_arima.html b/docs/reference/Lrnr_arima.html index fadb2015..c0c400f8 100644 --- a/docs/reference/Lrnr_arima.html +++ b/docs/reference/Lrnr_arima.html @@ -1,78 +1,19 @@ - - - - - - - -Univariate ARIMA Models — Lrnr_arima • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Univariate ARIMA Models — Lrnr_arima • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,153 +83,151 @@

Univariate ARIMA Models

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
+ -arima_fit <- arima_lrnr$train(train_task) -arima_preds <- arima_fit$predict(valid_task) -
+
+

Examples

+
library(origami)
+data(bsds)
+
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+arima_lrnr <- make_learner(Lrnr_arima)
+
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+arima_fit <- arima_lrnr$train(train_task)
+arima_preds <- arima_fit$predict(valid_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_bartMachine.html b/docs/reference/Lrnr_bartMachine.html index a2a0f5c8..0fd638af 100644 --- a/docs/reference/Lrnr_bartMachine.html +++ b/docs/reference/Lrnr_bartMachine.html @@ -1,80 +1,21 @@ - - - - - - - -bartMachine: Bayesian Additive Regression Trees (BART) — Lrnr_bartMachine • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -bartMachine: Bayesian Additive Regression Trees (BART) — Lrnr_bartMachine • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -151,145 +83,145 @@

bartMachine: Bayesian Additive Regression Trees (BART)

This learner implements Bayesian Additive Regression Trees via bartMachine (described in Kapelner and Bleich (2016) ) -and the function bartMachine.

+and the function bartMachine.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • ...: Parameters passed to bartMachine. +

    • ...: Parameters passed to bartMachine. See it's documentation for details.

    • -
    - -

    References

    - +
+
+

References

Kapelner A, Bleich J (2016). -“bartMachine: Machine Learning with Bayesian Additive Regression Trees.” +“bartMachine: Machine Learning with Bayesian Additive Regression Trees.” Journal of Statistical Software, 70(4), 1--40. -doi: 10.18637/jss.v070.i04 +doi: 10.18637/jss.v070.i04 .

-

See also

- - - -

Examples

-
# set up ML task -data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") +
+ -# fit a bartMachine model and predict from it -bartMachine_learner <- make_learner(Lrnr_bartMachine) -
#> Warning: User did not specify Java RAM option, and this learner often fails with the default RAM of 500MB, -#> so setting that now as `options(java.parameters = '-Xmx2500m')`. -#> -#> Note that Xmx parameter's upper limit is system dependent -#> (e.g., 32bit Windows will fail to work with anything much largerthan 1500m), -#> so ideally this option should be specified by the user.
bartMachine_fit <- bartMachine_learner$train(task) -preds <- bartMachine_fit$predict() -
+
+

Examples

+
# set up ML task
+data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# fit a bartMachine model and predict from it
+bartMachine_learner <- make_learner(Lrnr_bartMachine)
+#> Warning: User did not specify Java RAM option, and this learner often fails with the default RAM of 500MB,
+#> so setting that now as `options(java.parameters = '-Xmx2500m')`.
+#> 
+#> Note that Xmx parameter's upper limit is system dependent 
+#> (e.g., 32bit Windows will fail to work with anything much largerthan 1500m), 
+#> so ideally this option should be specified by the user.
+bartMachine_fit <- bartMachine_learner$train(task)
+preds <- bartMachine_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_base.html b/docs/reference/Lrnr_base.html index 1869f047..c4abb0ed 100644 --- a/docs/reference/Lrnr_base.html +++ b/docs/reference/Lrnr_base.html @@ -1,80 +1,21 @@ - - - - - - - -Base Class for all sl3 Learners — Lrnr_base • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Base Class for all sl3 Learners — Lrnr_base • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -154,215 +86,250 @@

Base Class for all sl3 Learners

For more information on a particular learner, see its help file.

-
make_learner(learner_class, ...)
- -

Arguments

- - - - - - - - - - -
learner_class

The learner class to instantiate.

...

Parameters with which to instantiate the learner. See Parameters -section below.

- -

Format

+
+
make_learner(learner_class, ...)
+
+
+

Format

R6Class object.

-

Value

- +
+
+

Arguments

+
learner_class
+

The learner class to instantiate.

+
...
+

Parameters with which to instantiate the learner. See Parameters +section below.

+
+
+

Value

Learner object with methods for training and prediction

-

Common Parameters

- +
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
+
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

-

User Methods

+
+
+

User Methods

-
-
train(task)

Trains learner to a task using delayed. Returns a fit object

    -
  • task: The task to use for training

  • -

+
train(task)
+

Trains learner to a task using delayed. Returns a fit object

+
  • task: The task to use for training

  • +
-
base_train(task, trained_sublearners = NULL)

Trains learner to a task. Returns a fit object

    -
  • task: The task to use for training

  • + +
    base_train(task, trained_sublearners = NULL)
    +

    Trains learner to a task. Returns a fit object

    +
    • task: The task to use for training

    • trained_sublearners: Any sublearners previous trained. Almost always NULL

    • -

    +
+ + +
predict(task=NULL)
+

Generates predictions using delayed. Returns a prediction vector or matrix.

+
  • task: The task to use for prediction. If no task is provided, it will use the task used for training.

  • +
+ -
predict(task=NULL)

Generates predictions using delayed. Returns a prediction vector or matrix.

    -
  • task: The task to use for prediction. If no task is provided, it will use the task used for training.

  • -

+
base_predict(task=NULL)
+

Generates predictions. Returns a prediction vector or matrix.

+
  • task: The task to use for prediction. If no task is provided, it will use the task used for training.

  • +
-
base_predict(task=NULL)

Generates predictions. Returns a prediction vector or matrix.

    -
  • task: The task to use for prediction. If no task is provided, it will use the task used for training.

  • -

-
chain(task=NULL)

Generates a chained task using delayed

    -
  • task: The task to use for chaining If no task is provided, it will use the task used for training.

  • -

+
chain(task=NULL)
+

Generates a chained task using delayed

+
  • task: The task to use for chaining If no task is provided, it will use the task used for training.

  • +
-
base_chain(task=NULL)

Generates a chained task

    -
  • task: The task to use for chaining If no task is provided, it will use the task used for training.

  • -

-
+
base_chain(task=NULL)
+

Generates a chained task

+
  • task: The task to use for chaining If no task is provided, it will use the task used for training.

  • +
-

Fields

+
+
+

Fields

-
-
is_trained

TRUE if this is a learner fit, not an untrained learner

-
fit_object

The internal fit object

-
name

The learner name

-
learner_uuid

A unique identifier of this learner, but common to all fits of this learner

-
fit_uuid

A unique identifier of this learner fit. NULL if this is an untrained learner

-
params

A list of learner parameters, as specified on construction

-
training_task

The task used for training. NULL if this is an untrained learner

-
training_outcome_type

The outcome_type of the task used for training. NULL if this is an untrained learner

-
properties

The properties supported by this learner

-
coefficients

Fit coefficients, if this learner has coefficients. NULL otherwise, or if this is an untrained learner

+
is_trained
+

TRUE if this is a learner fit, not an untrained learner

+ +
fit_object
+

The internal fit object

+ +
name
+

The learner name

+ +
learner_uuid
+

A unique identifier of this learner, but common to all fits of this learner

-
+
fit_uuid
+

A unique identifier of this learner fit. NULL if this is an untrained learner

-

Internal Methods

+
params
+

A list of learner parameters, as specified on construction

+
training_task
+

The task used for training. NULL if this is an untrained learner

+ +
training_outcome_type
+

The outcome_type of the task used for training. NULL if this is an untrained learner

+ +
properties
+

The properties supported by this learner

+ +
coefficients
+

Fit coefficients, if this learner has coefficients. NULL otherwise, or if this is an untrained learner

+ + +
+
+

Internal Methods

These methods are primiarily for internal use only. They're not recommended for public consumption.

-
-
subset_covariates(task)

Returns a task with covariates subsetted using the covariates parameter.

    -
  • task: The task to subset

  • -

- -
get_outcome_type(task)

Mediates between the task outcome_type and parameter outcome_type. If a parameter outcome_type was specified, returns that. Otherwise, -returns the task$outcome_type.

    -
  • task: The task for which to determine the outcome_type

  • -

- -
train_sublearners(task)

Trains sublearners to a task using delayed. Returns a delayed sublearner fit.

    -
  • task: The task to use for training

  • -

- -
set_train(fit_object, training_task)

Converts a learner to a learner fit.

+ + +
assert_trained()
+

Throws an error if this learner does not have a fit_object

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_bayesglm.html b/docs/reference/Lrnr_bayesglm.html index e078ba3b..5b5fbd7e 100644 --- a/docs/reference/Lrnr_bayesglm.html +++ b/docs/reference/Lrnr_bayesglm.html @@ -1,80 +1,21 @@ - - - - - - - -Bayesian Generalized Linear Models — Lrnr_bayesglm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bayesian Generalized Linear Models — Lrnr_bayesglm • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for bayesian generalized linear -models (GLMs) from ar using bayesglm.fit. The GLMs +models (GLMs) from ar using bayesglm.fit. The GLMs fitted in this way can incorporate independent normal, t, or Cauchy prior distribution for the coefficients.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+ + -

Examples

-
data(cpp_imputed) -covars <- c( - "apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn" -) -outcome <- "haz" -task <- sl3_Task$new(cpp_imputed, - covariates = covars, - outcome = outcome -) -# fit and predict from a bayesian GLM -bayesglm_lrnr <- make_learner(Lrnr_bayesglm) -bayesglm_fit <- bayesglm_lrnr$train(task) -bayesglm_preds <- bayesglm_fit$predict(task) -
+
+

Examples

+
data(cpp_imputed)
+covars <- c(
+  "apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn"
+)
+outcome <- "haz"
+task <- sl3_Task$new(cpp_imputed,
+  covariates = covars,
+  outcome = outcome
+)
+# fit and predict from a bayesian GLM
+bayesglm_lrnr <- make_learner(Lrnr_bayesglm)
+bayesglm_fit <- bayesglm_lrnr$train(task)
+bayesglm_preds <- bayesglm_fit$predict(task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_bilstm.html b/docs/reference/Lrnr_bilstm.html index d17b9586..66dacfeb 100644 --- a/docs/reference/Lrnr_bilstm.html +++ b/docs/reference/Lrnr_bilstm.html @@ -1,81 +1,22 @@ - - - - - - - -Bidirectional Long short-term memory Recurrent Neural Network (LSTM) — Lrnr_bilstm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bidirectional Long short-term memory Recurrent Neural Network (LSTM) — Lrnr_bilstm • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,130 +89,145 @@

Bidirectional Long short-term memory Recurrent Neural Network (LSTM)

- -

Format

- +
+

Format

R6Class object.

-

Value

- -

Lrnr_base object with methods for training and prediction

-

Fields

- +
+
+

Value

+

Lrnr_base object with methods for training and prediction

+
+
+

Fields

-
-
units

Positive integer, dimensionality of the output space.

- -
loss

Name of a loss function used.

- -
optimizer

name of optimizer, or optimizer object.

- -
batch_size

Number of samples per gradient update.

- -
epochs

Number of epochs to train the model.

- -
window

Size of the sliding window input.

- -
activation

The activation function to use.

- -
dense

regular, densely-connected NN layer. Default is 1.

- -
dropout

float between 0 and 1. Fraction of the input units to drop.

- -
-

See also

- - +
units
+

Positive integer, dimensionality of the output space.

+ + +
loss
+

Name of a loss function used.

+ + +
optimizer
+

name of optimizer, or optimizer object.

+ + +
batch_size
+

Number of samples per gradient update.

+ + +
epochs
+

Number of epochs to train the model.

+ + +
window
+

Size of the sliding window input.

+ + +
activation
+

The activation function to use.

+ + +
dense
+

regular, densely-connected NN layer. Default is 1.

+ + +
dropout
+

float between 0 and 1. Fraction of the input units to drop.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_bound.html b/docs/reference/Lrnr_bound.html index d3950790..26f6f4b1 100644 --- a/docs/reference/Lrnr_bound.html +++ b/docs/reference/Lrnr_bound.html @@ -1,78 +1,19 @@ - - - - - - - -Bound Predictions — Lrnr_bound • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bound Predictions — Lrnr_bound • sl3 - - - - - - - - + + -
-
- -
- -
+

This learner bounds predictions. Intended for use as part of -Pipeline.

+Pipeline.

- -

Value

- -

A learner object inheriting from Lrnr_base with +

+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • bound: Either a vector of length two, with lower and upper +

    • bound: Either a vector of length two, with lower and upper bounds, or a vector of length 1 with a lower bound, and the upper will be set symmetrically as 1 - the lower bound. Both bounds must be provided when the variable type of the task's outcome is continuous.

    • -
    - - -

    Examples

    -
    data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") - -hal_lrnr <- Lrnr_hal9001$new( - max_degree = 1, num_knots = c(20, 10), smoothness_orders = 0 -) -lasso_lrnr <- Lrnr_glmnet$new() -glm_lrnr <- Lrnr_glm$new() -ranger_lrnr <- Lrnr_ranger$new() -lrnr_stack <- make_learner(Stack, lasso_lrnr, glm_lrnr, ranger_lrnr) -lrnr_bound <- Lrnr_bound$new(c(-2, 2)) -stack_bounded_preds <- Pipeline$new(lrnr_stack, lrnr_bound) -metalrnr_discrete_MSE <- Lrnr_cv_selector$new(loss_squared_error) -discrete_sl <- Lrnr_sl$new( - learners = stack_bounded_preds, metalearner = metalrnr_discrete_MSE -) -discrete_sl_fit <- discrete_sl$train(task) -preds <- discrete_sl_fit$predict() -range(preds) -
    #> [1] -2 2
    +
+ +
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+hal_lrnr <- Lrnr_hal9001$new(
+  max_degree = 1, num_knots = c(20, 10), smoothness_orders = 0
+)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnr_stack <- make_learner(Stack, lasso_lrnr, glm_lrnr, ranger_lrnr)
+lrnr_bound <- Lrnr_bound$new(c(-2, 2))
+stack_bounded_preds <- Pipeline$new(lrnr_stack, lrnr_bound)
+metalrnr_discrete_MSE <- Lrnr_cv_selector$new(loss_squared_error)
+discrete_sl <- Lrnr_sl$new(
+  learners = stack_bounded_preds, metalearner = metalrnr_discrete_MSE
+)
+discrete_sl_fit <- discrete_sl$train(task)
+preds <- discrete_sl_fit$predict()
+range(preds)
+#> [1] -2  2
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_caret.html b/docs/reference/Lrnr_caret.html index e2f4edaf..8f29aa40 100644 --- a/docs/reference/Lrnr_caret.html +++ b/docs/reference/Lrnr_caret.html @@ -1,78 +1,19 @@ - - - - - - - -Wrapping Learner for Package Caret — Lrnr_caret • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Wrapping Learner for Package Caret — Lrnr_caret • sl3 - - - - - - - - + + -
-
- -
- -
+
-

This learner wraps train, providing a procedure to fit the -algorithms available in package caret.

+

This learner wraps train, providing a procedure to fit +the algorithms available in package caret.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
algorithm

The algorithm to use. This argument is passed as -method to train. For a detailed description of the +

algorithm
+

The algorithm to use. This argument is passed as +method to train. For a detailed description of the methods available in the package, please consult the documentation for -train.

+train.

-
method

An optional argument specifying the method for -parameter selection criterion. Default is set to "CV" instead of the -train default "boot". This argument is passed to -trControl and will not be effective if trControl is specified. For a -detailed description, please consult the documentation for -train.

-
metric

An optional argument specifying the summary metric to +

metric
+

An optional argument specifying the summary metric to be used to select the optimal model. If not specified, it will be inferred depending on the outcome type. For a detailed description, please consult -the documentation for train.

- -
trControl

An optional trainControl -object controlling the computational nuances. If not specified, it will be -initialized with method. For a detailed description, please consult the -documentation for train.

- -
...

Other parameters passed to train.

- -
+the documentation for train.

-

See also

- +
trControl
+

An optional trainControl +object controlling the computational nuances. If not specified, it will be +initialized with method = "cv" instead of the default "boot". For a +detailed description, please consult the documentation for +train.

+ + +
...
+

Other parameters passed to train.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_cv.html b/docs/reference/Lrnr_cv.html index 7f85f2c6..e87d367a 100644 --- a/docs/reference/Lrnr_cv.html +++ b/docs/reference/Lrnr_cv.html @@ -1,77 +1,18 @@ - - - - - - - -Fit/Predict a learner with Cross Validation — Lrnr_cv • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Fit/Predict a learner with Cross Validation — Lrnr_cv • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,120 +81,122 @@

Fit/Predict a learner with Cross Validation

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner

The learner to wrap

-
folds=NULL

An origami folds object. If NULL, +

learner
+

The learner to wrap

+ +
folds=NULL
+

An origami folds object. If NULL, folds from the task are used

-
full_fit=FALSE

If TRUE, also fit the underlying learner on the full data. -This can then be accessed with predict_fold(task, fold_number="full")

-
+
full_fit=FALSE
+

If TRUE, also fit the underlying learner on the full data. +This can then be accessed with predict_fold(task, fold_number="full")

-

See also

- +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_cv_selector.html b/docs/reference/Lrnr_cv_selector.html index 5f5b7e00..57bbeb54 100644 --- a/docs/reference/Lrnr_cv_selector.html +++ b/docs/reference/Lrnr_cv_selector.html @@ -1,78 +1,19 @@ - - - - - - - -Cross-Validated Selector — Lrnr_cv_selector • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Cross-Validated Selector — Lrnr_cv_selector • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,160 +83,159 @@

Cross-Validated Selector

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -hal_lrnr <- Lrnr_hal9001$new( - max_degree = 1, num_knots = c(20, 10), smoothness_orders = 0 -) -lasso_lrnr <- Lrnr_glmnet$new() -glm_lrnr <- Lrnr_glm$new() -ranger_lrnr <- Lrnr_ranger$new() -lrnrs <- c(hal_lrnr, lasso_lrnr, glm_lrnr, ranger_lrnr) -names(lrnrs) <- c("hal", "lasso", "glm", "ranger") -lrnr_stack <- make_learner(Stack, lrnrs) -metalrnr_discrete_MSE <- Lrnr_cv_selector$new(loss_squared_error) -discrete_sl <- Lrnr_sl$new( - learners = lrnr_stack, metalearner = metalrnr_discrete_MSE -) -discrete_sl_fit <- discrete_sl$train(task) -discrete_sl_fit$cv_risk -
#> function (eval_fun) -#> { -#> cv_stack_fit <- self$fit_object$cv_fit -#> stack_risks <- cv_stack_fit$cv_risk(eval_fun) -#> coefs <- self$coefficients -#> if (!is.null(coefs)) { -#> ordered_coefs <- coefs[match(stack_risks$learner, names(coefs))] -#> } -#> else { -#> ordered_coefs <- rep(NA, length(stack_risks$learner)) -#> } -#> set(stack_risks, , "coefficients", ordered_coefs) -#> data.table::setcolorder(stack_risks, c(names(stack_risks)[1], -#> "coefficients")) -#> sl_risk <- cv_risk(self, eval_fun) -#> set(sl_risk, , "learner", "SuperLearner") -#> risks <- rbind(stack_risks, sl_risk) -#> return(risks) -#> } -#> <environment: 0x7f9819c97ac8>
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+hal_lrnr <- Lrnr_hal9001$new(
+  max_degree = 1, num_knots = c(20, 10), smoothness_orders = 0
+)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnrs <- c(hal_lrnr, lasso_lrnr, glm_lrnr, ranger_lrnr)
+names(lrnrs) <- c("hal", "lasso", "glm", "ranger")
+lrnr_stack <- make_learner(Stack, lrnrs)
+metalrnr_discrete_MSE <- Lrnr_cv_selector$new(loss_squared_error)
+discrete_sl <- Lrnr_sl$new(
+  learners = lrnr_stack, metalearner = metalrnr_discrete_MSE
+)
+discrete_sl_fit <- discrete_sl$train(task)
+discrete_sl_fit$cv_risk
+#> function (eval_fun) 
+#> {
+#>     cv_stack_fit <- self$fit_object$cv_fit
+#>     stack_risks <- cv_stack_fit$cv_risk(eval_fun)
+#>     coefs <- self$coefficients
+#>     if (!is.null(coefs)) {
+#>         ordered_coefs <- coefs[match(stack_risks$learner, names(coefs))]
+#>     }
+#>     else {
+#>         ordered_coefs <- rep(NA, length(stack_risks$learner))
+#>     }
+#>     set(stack_risks, , "coefficients", ordered_coefs)
+#>     data.table::setcolorder(stack_risks, c(names(stack_risks)[1], 
+#>         "coefficients"))
+#>     sl_risk <- cv_risk(self, eval_fun)
+#>     set(sl_risk, , "learner", "SuperLearner")
+#>     risks <- rbind(stack_risks, sl_risk)
+#>     return(risks)
+#> }
+#> <environment: 0x56131d4f1530>
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_dbarts.html b/docs/reference/Lrnr_dbarts.html index 66bafd0e..3587195d 100644 --- a/docs/reference/Lrnr_dbarts.html +++ b/docs/reference/Lrnr_dbarts.html @@ -1,79 +1,20 @@ - - - - - - - -Discrete Bayesian Additive Regression Tree sampler — Lrnr_dbarts • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Discrete Bayesian Additive Regression Tree sampler — Lrnr_dbarts • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -153,199 +85,249 @@

Discrete Bayesian Additive Regression Tree sampler

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
x.test

Explanatory variables for test (out of sample) data. +

x.test
+

Explanatory variables for test (out of sample) data. bart will generate draws of \(f(x)\) for each \(x\) which is a row of x.test.

-
sigest

For continuous response models, an estimate of the + +

sigest
+

For continuous response models, an estimate of the error variance, \(\sigma^2\), used to calibrate an inverse-chi-squared prior used on that parameter. If not supplied, the least-squares estimate is derived instead. See sigquant for more information. Not applicable when \(y\) is binary.

-
sigdf

Degrees of freedom for error variance prior. Not + +

sigdf
+

Degrees of freedom for error variance prior. Not applicable when \(y\) is binary.

-
sigquant

The quantile of the error variance prior that the + +

sigquant
+

The quantile of the error variance prior that the rough estimate (sigest) is placed at. The closer the quantile is to 1, the more aggresive the fit will be as you are putting more prior weight on error standard deviations (\(\sigma\)) less than the rough estimate. Not applicable when \(y\) is binary.

-
k

For numeric \(y\), k is the number of prior + +

k
+

For numeric \(y\), k is the number of prior standard deviations \(E(Y|x) = f(x)\) is away from \(\pm 0.5\). The response (y.train) is internally scaled to range from \(-0.5\) to \(0.5\). For binary \(y\), k is the number of prior standard deviations \(f(x)\) is away from \(\pm 3\). In both cases, the bigger \(k\) is, the more conservative the fitting will be.

-
power

Power parameter for tree prior.

-
base

Base parameter for tree prior.

-
binaryOffset

sed for binary \(y\). When present, the model + +

power
+

Power parameter for tree prior.

+ +
base
+

Base parameter for tree prior.

+ +
binaryOffset
+

sed for binary \(y\). When present, the model is \(P(Y = 1 \mid x) = \Phi(f(x) + \mathrm{binaryOffset})\), allowing fits with probabilities shrunk towards values other than \(0.5\).

-
weights

An optional vector of weights to be used in the + +

weights
+

An optional vector of weights to be used in the fitting process. When present, BART fits a model with observations \(y \mid x \sim N(f(x), \sigma^2 / w)\), where \(f(x)\) is the unknown function.

-
ntree

The number of trees in the sum-of-trees formulation.

-
ndpost

The number of posterior draws after burn in, + +

ntree
+

The number of trees in the sum-of-trees formulation.

+ +
ndpost
+

The number of posterior draws after burn in, ndpost / keepevery will actually be returned.

-
nskip

Number of MCMC iterations to be treated as burn in.

-
printevery

As the MCMC runs, a message is printed every + +

nskip
+

Number of MCMC iterations to be treated as burn in.

+ +
printevery
+

As the MCMC runs, a message is printed every printevery draws.

-
keepevery

Every keepevery draw is kept to be returned -to the user. Useful for “thinning” samples.

-
keeptrainfits

If TRUE the draws of \(f(x)\) for + +

keepevery
+

Every keepevery draw is kept to be returned +to the user. Useful for “thinning” samples.

+ +
keeptrainfits
+

If TRUE the draws of \(f(x)\) for \(x\) corresponding to the rows of x.train are returned.

-
usequants

When TRUE, determine tree decision rules + +

usequants
+

When TRUE, determine tree decision rules using estimated quantiles derived from the x.train variables. When FALSE, splits are determined using values equally spaced across the range of a variable. See details for more information.

-
numcut

The maximum number of possible values used in decision + +

numcut
+

The maximum number of possible values used in decision rules (see usequants, details). If a single number, it is recycled for all variables; otherwise must be a vector of length equal to -ncol(x.train). Fewer rules may be used if a covariate lacks enough +ncol(x.train). Fewer rules may be used if a covariate lacks enough unique values.

-
printcutoffs

The number of cutoff rules to printed to screen + +

printcutoffs
+

The number of cutoff rules to printed to screen before the MCMC is run. Given a single integer, the same value will be used for all variables. If 0, nothing is printed.

-
verbose

Logical; if FALSE supress printing.

-
nchain

Integer specifying how many independent tree sets and + +

verbose
+

Logical; if FALSE supress printing.

+ +
nchain
+

Integer specifying how many independent tree sets and fits should be calculated.

-
nthread

Integer specifying how many threads to use. Depending + +

nthread
+

Integer specifying how many threads to use. Depending on the CPU architecture, using more than the number of chains can degrade performance for small/medium data sets. As such some calculations may be executed single threaded regardless.

-
combinechains

Logical; if TRUE, samples will be + +

combinechains
+

Logical; if TRUE, samples will be returned in arrays of dimensions equal to nchain \(\times\) ndpost \(\times\) number of observations.

-
keeptrees

Logical; must be TRUE in order to use + +

keeptrees
+

Logical; must be TRUE in order to use predict with the result of a bart fit.

-
keepcall

Logical; if FALSE, returned object will have -call set to call("NULL"), otherwise the call used to + +

keepcall
+

Logical; if FALSE, returned object will have +call set to call("NULL"), otherwise the call used to instantiate BART.

-
serializeable

Logical; if TRUE, loads the trees into R memory -so the fit object can be saved and loaded. See the section on "Saving" -in bart NB: This is not currently working

-
+
serializeable
+

Logical; if TRUE, loads the trees into R memory +so the fit object can be saved and loaded. See the section on "Saving" +in bart NB: This is not currently working

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_define_interactions.html b/docs/reference/Lrnr_define_interactions.html index 88ce7831..86eb6d70 100644 --- a/docs/reference/Lrnr_define_interactions.html +++ b/docs/reference/Lrnr_define_interactions.html @@ -1,78 +1,19 @@ - - - - - - - -Define interactions terms — Lrnr_define_interactions • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Define interactions terms — Lrnr_define_interactions • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,133 +83,131 @@

Define interactions terms

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+ + -

Examples

-
data(cpp_imputed) -covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn") -outcome <- "haz" -task <- sl3_Task$new(cpp_imputed, covariates = covars, outcome = outcome) -interactions <- list(c("apgar1", "parity"), c("apgar5", "parity")) -lrnr_interact <- Lrnr_define_interactions$new( - list(c("apgar1", "parity"), c("apgar5", "parity")) -) -lrnr_glm <- Lrnr_glm$new() -interaction_pipeline_glm <- make_learner(Pipeline, lrnr_interact, lrnr_glm) -fit <- interaction_pipeline_glm$train(task) -
+
+

Examples

+
data(cpp_imputed)
+covars <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn")
+outcome <- "haz"
+task <- sl3_Task$new(cpp_imputed, covariates = covars, outcome = outcome)
+interactions <- list(c("apgar1", "parity"), c("apgar5", "parity"))
+lrnr_interact <- Lrnr_define_interactions$new(
+  list(c("apgar1", "parity"), c("apgar5", "parity"))
+)
+lrnr_glm <- Lrnr_glm$new()
+interaction_pipeline_glm <- make_learner(Pipeline, lrnr_interact, lrnr_glm)
+fit <- interaction_pipeline_glm$train(task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_density_discretize.html b/docs/reference/Lrnr_density_discretize.html index a8989451..026af680 100644 --- a/docs/reference/Lrnr_density_discretize.html +++ b/docs/reference/Lrnr_density_discretize.html @@ -1,77 +1,18 @@ - - - - - - - -Density from Classification — Lrnr_density_discretize • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Density from Classification — Lrnr_density_discretize • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,130 +81,132 @@

Density from Classification

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
categorical_learner

The learner to wrap.

+
categorical_learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_density_hse.html b/docs/reference/Lrnr_density_hse.html index e8cbb64c..c04fa437 100644 --- a/docs/reference/Lrnr_density_hse.html +++ b/docs/reference/Lrnr_density_hse.html @@ -1,78 +1,19 @@ - - - - - - - -Density Estimation With Mean Model and Homoscedastic Errors — Lrnr_density_hse • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Density Estimation With Mean Model and Homoscedastic Errors — Lrnr_density_hse • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Density Estimation With Mean Model and Homoscedastic Errors

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
binomial_learner

The learner to wrap.

+
binomial_learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_density_semiparametric.html b/docs/reference/Lrnr_density_semiparametric.html index 8ec96092..239e69c8 100644 --- a/docs/reference/Lrnr_density_semiparametric.html +++ b/docs/reference/Lrnr_density_semiparametric.html @@ -1,78 +1,19 @@ - - - - - - - -Density Estimation With Mean Model and Homoscedastic Errors — Lrnr_density_semiparametric • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Density Estimation With Mean Model and Homoscedastic Errors — Lrnr_density_semiparametric • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Density Estimation With Mean Model and Homoscedastic Errors

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
binomial_learner

The learner to wrap.

+
binomial_learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_earth.html b/docs/reference/Lrnr_earth.html index 23ab73ca..cd98c2e1 100644 --- a/docs/reference/Lrnr_earth.html +++ b/docs/reference/Lrnr_earth.html @@ -1,83 +1,24 @@ - - - - - - - -Earth: Multivariate Adaptive Regression Splines — Lrnr_earth • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Earth: Multivariate Adaptive Regression Splines — Lrnr_earth • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,32 +89,32 @@

Earth: Multivariate Adaptive Regression Splines

and Friedman (1993) , via earth and the function -earth.

+earth.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • degree: A numeric specifying the maximum degree of +

    • degree: A numeric specifying the maximum degree of interactions to be used in the model. This defaults to 2, specifying up through one-way interaction terms. Note that this differs from the -default of earth.

    • +default of earth.

    • penalty: Generalized Cross Validation (GCV) penalty per knot. Defaults to 3 as per the recommendation for degree > 1 in the -documentation of earth. Special values (for use +documentation of earth. Special values (for use by knowledgeable users): The value 0 penalizes only terms, not knots. The value -1 translates to no penalty.

    • pmethod: Pruning method, defaulting to "backward". Other @@ -196,126 +128,125 @@

      P
    • minspan: Minimum number of observations between knots.

    • endspan: Minimum number of observations before the first and after the final knot.

    • -
    • ...: Other parameters passed to earth. See +

    • ...: Other parameters passed to earth. See its documentation for details.

    • -

    - -

    References

    - +
+
+

References

Friedman JH (1991). -“Multivariate adaptive regression splines.” -The Annals of Statistics, 1--67.

Friedman JH (1993). -“Fast MARS.” +“Multivariate adaptive regression splines.” +The Annals of Statistics, 1--67.

Friedman JH (1993). +“Fast MARS.” Stanford University. -https://statistics.stanford.edu/sites/g/files/sbiybj6031/f/LCS%20110.pdf.

-

See also

- - +https://statistics.stanford.edu/sites/g/files/sbiybj6031/f/LCS%20110.pdf.

+
+ -

Examples

-
data(cpp_imputed) -covars <- c( - "apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn" -) -outcome <- "haz" -task <- sl3_Task$new(cpp_imputed, - covariates = covars, - outcome = outcome -) -# fit and predict from a MARS model -earth_lrnr <- make_learner(Lrnr_earth) -earth_fit <- earth_lrnr$train(task) -earth_preds <- earth_fit$predict(task) -
+
+

Examples

+
data(cpp_imputed)
+covars <- c(
+  "apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs", "sexn"
+)
+outcome <- "haz"
+task <- sl3_Task$new(cpp_imputed,
+  covariates = covars,
+  outcome = outcome
+)
+# fit and predict from a MARS model
+earth_lrnr <- make_learner(Lrnr_earth)
+earth_fit <- earth_lrnr$train(task)
+earth_preds <- earth_fit$predict(task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_expSmooth.html b/docs/reference/Lrnr_expSmooth.html index 5183ed77..75674acd 100644 --- a/docs/reference/Lrnr_expSmooth.html +++ b/docs/reference/Lrnr_expSmooth.html @@ -1,78 +1,19 @@ - - - - - - - -Exponential Smoothing state space model — Lrnr_expSmooth • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Exponential Smoothing state space model — Lrnr_expSmooth • sl3 - - - - - - - - + + -
-
- -
- -
+

This learner supports exponential smoothing models using -ets.

+ets.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
+ -expSmooth_fit <- expSmooth_lrnr$train(train_task) -expSmooth_preds <- expSmooth_fit$predict(valid_task) -
+
+

Examples

+
library(origami)
+data(bsds)
+
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+expSmooth_lrnr <- make_learner(Lrnr_expSmooth)
+
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+expSmooth_fit <- expSmooth_lrnr$train(train_task)
+expSmooth_preds <- expSmooth_fit$predict(valid_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_ga.html b/docs/reference/Lrnr_ga.html index d7d59c7e..3451bc18 100644 --- a/docs/reference/Lrnr_ga.html +++ b/docs/reference/Lrnr_ga.html @@ -1,80 +1,21 @@ - - - - - - - -Nonlinear Optimization via Genetic Algorithm (GA) — Lrnr_ga • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Nonlinear Optimization via Genetic Algorithm (GA) — Lrnr_ga • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This metalearner provides fitting procedures for any pairing of loss or risk function and metalearner function, subject to constraints. The optimization -problem is solved by making use of the ga function in the +problem is solved by making use of the ga function in the GA R package. For further consult the documentation of this package.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# instantiate SL with GA metalearner -ga <- Lrnr_ga$new() -sl <- Lrnr_sl$new(lrnr_stack, ga) -sl_fit <- sl$train(task) -
+
+

Examples

+
# define ML task
+data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# build relatively fast learner library (not recommended for real analysis)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr)
+names(lrnrs) <- c("lasso", "glm", "ranger")
+lrnr_stack <- make_learner(Stack, lrnrs)
+
+# instantiate SL with GA metalearner
+ga <- Lrnr_ga$new()
+sl <- Lrnr_sl$new(lrnr_stack, ga)
+sl_fit <- sl$train(task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_gam.html b/docs/reference/Lrnr_gam.html index 6f0d6d0d..0565ae5d 100644 --- a/docs/reference/Lrnr_gam.html +++ b/docs/reference/Lrnr_gam.html @@ -1,84 +1,25 @@ - - - - - - - -GAM: Generalized Additive Models — Lrnr_gam • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -GAM: Generalized Additive Models — Lrnr_gam • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for generalized additive models, using the routines from mgcv through a call to the function -gam. The mgcv package and the use of GAMs are +gam. The mgcv package and the use of GAMs are described thoroughly (with examples) in Wood (2017) , while Hastie and Tibshirani (1990) @@ -163,155 +95,154 @@

GAM: Generalized Additive Models

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • formula: An optional argument specifying the formula of GAM. +

    • formula: An optional argument specifying the formula of GAM. Input type can be formula or string, or a list of them. If not specified, continuous covariates will be smoothened with the smooth terms represented using "penalized thin plate regression splines". For a more detailed description, please consult the documentation for -gam.

    • +gam.

    • family: An optional argument specifying the family of the GAM. -See family and family.mgcv +See family and family.mgcv for a list of available family functions. If left unspecified, it will be inferred depending on the detected type of the outcome. For now, GAM supports binomial and gaussian outcome types, if formula is unspecified. For a more detailed description of this argument, please -consult the documentation of gam.

    • +consult the documentation of gam.

    • method: An optional argument specifying the method for smoothing parameter selection. The default is global cross-validation (GCV). For more detaileds on this argument, consult the documentation of -gam.

    • -
    • ...: Other parameters passed to gam. See its +gam.

    • +
    • ...: Other parameters passed to gam. See its documentation for details.

    • -
    - -

    References

    - +
+ + -

Examples

-
data(cpp_imputed) -# create task for prediction -cpp_task <- sl3_Task$new( - data = cpp_imputed, - covariates = c("bmi", "parity", "mage", "sexn"), - outcome = "haz" -) -# initialization, training, and prediction with the defaults -gam_lrnr <- Lrnr_gam$new() -gam_fit <- gam_lrnr$train(cpp_task) -gam_preds <- gam_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+# create task for prediction
+cpp_task <- sl3_Task$new(
+  data = cpp_imputed,
+  covariates = c("bmi", "parity", "mage", "sexn"),
+  outcome = "haz"
+)
+# initialization, training, and prediction with the defaults
+gam_lrnr <- Lrnr_gam$new()
+gam_fit <- gam_lrnr$train(cpp_task)
+gam_preds <- gam_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_gbm.html b/docs/reference/Lrnr_gbm.html index 8e7c53ab..86e6c5aa 100644 --- a/docs/reference/Lrnr_gbm.html +++ b/docs/reference/Lrnr_gbm.html @@ -1,84 +1,25 @@ - - - - - - - -GBM: Generalized Boosted Regression Models — Lrnr_gbm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -GBM: Generalized Boosted Regression Models — Lrnr_gbm • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for generalized boosted regression trees, using the routines from gbm, through a call to the function -gbm.fit. Though a variety of gradient boosting strategies +gbm.fit. Though a variety of gradient boosting strategies have seen popularity in machine learning, a few of the early methodological descriptions were given by Friedman (2001) and @@ -163,22 +95,22 @@

GBM: Generalized Boosted Regression Models

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • n.trees: An integer specifying the total number of trees to fit. +

    • n.trees: An integer specifying the total number of trees to fit. This is equivalent to the number of iterations and the number of basis functions in the additive expansion. The default is 10000.

    • interaction.depth: An integer specifying the maximum depth of @@ -189,128 +121,127 @@

      P expansion. Also known as the learning rate or step-size reduction; values of 0.001 to 0.1 have been found to usually work, but a smaller learning rate typically requires more trees. The default is 0.001.

    • -
    • ...: Other parameters passed to gbm. See its +

    • ...: Other parameters passed to gbm. See its documentation for details.

    • -
    - -

    References

    - +
+
+

References

Friedman JH (2001). -“Greedy function approximation: a gradient boosting machine.” -Annals of statistics, 1189--1232.

Friedman JH (2002). -“Stochastic gradient boosting.” +“Greedy function approximation: a gradient boosting machine.” +Annals of statistics, 1189--1232.

Friedman JH (2002). +“Stochastic gradient boosting.” Computational statistics \& data analysis, 38(4), 367--378.

-

See also

- -

Lrnr_xgboost for the extreme gradient boosted tree models from -the Xgboost framework (via the xgboost package) and Lrnr_lightgbm +

+
+

See also

+ - -

Examples

-

+    
-# initialization, training, and prediction with the defaults -gbm_lrnr <- Lrnr_gbm$new() -gbm_fit <- gbm_lrnr$train(cpp_task) -gbm_preds <- gbm_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+# create task for prediction
+cpp_task <- sl3_Task$new(
+  data = cpp_imputed,
+  covariates = c("apgar1", "apgar5", "parity", "gagebrth", "mage", "sexn"),
+  outcome = "haz"
+)
+
+# initialization, training, and prediction with the defaults
+gbm_lrnr <- Lrnr_gbm$new()
+gbm_fit <- gbm_lrnr$train(cpp_task)
+gbm_preds <- gbm_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_glm.html b/docs/reference/Lrnr_glm.html index d7fb073d..1bb45bd9 100644 --- a/docs/reference/Lrnr_glm.html +++ b/docs/reference/Lrnr_glm.html @@ -1,78 +1,19 @@ - - - - - - - -Generalized Linear Models — Lrnr_glm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Generalized Linear Models — Lrnr_glm • sl3 - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for generalized linear models using -the stats package glm.fit function.

+the stats package glm.fit function.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • intercept = TRUE: Should an intercept be included in the model?

  • -
  • ...: Other parameters passed to glm or -glm.fit.

  • -
- -

See also

- - - -

Examples

-
data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") - -# simple, main-terms GLM -lrnr_glm <- make_learner(Lrnr_glm) -glm_fit <- lrnr_glm$train(task) -glm_preds <- glm_fit$predict() +
  • intercept = TRUE: Should an intercept be included in the model?

  • +
  • ...: Other parameters passed to glm or +glm.fit.

  • +
+ -# We can include interaction terms by 'piping' them into this learner. -# Note that both main terms and the specified interactions will be included -# in the regression model. -interaction <- list(c("apgar1", "parity")) -lrnr_interaction <- Lrnr_define_interactions$new(interactions = interaction) -lrnr_glm_w_interaction <- make_learner(Pipeline, lrnr_interaction, lrnr_glm) -fit <- lrnr_glm_w_interaction$train(task) -coefs <- coef(fit$learner_fits$Lrnr_glm_TRUE) -
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# simple, main-terms GLM
+lrnr_glm <- make_learner(Lrnr_glm)
+glm_fit <- lrnr_glm$train(task)
+glm_preds <- glm_fit$predict()
+
+# We can include interaction terms by 'piping' them into this learner.
+# Note that both main terms and the specified interactions will be included
+# in the regression model.
+interaction <- list(c("apgar1", "parity"))
+lrnr_interaction <- Lrnr_define_interactions$new(interactions = interaction)
+lrnr_glm_w_interaction <- make_learner(Pipeline, lrnr_interaction, lrnr_glm)
+fit <- lrnr_glm_w_interaction$train(task)
+coefs <- coef(fit$learner_fits$Lrnr_glm_TRUE)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_glm_fast.html b/docs/reference/Lrnr_glm_fast.html index 9a61a41f..ef2b51aa 100644 --- a/docs/reference/Lrnr_glm_fast.html +++ b/docs/reference/Lrnr_glm_fast.html @@ -1,84 +1,25 @@ - - - - - - - -Computationally Efficient Generalized Linear Model (GLM) Fitting — Lrnr_glm_fast • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Computationally Efficient Generalized Linear Model (GLM) Fitting — Lrnr_glm_fast • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides faster procedures for fitting linear and generalized -linear models than Lrnr_glm with a minimal memory footprint. +linear models than Lrnr_glm with a minimal memory footprint. This learner uses the internal fitting function provided by speedglm -package, speedglm.wfit. See +package, speedglm.wfit. See Enea (2009) for more detail. The -glm.fit function is used as a fallback, if -speedglm.wfit fails.

+glm.fit function is used as a fallback, if +speedglm.wfit fails.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • intercept = TRUE: Should an intercept be included in the model?

  • +
    • intercept = TRUE: Should an intercept be included in the model?

    • method = "Cholesky": The method to check for singularity.

    • ...: Other parameters to be passed to -speedglm.wfit.

    • -
    - -

    References

    - +speedglm.wfit.

    +
+
+

References

Enea M (2009). -“Fitting linear models and generalized linear models with large data sets in R.” +“Fitting linear models and generalized linear models with large data sets in R.” Statistical Methods for the Analysis of Large Datasets: book of short papers, 411--414.

-

See also

- - - -

Examples

-
data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") +
+ -# simple, main-terms GLM -lrnr_glm_fast <- Lrnr_glm_fast$new(method = "eigen") -glm_fast_fit <- lrnr_glm_fast$train(task) -glm_fast_preds <- glm_fast_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# simple, main-terms GLM
+lrnr_glm_fast <- Lrnr_glm_fast$new(method = "eigen")
+glm_fast_fit <- lrnr_glm_fast$train(task)
+glm_fast_preds <- glm_fast_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_glmnet.html b/docs/reference/Lrnr_glmnet.html index 6ad6b15b..e0ecc6d0 100644 --- a/docs/reference/Lrnr_glmnet.html +++ b/docs/reference/Lrnr_glmnet.html @@ -1,83 +1,24 @@ - - - - - - - -GLMs with Elastic Net Regularization — Lrnr_glmnet • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -GLMs with Elastic Net Regularization — Lrnr_glmnet • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for elastic net models, including both lasso (L1) and ridge (L2) penalized regression, using the glmnet -package. The function cv.glmnet is used to select an +package. The function cv.glmnet is used to select an appropriate value of the regularization parameter lambda. For details on these regularized regression models and glmnet, consider consulting Friedman et al. (2010) @@ -161,169 +93,168 @@

GLMs with Elastic Net Regularization

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • lambda = NULL: An optional vector of lambda values to compare.

  • +
    • lambda = NULL: An optional vector of lambda values to compare.

    • type.measure = "deviance": The loss to use when selecting -lambda. Options documented in cv.glmnet.

    • +lambda. Options documented in cv.glmnet.

    • nfolds = 10: Number of folds to use for internal cross-validation.

    • alpha = 1: The elastic net parameter: alpha = 0 is Ridge (L2-penalized) regression, while alpha = 1 specifies Lasso (L1-penalized) regression. Values in the closed unit interval specify a weighted combination of the two penalties. For further details, consult -the documentation of glmnet.

    • +the documentation of glmnet.

    • nlambda = 100: The number of lambda values to fit. Comparing fewer values will speed up computation, but may hurt the statistical performance. For further details, consult the documentation of -cv.glmnet.

    • +cv.glmnet.

    • use_min = TRUE: If TRUE, the smallest value of the lambda regularization parameter is used for prediction (i.e., lambda = cv_fit$lambda.min); otherwise, a larger value is used (i.e., lambda = cv_fit$lambda.1se). The distinction between the two variants is clarified in the documentation of -cv.glmnet.

    • +cv.glmnet.

    • stratify_cv = FALSE: Stratify internal cross-validation folds, so that a binary outcome's prevalence for training is roughly the same in the training and validation sets of the internal cross-validation folds? This argument can only be used when the outcome type for training is binomial; and either the id node in the task is not -specified, or cv.glmnet's foldid argument +specified, or cv.glmnet's foldid argument is not specified upon initializing the learner.

    • -
    • ...: Other parameters passed to cv.glmnet -and glmnet.

    • -
    - -

    References

    - +
  • ...: Other parameters passed to cv.glmnet +and glmnet.

  • +
+
+

References

Friedman J, Hastie T, Tibshirani R (2010). -“Regularization paths for generalized linear models via coordinate descent.” +“Regularization paths for generalized linear models via coordinate descent.” Journal of statistical software, 33(1), 1.

-

See also

- - - -

Examples

-
data(mtcars) -mtcars_task <- sl3_Task$new( - data = mtcars, - covariates = c( - "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am", - "gear", "carb" - ), - outcome = "mpg" -) -# simple prediction with lasso penalty -lasso_lrnr <- Lrnr_glmnet$new() -lasso_fit <- lasso_lrnr$train(mtcars_task) -lasso_preds <- lasso_fit$predict() +
+ -# simple prediction with ridge penalty -ridge_lrnr <- Lrnr_glmnet$new(alpha = 0) -ridge_fit <- ridge_lrnr$train(mtcars_task) -ridge_preds <- ridge_fit$predict() -
+
+

Examples

+
data(mtcars)
+mtcars_task <- sl3_Task$new(
+  data = mtcars,
+  covariates = c(
+    "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
+    "gear", "carb"
+  ),
+  outcome = "mpg"
+)
+# simple prediction with lasso penalty
+lasso_lrnr <- Lrnr_glmnet$new()
+lasso_fit <- lasso_lrnr$train(mtcars_task)
+lasso_preds <- lasso_fit$predict()
+
+# simple prediction with ridge penalty
+ridge_lrnr <- Lrnr_glmnet$new(alpha = 0)
+ridge_fit <- ridge_lrnr$train(mtcars_task)
+ridge_preds <- ridge_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_grf.html b/docs/reference/Lrnr_grf.html index 768ddb1b..c959846f 100644 --- a/docs/reference/Lrnr_grf.html +++ b/docs/reference/Lrnr_grf.html @@ -1,83 +1,24 @@ - - - - - - - -Generalized Random Forests Learner — Lrnr_grf • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Generalized Random Forests Learner — Lrnr_grf • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -161,31 +93,40 @@

Generalized Random Forests Learner

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
num.trees = 2000

Number of trees grown in the forest. NOTE: +

num.trees = 2000
+

Number of trees grown in the forest. NOTE: Getting accurate confidence intervals generally requires more trees than getting accurate predictions.

-
quantiles = c(0.1, 0.5, 0.9)

Vector of quantiles used to + +

quantiles = c(0.1, 0.5, 0.9)
+

Vector of quantiles used to calibrate the forest.

-
regression.splitting = FALSE

Whether to use regression splits + +

regression.splitting = FALSE
+

Whether to use regression splits when growing trees instead of specialized splits based on the quantiles (the default). Setting this flag to TRUE corresponds to the approach to quantile forests from Meinshausen (2006).

-
clusters = NULL

Vector of integers or factors specifying + +

clusters = NULL
+

Vector of integers or factors specifying which cluster each observation corresponds to.

-
equalize.cluster.weights = FALSE

If FALSE, each unit + +

equalize.cluster.weights = FALSE
+

If FALSE, each unit is given the same weight (so that bigger clusters get more weight). If TRUE, each cluster is given equal weight in the forest. In this case, during training, each tree uses the same number of observations from @@ -194,134 +135,151 @@

P cluster to the tree-growing procedure. When estimating average treatment effects, each observation is given weight 1/cluster size, so that the total weight of each cluster is the same.

-
sample.fraction = 0.5

Fraction of the data used to build each + +

sample.fraction = 0.5
+

Fraction of the data used to build each tree. NOTE: If honesty = TRUE, these subsamples will further be cut by a factor of honesty.fraction..

-
mtry = NULL

Number of variables tried for each split. By + +

mtry = NULL
+

Number of variables tried for each split. By default, this is set based on the dimensionality of the predictors.

-
min.node.size = 5

A target for the minimum number of + +

min.node.size = 5
+

A target for the minimum number of observations in each tree leaf. Note that nodes with size smaller than min.node.size can occur, as in the randomForest package.

-
honesty = TRUE

Whether or not honest splitting (i.e., + +

honesty = TRUE
+

Whether or not honest splitting (i.e., sub-sample splitting) should be used.

-
alpha = 0.05

A tuning parameter that controls the maximum + +

alpha = 0.05
+

A tuning parameter that controls the maximum imbalance of a split.

-
imbalance.penalty = 0

A tuning parameter that controls how + +

imbalance.penalty = 0
+

A tuning parameter that controls how harshly imbalanced splits are penalized.

-
num.threads = 1

Number of threads used in training. If set to + +

num.threads = 1
+

Number of threads used in training. If set to NULL, the software automatically selects an appropriate amount.

-
quantiles_pred

Vector of quantiles used to predict. This can -be different than the vector of quantiles used for training.

-
+
quantiles_pred
+

Vector of quantiles used to predict. This can +be different than the vector of quantiles used for training.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_gru_keras.html b/docs/reference/Lrnr_gru_keras.html index 07596ea0..b40090fb 100644 --- a/docs/reference/Lrnr_gru_keras.html +++ b/docs/reference/Lrnr_gru_keras.html @@ -1,83 +1,24 @@ - - - - - - - -Recurrent Neural Network with Gated Recurrent Unit (GRU) with Keras — Lrnr_gru_keras • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Recurrent Neural Network with Gated Recurrent Unit (GRU) with Keras — Lrnr_gru_keras • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -161,22 +93,22 @@

Recurrent Neural Network with Gated Recurrent Unit (GRU) with Keras

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# instantiate learner, then fit and predict (simplifed example) -gru_lrnr <- Lrnr_gru_keras$new(batch_size = 1, epochs = 200) -gru_fit <- gru_lrnr$train(train_task) -gru_preds <- gru_fit$predict(valid_task) -} -
+
+

Examples

+
if (FALSE) {
+library(origami)
+data(bsds)
+
+# make folds appropriate for time-series cross-validation
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+# build task by passing in external folds structure
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+# create tasks for taining and validation (simplifed example)
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+# instantiate learner, then fit and predict (simplifed example)
+gru_lrnr <- Lrnr_gru_keras$new(batch_size = 1, epochs = 200)
+gru_fit <- gru_lrnr$train(train_task)
+gru_preds <- gru_fit$predict(valid_task)
+}
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_gts.html b/docs/reference/Lrnr_gts.html index eac69233..81a17c36 100644 --- a/docs/reference/Lrnr_gts.html +++ b/docs/reference/Lrnr_gts.html @@ -1,79 +1,20 @@ - - - - - - - -Grouped Time-Series Forecasting — Lrnr_gts • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Grouped Time-Series Forecasting — Lrnr_gts • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner supports prediction using grouped time-series modeling, using -hts. Fitting is done with hts and prediction is -performed via forecast.gts.

+hts. Fitting is done with hts and prediction is +performed via forecast.gts.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
method)

Method for distributing forecasts within hierarchy. -See details of forecast.gts.

-
weights)

Weights used for "optimal combination" method: +

method)
+

Method for distributing forecasts within hierarchy. +See details of forecast.gts.

+ +
weights)
+

Weights used for "optimal combination" method: weights="ols" uses an unweighted combination (as described in Hyndman et al 2011); weights="wls" uses weights based on forecast variances (as described in Hyndman et al 2015); weights="mint" uses a full covariance estimate to determine the weights (as described in Hyndman et al 2016); weights="nseries" uses weights based on the number of series aggregated at each node.

-
fmethod)

Forecasting method to use for each series.

-
algorithms)

An algorithm to be used for computing the + +

fmethod)
+

Forecasting method to use for each series.

+ +
algorithms)
+

An algorithm to be used for computing the combination forecasts (when method=="comb"). The combination forecasts are based on an ill-conditioned regression model. "lu" indicates LU decomposition is used; "cg" indicates a conjugate gradient @@ -185,118 +124,131 @@

P "slm" uses sparse linear regression. Note that algorithms = "recursive" and algorithms = "slm" cannot be used if weights="mint".

-
covariance)

Type of the covariance matrix to be used with + +

covariance)
+

Type of the covariance matrix to be used with weights="mint": either a shrinkage estimator ("shr") with shrinkage towards the diagonal; or a sample covariance matrix ("sam").

-
keep.fitted)

If TRUE, keep fitted values at the bottom + +

keep.fitted)
+

If TRUE, keep fitted values at the bottom level.

-
keep.resid)

If TRUE, keep residuals at the bottom + +

keep.resid)
+

If TRUE, keep residuals at the bottom level.

-
positive)

If TRUE, forecasts are forced to be strictly + +

positive)
+

If TRUE, forecasts are forced to be strictly positive (by setting lambda=0).

-
lambda)

Box-Cox transformation parameter.

-
level

Level used for "middle-out" method (only used when + +

lambda)
+

Box-Cox transformation parameter.

+ +
level
+

Level used for "middle-out" method (only used when method = "mo").

-
parallel

If TRUE, import parallel to allow + +

parallel
+

If TRUE, import parallel to allow parallel processing.

-
num.cores

If parallel = TRUE, specify how many cores + +

num.cores
+

If parallel = TRUE, specify how many cores are going to be used.

-
- -

See also

- - + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_h2o_glm.html b/docs/reference/Lrnr_h2o_glm.html index 1ac947a0..37020c33 100644 --- a/docs/reference/Lrnr_h2o_glm.html +++ b/docs/reference/Lrnr_h2o_glm.html @@ -1,84 +1,25 @@ - - - - - - - -h2o Model Definition — define_h2o_X • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -h2o Model Definition — define_h2o_X • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,159 +89,170 @@

h2o Model Definition

to be subset to the task$X data.table by a smaller set of covariates if spec'ed in params.

This learner provides faster fitting procedures for generalized linear models -by using the h2o package and the h2o.glm method. +by using the h2o package and the h2o.glm method. The h2o Platform fits GLMs in a computationally efficient manner. For details on the procedure, consult the documentation of the h2o package.

-
define_h2o_X(task, outcome_type = NULL)
- -

Arguments

- - - - - - - - - - -
task

An object of type Lrnr_base as defined in this package.

outcome_type

An object of type Variable_Tyoe for use in -formatting the outcome

- -

Format

+
+
define_h2o_X(task, outcome_type = NULL)
+
+
+

Format

R6Class object.

-

Value

- +
+
+

Arguments

+
task
+

An object of type Lrnr_base as defined in this package.

+
outcome_type
+

An object of type Variable_Tyoe for use in +formatting the outcome

+
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
intercept=TRUE

If TRUE, and intercept term is +

intercept=TRUE
+

If TRUE, and intercept term is included.

-
standardize=TRUE

Standardize covariates to have mean = 0 and + +

standardize=TRUE
+

Standardize covariates to have mean = 0 and SD = 1.

-
lambda=0

Lasso Parameter.

-
max_iterations=100

Maximum number of iterations.

-
ignore_const_columns=FALSE

If TRUE, drop constant + +

lambda=0
+

Lasso Parameter.

+ +
max_iterations=100
+

Maximum number of iterations.

+ +
ignore_const_columns=FALSE
+

If TRUE, drop constant covariate columns

-
missing_values_handling="Skip"

How to handle missing values.

-
...

Other arguments passed to h2o.glm.

-
+
missing_values_handling="Skip"
+

How to handle missing values.

+ +
...
+

Other arguments passed to h2o.glm.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_h2o_grid.html b/docs/reference/Lrnr_h2o_grid.html index f54ff649..1c3aefd7 100644 --- a/docs/reference/Lrnr_h2o_grid.html +++ b/docs/reference/Lrnr_h2o_grid.html @@ -1,81 +1,22 @@ - - - - - - - -Grid Search Models with h2o — Lrnr_h2o_grid • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Grid Search Models with h2o — Lrnr_h2o_grid • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,146 +89,166 @@

Grid Search Models with h2o

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
algorithm

An h2o ML algorithm. For a list, please see -http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html#.

-
seed=1

RNG see to use when fitting.

-
distribution=NULL

Specifies the loss function for GBM, Deep +

algorithm
+

An h2o ML algorithm. For a list, please see +http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science.html#.

+ +
seed=1
+

RNG see to use when fitting.

+ +
distribution=NULL
+

Specifies the loss function for GBM, Deep Learning, and XGBoost.

-
intercept=TRUE

If TRUE, and intercept term is + +

intercept=TRUE
+

If TRUE, and intercept term is included.

-
standardize=TRUE

Standardize covariates to have mean = 0 and + +

standardize=TRUE
+

Standardize covariates to have mean = 0 and SD = 1.

-
lambda=0

Lasso Parameter.

-
max_iterations=100

Maximum number of iterations.

-
ignore_const_columns=FALSE

If TRUE, drop constant + +

lambda=0
+

Lasso Parameter.

+ +
max_iterations=100
+

Maximum number of iterations.

+ +
ignore_const_columns=FALSE
+

If TRUE, drop constant covariate columns

-
missing_values_handling="Skip"

How to handle missing values.

-
...

Other arguments passed to the h2o algorithm of choice. -See http://docs.h2o.ai/h2o/latest-stable/h2o-docs/parameters.html -for a list.

-
+
missing_values_handling="Skip"
+

How to handle missing values.

+ +
...
+

Other arguments passed to the h2o algorithm of choice. +See http://docs.h2o.ai/h2o/latest-stable/h2o-docs/parameters.html +for a list.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_hal9001.html b/docs/reference/Lrnr_hal9001.html index eaf3d41c..0089944c 100644 --- a/docs/reference/Lrnr_hal9001.html +++ b/docs/reference/Lrnr_hal9001.html @@ -1,46 +1,5 @@ - - - - - - - -Scalable Highly Adaptive Lasso (HAL) — Lrnr_hal9001 • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Scalable Highly Adaptive Lasso (HAL) — Lrnr_hal9001 • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -164,7 +96,7 @@

Scalable Highly Adaptive Lasso (HAL)

(i.e., the HAL basis) based on indicator basis functions (or higher-order spline basis functions) representing covariates and interactions of the covariates up to a pre-specified degree. The fitting procedures included in -this learner use fit_hal from the hal9001 +this learner use fit_hal from the hal9001 package. For details on HAL regression, consider consulting the following Benkeser and van der Laan (2016) ), @@ -175,131 +107,129 @@

Scalable Highly Adaptive Lasso (HAL)

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+ + -# instantiate with max 2-way interactions, 0-order splines, and binning -# (i.e., num_knots) that decreases with increasing interaction degree -hal_lrnr <- Lrnr_hal9001$new( - max_degree = 2, num_knots = c(20, 10), smoothness_orders = 0 -) -hal_fit <- hal_lrnr$train(task) -hal_preds <- hal_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# instantiate with max 2-way interactions, 0-order splines, and binning
+# (i.e., num_knots) that decreases with increasing interaction degree
+hal_lrnr <- Lrnr_hal9001$new(
+  max_degree = 2, num_knots = c(20, 10), smoothness_orders = 0
+)
+hal_fit <- hal_lrnr$train(task)
+hal_preds <- hal_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_haldensify.html b/docs/reference/Lrnr_haldensify.html index b7b2b0ab..cf964b28 100644 --- a/docs/reference/Lrnr_haldensify.html +++ b/docs/reference/Lrnr_haldensify.html @@ -1,77 +1,18 @@ - - - - - - - -Conditional Density Estimation with the Highly Adaptive LASSO — Lrnr_haldensify • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Conditional Density Estimation with the Highly Adaptive LASSO — Lrnr_haldensify • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,31 +81,31 @@

Conditional Density Estimation with the Highly Adaptive LASSO

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# fit and predict densities -hal_dens_fit <- hal_dens$train(task) -hal_dens_preds <- hal_dens_fit$predict() -
+
+

Examples

+
library(dplyr)
+#> 
+#> Attaching package: ‘dplyr’
+#> The following objects are masked from ‘package:data.table’:
+#> 
+#>     between, first, last
+#> The following objects are masked from ‘package:stats’:
+#> 
+#>     filter, lag
+#> The following objects are masked from ‘package:base’:
+#> 
+#>     intersect, setdiff, setequal, union
+data(cpp_imputed)
+covars <- c("parity", "sexn")
+outcome <- "haz"
+
+# create task
+task <- cpp_imputed %>%
+  slice(seq(1, nrow(.), by = 3)) %>%
+  filter(agedays == 1) %>%
+  sl3_Task$new(
+    covariates = covars,
+    outcome = outcome
+  )
+
+# instantiate the learner
+hal_dens <- Lrnr_haldensify$new(
+  grid_type = "equal_range",
+  n_bins = c(3, 5),
+  lambda_seq = exp(seq(-1, -13, length = 100))
+)
+
+# fit and predict densities
+hal_dens_fit <- hal_dens$train(task)
+hal_dens_preds <- hal_dens_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_hts.html b/docs/reference/Lrnr_hts.html index 6fc833b6..f474b46f 100644 --- a/docs/reference/Lrnr_hts.html +++ b/docs/reference/Lrnr_hts.html @@ -1,79 +1,20 @@ - - - - - - - -Hierarchical Time-Series Forecasting — Lrnr_hts • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hierarchical Time-Series Forecasting — Lrnr_hts • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner supports prediction using hierarchical time-series modeling, -using hts. Fitting is done with hts and prediction -is performed via forecast.gts.

+using hts. Fitting is done with hts and prediction +is performed via forecast.gts.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
method)

Method for distributing forecasts within hierarchy. -See details of forecast.gts.

-
weights)

Weights used for "optimal combination" method: +

method)
+

Method for distributing forecasts within hierarchy. +See details of forecast.gts.

+ +
weights)
+

Weights used for "optimal combination" method: weights="ols" uses an unweighted combination (as described in Hyndman et al 2011); weights="wls" uses weights based on forecast variances (as described in Hyndman et al 2015); weights="mint" uses a full covariance estimate to determine the weights (as described in Hyndman et al 2016); weights="nseries" uses weights based on the number of series aggregated at each node.

-
fmethod)

Forecasting method to use for each series.

-
algorithms)

An algorithm to be used for computing the + +

fmethod)
+

Forecasting method to use for each series.

+ +
algorithms)
+

An algorithm to be used for computing the combination forecasts (when method=="comb"). The combination forecasts are based on an ill-conditioned regression model. "lu" indicates LU decomposition is used; "cg" indicates a conjugate gradient @@ -185,118 +124,131 @@

P "slm" uses sparse linear regression. Note that algorithms = "recursive" and algorithms = "slm" cannot be used if weights="mint".

-
covariance)

Type of the covariance matrix to be used with + +

covariance)
+

Type of the covariance matrix to be used with weights="mint": either a shrinkage estimator ("shr") with shrinkage towards the diagonal; or a sample covariance matrix ("sam").

-
keep.fitted)

If TRUE, keep fitted values at the bottom + +

keep.fitted)
+

If TRUE, keep fitted values at the bottom level.

-
keep.resid)

If TRUE, keep residuals at the bottom + +

keep.resid)
+

If TRUE, keep residuals at the bottom level.

-
positive)

If TRUE, forecasts are forced to be strictly + +

positive)
+

If TRUE, forecasts are forced to be strictly positive (by setting lambda=0).

-
lambda)

Box-Cox transformation parameter.

-
level

Level used for "middle-out" method (only used when + +

lambda)
+

Box-Cox transformation parameter.

+ +
level
+

Level used for "middle-out" method (only used when method = "mo").

-
parallel

If TRUE, import parallel to allow + +

parallel
+

If TRUE, import parallel to allow parallel processing.

-
num.cores

If parallel = TRUE, specify how many cores + +

num.cores
+

If parallel = TRUE, specify how many cores are going to be used.

-
- -

See also

- - + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_independent_binomial.html b/docs/reference/Lrnr_independent_binomial.html index 03cf37f3..0b37a6b6 100644 --- a/docs/reference/Lrnr_independent_binomial.html +++ b/docs/reference/Lrnr_independent_binomial.html @@ -1,79 +1,20 @@ - - - - - - - -Classification from Binomial Regression — Lrnr_independent_binomial • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Classification from Binomial Regression — Lrnr_independent_binomial • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides converts a binomial learner into a multinomial learner using a series of independent binomials. The procedure is modeled on -https://en.wikipedia.org/wiki/Multinomial_logistic_regression#As_a_set_of_independent_binary_regressions

+https://en.wikipedia.org/wiki/Multinomial_logistic_regression#As_a_set_of_independent_binary_regressions

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
binomial_learner

The learner to wrap.

+
binomial_learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_lightgbm.html b/docs/reference/Lrnr_lightgbm.html index 1ff275e8..76ac200d 100644 --- a/docs/reference/Lrnr_lightgbm.html +++ b/docs/reference/Lrnr_lightgbm.html @@ -1,46 +1,5 @@ - - - - - - - -LightGBM: Light Gradient Boosting Machine — Lrnr_lightgbm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LightGBM: Light Gradient Boosting Machine — Lrnr_lightgbm • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for lightgbm models, using -the lightgbm package, via lgb.train. These +the lightgbm package, via lgb.train. These gradient boosted decision tree models feature faster training speed and efficiency, lower memory usage than competing frameworks (e.g., from the xgboost package), better prediction accuracy, and improved handling of @@ -165,148 +97,147 @@

LightGBM: Light Gradient Boosting Machine

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • num_threads = 1L: Number of threads for hyperthreading.

  • -
  • ...: Other arguments passed to lgb.train. +

    • num_threads = 1L: Number of threads for hyperthreading.

    • +
    • ...: Other arguments passed to lgb.train. See its documentation for further details.

    • -
    - -

    References

    - +
+
+

References

Ke G, Meng Q, Finley T, Wang T, Chen W, Ma W, Ye Q, Liu T (2017). -“LightGBM: A Highly Efficient Gradient Boosting Decision Tree.” +“LightGBM: A Highly Efficient Gradient Boosting Decision Tree.” In Advances in Neural Information Processing Systems, volume 30, 3146--3154.

-

See also

- -

Lrnr_gbm for standard gradient boosting models (via the gbm -package) and Lrnr_xgboost for the extreme gradient boosted tree models +

+
+

See also

+ - -

Examples

-
if (FALSE) { -# currently disabled since LightGBM crashes R on Windows -# more info at https://github.com/tlverse/sl3/issues/344 -data(cpp_imputed) -# create task for prediction -cpp_task <- sl3_Task$new( - data = cpp_imputed, - covariates = c("bmi", "parity", "mage", "sexn"), - outcome = "haz" -) - -# initialization, training, and prediction with the defaults -lgb_lrnr <- Lrnr_lightgbm$new() -lgb_fit <- lgb_lrnr$train(cpp_task) -lgb_preds <- lgb_fit$predict() +Custom_chain, +Lrnr_HarmonicReg, +Lrnr_arima, +Lrnr_bartMachine, +Lrnr_base, +Lrnr_bayesglm, +Lrnr_bilstm, +Lrnr_caret, +Lrnr_cv_selector, +Lrnr_cv, +Lrnr_dbarts, +Lrnr_define_interactions, +Lrnr_density_discretize, +Lrnr_density_hse, +Lrnr_density_semiparametric, +Lrnr_earth, +Lrnr_expSmooth, +Lrnr_gam, +Lrnr_ga, +Lrnr_gbm, +Lrnr_glm_fast, +Lrnr_glmnet, +Lrnr_glm, +Lrnr_grf, +Lrnr_gru_keras, +Lrnr_gts, +Lrnr_h2o_grid, +Lrnr_hal9001, +Lrnr_haldensify, +Lrnr_hts, +Lrnr_independent_binomial, +Lrnr_lstm_keras, +Lrnr_mean, +Lrnr_multiple_ts, +Lrnr_multivariate, +Lrnr_nnet, +Lrnr_nnls, +Lrnr_optim, +Lrnr_pca, +Lrnr_pkg_SuperLearner, +Lrnr_polspline, +Lrnr_pooled_hazards, +Lrnr_randomForest, +Lrnr_ranger, +Lrnr_revere_task, +Lrnr_rpart, +Lrnr_rugarch, +Lrnr_screener_augment, +Lrnr_screener_coefs, +Lrnr_screener_correlation, +Lrnr_screener_importance, +Lrnr_sl, +Lrnr_solnp_density, +Lrnr_solnp, +Lrnr_stratified, +Lrnr_subset_covariates, +Lrnr_svm, +Lrnr_tsDyn, +Lrnr_ts_weights, +Lrnr_xgboost, +Pipeline, +Stack, +define_h2o_X(), +undocumented_learner

+
-# get feature importance from fitted model -lgb_varimp <- lgb_fit$importance() -} -
+
+

Examples

+
if (FALSE) {
+# currently disabled since LightGBM crashes R on Windows
+# more info at https://github.com/tlverse/sl3/issues/344
+data(cpp_imputed)
+# create task for prediction
+cpp_task <- sl3_Task$new(
+  data = cpp_imputed,
+  covariates = c("bmi", "parity", "mage", "sexn"),
+  outcome = "haz"
+)
+
+# initialization, training, and prediction with the defaults
+lgb_lrnr <- Lrnr_lightgbm$new()
+lgb_fit <- lgb_lrnr$train(cpp_task)
+lgb_preds <- lgb_fit$predict()
+
+# get feature importance from fitted model
+lgb_varimp <- lgb_fit$importance()
+}
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_lstm_keras.html b/docs/reference/Lrnr_lstm_keras.html index 0704eaac..01fd55c7 100644 --- a/docs/reference/Lrnr_lstm_keras.html +++ b/docs/reference/Lrnr_lstm_keras.html @@ -1,81 +1,22 @@ - - - - - - - -Long short-term memory Recurrent Neural Network (LSTM) with Keras — Lrnr_lstm_keras • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Long short-term memory Recurrent Neural Network (LSTM) with Keras — Lrnr_lstm_keras • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,22 +89,22 @@

Long short-term memory Recurrent Neural Network (LSTM) with Keras

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# instantiate learner, then fit and predict (simplifed example) -lstm_lrnr <- Lrnr_lstm_keras$new(batch_size = 1, epochs = 200) -lstm_fit <- lstm_lrnr$train(train_task) -lstm_preds <- lstm_fit$predict(valid_task) -} -
+
+

Examples

+
if (FALSE) {
+library(origami)
+data(bsds)
+
+# make folds appropriate for time-series cross-validation
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+# build task by passing in external folds structure
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+# create tasks for taining and validation (simplifed example)
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+# instantiate learner, then fit and predict (simplifed example)
+lstm_lrnr <- Lrnr_lstm_keras$new(batch_size = 1, epochs = 200)
+lstm_fit <- lstm_lrnr$train(train_task)
+lstm_preds <- lstm_fit$predict(valid_task)
+}
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_mean.html b/docs/reference/Lrnr_mean.html index fdea5bd2..6484648e 100644 --- a/docs/reference/Lrnr_mean.html +++ b/docs/reference/Lrnr_mean.html @@ -1,78 +1,19 @@ - - - - - - - -Fitting Intercept Models — Lrnr_mean • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Fitting Intercept Models — Lrnr_mean • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,127 +83,125 @@

Fitting Intercept Models

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • ...: Not used.

  • -
- -

See also

- - - -

Examples

-
data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") +
  • ...: Not used.

  • +
+ -# simple, main-terms GLM -lrnr_mean <- make_learner(Lrnr_mean) -mean_fit <- lrnr_mean$train(task) -mean_preds <- mean_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# simple, main-terms GLM
+lrnr_mean <- make_learner(Lrnr_mean)
+mean_fit <- lrnr_mean$train(task)
+mean_preds <- mean_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_multiple_ts.html b/docs/reference/Lrnr_multiple_ts.html index 90317f88..8f44ae0c 100644 --- a/docs/reference/Lrnr_multiple_ts.html +++ b/docs/reference/Lrnr_multiple_ts.html @@ -1,77 +1,18 @@ - - - - - - - -Stratify univariable time-series learners by time-series — Lrnr_multiple_ts • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Stratify univariable time-series learners by time-series — Lrnr_multiple_ts • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,121 +81,123 @@

Stratify univariable time-series learners by time-series

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner="learner"

An initialized Lrnr_* object.

-
variable_stratify="variable_stratify"

A character +

learner="learner"
+

An initialized Lrnr_* object.

+ +
variable_stratify="variable_stratify"
+

A character giving the variable in the covariates on which to stratify. Supports only variables with discrete levels coded as numeric.

-
...

Other parameters passed directly to -learner$train. See its documentation for details.

-
+
...
+

Other parameters passed directly to +learner$train. See its documentation for details.

-

See also

- +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_multivariate.html b/docs/reference/Lrnr_multivariate.html index 367cb033..d40175df 100644 --- a/docs/reference/Lrnr_multivariate.html +++ b/docs/reference/Lrnr_multivariate.html @@ -1,78 +1,19 @@ - - - - - - - -Multivariate Learner — Lrnr_multivariate • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Multivariate Learner — Lrnr_multivariate • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Multivariate Learner

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner

The learner to wrap.

+
learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_nnet.html b/docs/reference/Lrnr_nnet.html index 5659c4c2..0d8dc1eb 100644 --- a/docs/reference/Lrnr_nnet.html +++ b/docs/reference/Lrnr_nnet.html @@ -1,78 +1,19 @@ - - - - - - - -Feed-Forward Neural Networks and Multinomial Log-Linear Models — Lrnr_nnet • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Feed-Forward Neural Networks and Multinomial Log-Linear Models — Lrnr_nnet • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,138 +83,154 @@

Feed-Forward Neural Networks and Multinomial Log-Linear Models

+
+

Format

+

R6Class object.

+
+
+

Value

+

Learner object with methods for both training and prediction. See +Lrnr_base for documentation on learners.

+
+
+

Parameters

+ + +
formula
+

A formula of the form class ~ x1 + x2 + ...

+ +
weights
+

(case) weights for each example – if missing defaults to 1

-

Format

+
size
+

number of units in the hidden layer. Can be zero if there are skip-layer units.

-

R6Class object.

-

Value

+
entropy
+

switch for entropy (= maximum conditional likelihood) fitting. Default by least-squares.

-

Learner object with methods for both training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

+
decay
+

parameter for weight decay. Default 0.

- +
maxit
+

maximum number of iterations. Default 100.

-
-
formula

A formula of the form class ~ x1 + x2 + ...

-
weights

(case) weights for each example – if missing defaults to 1

-
size

number of units in the hidden layer. Can be zero if there are skip-layer units.

-
entropy

switch for entropy (= maximum conditional likelihood) fitting. Default by least-squares.

-
decay

parameter for weight decay. Default 0.

-
maxit

maximum number of iterations. Default 100.

-
linout

switch for linear output units. Default logistic output units.

-
...

Other parameters passed to -nnet.

+
linout
+

switch for linear output units. Default logistic output units.

-
+
...
+

Other parameters passed to +nnet.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_nnls.html b/docs/reference/Lrnr_nnls.html index 1587a251..5a49b581 100644 --- a/docs/reference/Lrnr_nnls.html +++ b/docs/reference/Lrnr_nnls.html @@ -1,79 +1,20 @@ - - - - - - - -Non-negative Linear Least Squares — Lrnr_nnls • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Non-negative Linear Least Squares — Lrnr_nnls • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for models via non-negative linear least squares regression, using nnls package's -nnls function.

+nnls function.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# NNLS is commonly used as a metalearner in a super learner (i.e., Lrnr_sl) -lrnr_glm <- make_learner(Lrnr_glm) -lrnr_glmnet <- Lrnr_glmnet$new() -lrnr_mean <- Lrnr_mean$new() -learners <- c(lrnr_glm, lrnr_glmnet, lrnr_mean) -names(learners) <- c("glm", "lasso", "mean") # optional, renaming learners -simple_learner_stack <- make_learner(Stack, learners) -sl <- Lrnr_sl$new(learners = simple_learner_stack, metalearner = lrnr_nnls) -sl_fit <- sl$train(task) -sl_preds <- sl_fit$predict() -
+
+

Examples

+
data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+lrnr_nnls <- make_learner(Lrnr_nnls)
+nnls_fit <- lrnr_nnls$train(task)
+nnls_preds <- nnls_fit$predict()
+
+# NNLS is commonly used as a metalearner in a super learner (i.e., Lrnr_sl)
+lrnr_glm <- make_learner(Lrnr_glm)
+lrnr_glmnet <- Lrnr_glmnet$new()
+lrnr_mean <- Lrnr_mean$new()
+learners <- c(lrnr_glm, lrnr_glmnet, lrnr_mean)
+names(learners) <- c("glm", "lasso", "mean") # optional, renaming learners
+simple_learner_stack <- make_learner(Stack, learners)
+sl <- Lrnr_sl$new(learners = simple_learner_stack, metalearner = lrnr_nnls)
+sl_fit <- sl$train(task)
+sl_preds <- sl_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_optim.html b/docs/reference/Lrnr_optim.html index c2a009e8..ee346032 100644 --- a/docs/reference/Lrnr_optim.html +++ b/docs/reference/Lrnr_optim.html @@ -1,80 +1,21 @@ - - - - - - - -Optimize Metalearner according to Loss Function using optim — Lrnr_optim • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Optimize Metalearner according to Loss Function using optim — Lrnr_optim • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -151,144 +83,154 @@

Optimize Metalearner according to Loss Function using optim

This meta-learner provides fitting procedures for any pairing of loss function and metalearner function, subject to constraints. The optimization problem is solved by making use of optim, For further -details, consult the documentation of optim.

+details, consult the documentation of optim.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner_function=metalearner_linear

A function(alpha, X) that +

learner_function=metalearner_linear
+

A function(alpha, X) that takes a vector of covariates and a matrix of data and combines them into -a vector of predictions. See metalearners for options.

-
loss_function=loss_squared_error

A function(pred, truth) that +a vector of predictions. See metalearners for options.

+ +
loss_function=loss_squared_error
+

A function(pred, truth) that takes prediction and truth vectors and returns a loss vector. See -loss_functions for options.

-
intercept=FALSE

If true, X includes an intercept term.

-
init_0=FALSE

If true, alpha is initialized to all 0's, useful +loss_functions for options.

+ +
intercept=FALSE
+

If true, X includes an intercept term.

+ +
init_0=FALSE
+

If true, alpha is initialized to all 0's, useful for TMLE. Otherwise, it is initialized to equal weights summing to 1, useful for Super Learner.

-
...

Not currently used.

-
+
...
+

Not currently used.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_pca.html b/docs/reference/Lrnr_pca.html index f9badfb9..af733ded 100644 --- a/docs/reference/Lrnr_pca.html +++ b/docs/reference/Lrnr_pca.html @@ -1,81 +1,22 @@ - - - - - - - -Principal Component Analysis and Regression — Lrnr_pca • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Principal Component Analysis and Regression — Lrnr_pca • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -157,141 +89,149 @@

Principal Component Analysis and Regression

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
n_comp

A numeric value indicating the number of +

n_comp
+

A numeric value indicating the number of components to be produced as a result of the PCA dimensionality reduction. For convenience, this defaults to two (2) components.

-
center

A logical value indicating whether the input + +

center
+

A logical value indicating whether the input data matrix should be centered before performing PCA. This defaults to TRUE since that is the recommended practice. Consider consulting the documentation of prcomp for details.

-
scale.

A logical value indicating whether the input + +

scale.
+

A logical value indicating whether the input data matrix should be scaled (to unit variance) before performing PCA. Consider consulting the documentation of prcomp for details.

-
...

Other optional parameters to be passed to prcomp. -Consider consulting the documentation of prcomp for details.

-
+
...
+

Other optional parameters to be passed to prcomp. +Consider consulting the documentation of prcomp for details.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_polspline.html b/docs/reference/Lrnr_polspline.html index 6c838732..0fc572d0 100644 --- a/docs/reference/Lrnr_polspline.html +++ b/docs/reference/Lrnr_polspline.html @@ -1,82 +1,23 @@ - - - - - - - -Polyspline - multivariate adaptive polynomial spline regression (polymars) -and polychotomous regression and multiple classification (polyclass) — Lrnr_polspline • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Polyspline - multivariate adaptive polynomial spline regression (polymars) +and polychotomous regression and multiple classification (polyclass) — Lrnr_polspline • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for an adaptive regression procedure using piecewise linear splines to model the response, using the function -polymars or polyclass from +polymars or polyclass from the polspline package as appropriate.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
cv

The number of cross-validation folds to be used in +

cv
+

The number of cross-validation folds to be used in evaluating the sequence of fit models. This is only passed to -polyclass for binary/categorical outcomes.

-
...

Other parameters passed to either -polymars or polyclass. -See their documentation for details.

+polyclass for binary/categorical outcomes.

-
+
...
+

Other parameters passed to either +polymars or polyclass. +See their documentation for details.

-

See also

- +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_pooled_hazards.html b/docs/reference/Lrnr_pooled_hazards.html index 3aa321eb..f1b12f77 100644 --- a/docs/reference/Lrnr_pooled_hazards.html +++ b/docs/reference/Lrnr_pooled_hazards.html @@ -1,78 +1,19 @@ - - - - - - - -Classification from Pooled Hazards — Lrnr_pooled_hazards • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Classification from Pooled Hazards — Lrnr_pooled_hazards • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Classification from Pooled Hazards

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
binomial_learner

The learner to wrap.

+
binomial_learner
+

The learner to wrap.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_randomForest.html b/docs/reference/Lrnr_randomForest.html index 2e9c86ff..389dab53 100644 --- a/docs/reference/Lrnr_randomForest.html +++ b/docs/reference/Lrnr_randomForest.html @@ -1,79 +1,20 @@ - - - - - - - -Random Forests — Lrnr_randomForest • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Random Forests — Lrnr_randomForest • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for random forest models, using the -randomForest package, using randomForest +randomForest package, using randomForest function.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
ntree = 500

Number of trees to grow. This should not be set +

ntree = 500
+

Number of trees to grow. This should not be set to too small a number, to ensure that every input row gets predicted at least a few times.

-
keep.forest = TRUE

If TRUE, forest is stored, which is -required for prediction.

-
nodesize = 5

Minimum number of observations in terminal -nodes.

-
...

Other parameters passed to -randomForest.

-
+
keep.forest = TRUE
+

If TRUE, forest is stored, which is +required for prediction.

-

See also

+
nodesize = 5
+

Minimum number of observations in terminal +nodes.

- +
...
+

Other parameters passed to +randomForest.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_ranger.html b/docs/reference/Lrnr_ranger.html index 63883f5b..a0c40a9a 100644 --- a/docs/reference/Lrnr_ranger.html +++ b/docs/reference/Lrnr_ranger.html @@ -1,82 +1,23 @@ - - - - - - - -Ranger: Fast(er) Random Forests — Lrnr_ranger • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Ranger: Fast(er) Random Forests — Lrnr_ranger • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -154,27 +86,27 @@

Ranger: Fast(er) Random Forests

Random Forests, using the routines from ranger (described in Wright and Ziegler (2017) ) through a call to the function -ranger. Variable importance functionality is also -provided through invocation of the importance method.

+ranger. Variable importance functionality is also +provided through invocation of the importance method.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • num.trees = 500: Number of trees to be used in growing the forest.

  • +
    • num.trees = 500: Number of trees to be used in growing the forest.

    • write.forest = TRUE: If TRUE, forest is stored, which is required for prediction. Set to FALSE to reduce memory usage if downstream prediction is not intended.

    • @@ -182,142 +114,141 @@

      P "impurity", "impurity_corrected", "permutation". The "impurity" measure is the Gini index for classification, the variance of the responses for regression, and the sum of test statistics (for survival analysis, see -the splitrule argument of ranger).

      +the splitrule argument of ranger).

    • num.threads = 1: Number of threads.

    • -
    • ...: Other parameters passed to ranger. See +

    • ...: Other parameters passed to ranger. See its documentation for details.

    • -

    - -

    References

    - +
+
+

References

Wright MN, Ziegler A (2017). -“ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R.” +“ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R.” Journal of Statistical Software, 77(1), 1--17. -doi: 10.18637/jss.v077.i01 +doi: 10.18637/jss.v077.i01 .

-

See also

- -

Lrnr_randomForest for a similar learner using randomForest

+
+
+

See also

+ - -

Examples

-
data(mtcars) -# create task for prediction -mtcars_task <- sl3_Task$new( - data = mtcars, - covariates = c( - "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am", - "gear", "carb" - ), - outcome = "mpg" -) -# initialization, training, and prediction with the defaults -ranger_lrnr <- Lrnr_ranger$new() -ranger_fit <- ranger_lrnr$train(mtcars_task) -ranger_preds <- ranger_fit$predict() - -# variable importance -ranger_lrnr_importance <- Lrnr_ranger$new(importance = "impurity_corrected") -ranger_fit_importance <- ranger_lrnr_importance$train(mtcars_task) -ranger_importance <- ranger_fit_importance$importance() +Custom_chain, +Lrnr_HarmonicReg, +Lrnr_arima, +Lrnr_bartMachine, +Lrnr_base, +Lrnr_bayesglm, +Lrnr_bilstm, +Lrnr_caret, +Lrnr_cv_selector, +Lrnr_cv, +Lrnr_dbarts, +Lrnr_define_interactions, +Lrnr_density_discretize, +Lrnr_density_hse, +Lrnr_density_semiparametric, +Lrnr_earth, +Lrnr_expSmooth, +Lrnr_gam, +Lrnr_ga, +Lrnr_gbm, +Lrnr_glm_fast, +Lrnr_glmnet, +Lrnr_glm, +Lrnr_grf, +Lrnr_gru_keras, +Lrnr_gts, +Lrnr_h2o_grid, +Lrnr_hal9001, +Lrnr_haldensify, +Lrnr_hts, +Lrnr_independent_binomial, +Lrnr_lightgbm, +Lrnr_lstm_keras, +Lrnr_mean, +Lrnr_multiple_ts, +Lrnr_multivariate, +Lrnr_nnet, +Lrnr_nnls, +Lrnr_optim, +Lrnr_pca, +Lrnr_pkg_SuperLearner, +Lrnr_polspline, +Lrnr_pooled_hazards, +Lrnr_randomForest, +Lrnr_revere_task, +Lrnr_rpart, +Lrnr_rugarch, +Lrnr_screener_augment, +Lrnr_screener_coefs, +Lrnr_screener_correlation, +Lrnr_screener_importance, +Lrnr_sl, +Lrnr_solnp_density, +Lrnr_solnp, +Lrnr_stratified, +Lrnr_subset_covariates, +Lrnr_svm, +Lrnr_tsDyn, +Lrnr_ts_weights, +Lrnr_xgboost, +Pipeline, +Stack, +define_h2o_X(), +undocumented_learner

+
-# screening based on variable importance, example in glm pipeline -ranger_importance_screener <- Lrnr_screener_importance$new( - learner = ranger_lrnr_importance, num_screen = 3 -) -glm_lrnr <- make_learner(Lrnr_glm) -ranger_screen_glm_pipe <- Pipeline$new(ranger_importance_screener, glm_lrnr) -ranger_screen_glm_pipe_fit <- ranger_screen_glm_pipe$train(mtcars_task) -
+
+

Examples

+
data(mtcars)
+# create task for prediction
+mtcars_task <- sl3_Task$new(
+  data = mtcars,
+  covariates = c(
+    "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
+    "gear", "carb"
+  ),
+  outcome = "mpg"
+)
+# initialization, training, and prediction with the defaults
+ranger_lrnr <- Lrnr_ranger$new()
+ranger_fit <- ranger_lrnr$train(mtcars_task)
+ranger_preds <- ranger_fit$predict()
+
+# variable importance
+ranger_lrnr_importance <- Lrnr_ranger$new(importance = "impurity_corrected")
+ranger_fit_importance <- ranger_lrnr_importance$train(mtcars_task)
+ranger_importance <- ranger_fit_importance$importance()
+
+# screening based on variable importance, example in glm pipeline
+ranger_importance_screener <- Lrnr_screener_importance$new(
+  learner = ranger_lrnr_importance, num_screen = 3
+)
+glm_lrnr <- make_learner(Lrnr_glm)
+ranger_screen_glm_pipe <- Pipeline$new(ranger_importance_screener, glm_lrnr)
+ranger_screen_glm_pipe_fit <- ranger_screen_glm_pipe$train(mtcars_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_revere_task.html b/docs/reference/Lrnr_revere_task.html index bc2ea52f..1bbdb08b 100644 --- a/docs/reference/Lrnr_revere_task.html +++ b/docs/reference/Lrnr_revere_task.html @@ -1,77 +1,18 @@ - - - - - - - -Learner that chains into a revere task — Lrnr_revere_task • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Learner that chains into a revere task — Lrnr_revere_task • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,116 +81,114 @@

Learner that chains into a revere task

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+ +
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_rpart.html b/docs/reference/Lrnr_rpart.html index 606e352d..8e57f6fe 100644 --- a/docs/reference/Lrnr_rpart.html +++ b/docs/reference/Lrnr_rpart.html @@ -1,78 +1,19 @@ - - - - - - - -Learner for Recursive Partitioning and Regression Trees. — Lrnr_rpart • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Learner for Recursive Partitioning and Regression Trees. — Lrnr_rpart • sl3 - - - - - - - - + + -
-
- -
- -
+
-

This learner uses rpart from rpart to fit +

This learner uses rpart from rpart to fit recursive partitioning and regression trees.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
model

If logical: keep a copy of the model frame in the +

model
+

If logical: keep a copy of the model frame in the result?

-
x

Whether to keep a copy of the x matrix in the result.

-
y

Whether to keep a copy of the dependent variable in the -result.

-
...

Other parameters to be passed directly to -rpart. See its documentation for details.

-
+
x
+

Whether to keep a copy of the x matrix in the result.

-

See also

+
y
+

Whether to keep a copy of the dependent variable in the +result.

- +
...
+

Other parameters to be passed directly to +rpart. See its documentation for details.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_rugarch.html b/docs/reference/Lrnr_rugarch.html index 73dd38d7..b5e1f08b 100644 --- a/docs/reference/Lrnr_rugarch.html +++ b/docs/reference/Lrnr_rugarch.html @@ -1,80 +1,21 @@ - - - - - - - -Univariate GARCH Models — Lrnr_rugarch • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Univariate GARCH Models — Lrnr_rugarch • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -151,28 +83,28 @@

Univariate GARCH Models

This learner supports autoregressive fractionally integrated moving average and various flavors of generalized autoregressive conditional heteroskedasticity models for univariate time-series. All the -models are fit using ugarchfit.

+models are fit using ugarchfit.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# instantiate learner, then fit and predict -HarReg_learner <- Lrnr_HarmonicReg$new(K = 7, freq = 105) -HarReg_fit <- HarReg_learner$train(train_task) -HarReg_preds <- HarReg_fit$predict(valid_task) -
+
+

Examples

+
library(origami)
+library(data.table)
+data(bsds)
+
+# make folds appropriate for time-series cross-validation
+folds <- make_folds(bsds,
+  fold_fun = folds_rolling_window, window_size = 500,
+  validation_size = 100, gap = 0, batch = 50
+)
+
+# build task by passing in external folds structure
+task <- sl3_Task$new(
+  data = bsds,
+  folds = folds,
+  covariates = c(
+    "weekday", "temp"
+  ),
+  outcome = "cnt"
+)
+
+# create tasks for taining and validation
+train_task <- training(task, fold = task$folds[[1]])
+valid_task <- validation(task, fold = task$folds[[1]])
+
+# instantiate learner, then fit and predict
+HarReg_learner <- Lrnr_HarmonicReg$new(K = 7, freq = 105)
+HarReg_fit <- HarReg_learner$train(train_task)
+HarReg_preds <- HarReg_fit$predict(valid_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_screener_augment.html b/docs/reference/Lrnr_screener_augment.html index 20ef9422..339b6df1 100644 --- a/docs/reference/Lrnr_screener_augment.html +++ b/docs/reference/Lrnr_screener_augment.html @@ -1,78 +1,19 @@ - - - - - - - -Augmented Covariate Screener — Lrnr_screener_augment • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Augmented Covariate Screener — Lrnr_screener_augment • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,120 +83,122 @@

Augmented Covariate Screener

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
screener

An instantiated screener.

-
default_covariates

Vector of covariate names to be +

screener
+

An instantiated screener.

+ +
default_covariates
+

Vector of covariate names to be automatically added to the vector selected by the screener, regardless of whether or not these covariates were selected by the screener.

-
...

Other parameters passed to screener.

-
- -

See also

- - +
...
+

Other parameters passed to screener.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_screener_coefs.html b/docs/reference/Lrnr_screener_coefs.html index e51c4528..33a0a242 100644 --- a/docs/reference/Lrnr_screener_coefs.html +++ b/docs/reference/Lrnr_screener_coefs.html @@ -1,78 +1,19 @@ - - - - - - - -Coefficient Magnitude Screener — Lrnr_screener_coefs • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Coefficient Magnitude Screener — Lrnr_screener_coefs • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,122 +83,128 @@

Coefficient Magnitude Screener

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner

An instantiated learner to use for estimating +

learner
+

An instantiated learner to use for estimating coefficients used in screening.

-
threshold = 1e-3

Minimum size of coefficients to be kept.

-
max_screen = NULL

Maximum number of covariates to be kept.

-
min_screen = 2

Maximum number of covariates to be kept. Only -applicable when supplied learner is a Lrnr_glmnet.

-
...

Other parameters passed to learner.

- -
-

See also

- - +
threshold = 1e-3
+

Minimum size of coefficients to be kept.

+ +
max_screen = NULL
+

Maximum number of covariates to be kept.

+ +
min_screen = 2
+

Maximum number of covariates to be kept. Only +applicable when supplied learner is a Lrnr_glmnet.

+ +
...
+

Other parameters passed to learner.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_screener_correlation.html b/docs/reference/Lrnr_screener_correlation.html index 620e6bbd..862ab4dd 100644 --- a/docs/reference/Lrnr_screener_correlation.html +++ b/docs/reference/Lrnr_screener_correlation.html @@ -1,80 +1,21 @@ - - - - - - - -Correlation Screening Procedures — Lrnr_screener_correlation • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Correlation Screening Procedures — Lrnr_screener_correlation • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides covariate screening procedures by running a test of -correlation (Pearson default) with the cor.test +correlation (Pearson default) with the cor.test function, and then selecting the (1) top ranked variables (default), or (2) the variables with a pvalue lower than some pre-specified threshold.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
method = 'pearson'

Correlation coefficient used for test.

-
type = c('rank', 'threshold')

Screen covariates by (1) rank +

method = 'pearson'
+

Correlation coefficient used for test.

+ +
type = c('rank', 'threshold')
+

Screen covariates by (1) rank (default), which chooses the top num_screen correlated covariates; or (2) threshold, which chooses covariates with a correlation- test- based pvalue lower the threshold and a minimum of min_screen covariates.

-
num_screen = 5

Number of covariates to select.

-
pvalue_threshold = 0.1

Maximum p-value threshold. Covariates + +

num_screen = 5
+

Number of covariates to select.

+ +
pvalue_threshold = 0.1
+

Maximum p-value threshold. Covariates with a pvalue lower than this threshold will be retained, and at least min_screen most significant covariates will be selected.

-
min_screen = 2

Minimum number of covariates to select. Used -in pvalue_threshold screening procedure.

-
+
min_screen = 2
+

Minimum number of covariates to select. Used +in pvalue_threshold screening procedure.

-

See also

- +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_screener_importance.html b/docs/reference/Lrnr_screener_importance.html index b0d6b0c5..da6346a9 100644 --- a/docs/reference/Lrnr_screener_importance.html +++ b/docs/reference/Lrnr_screener_importance.html @@ -1,83 +1,24 @@ - - - - - - - -Variable Importance Screener — Lrnr_screener_importance • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Variable Importance Screener — Lrnr_screener_importance • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -154,166 +86,164 @@

Variable Importance Screener

This learner screens covariates based on their variable importance, where the importance values are obtained from the learner. Any learner with an importance method can be used. The set of learners with support for -importance can be found with sl3_list_learners("importance"). +importance can be found with sl3_list_learners("importance"). Like all other screeners, this learner is intended for use in a -Pipeline, so the output from this learner (i.e., the selected +Pipeline, so the output from this learner (i.e., the selected covariates) can be used as input for the next learner in the pipeline.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# screening based on \code{\link{Lrnr_randomForest}} variable importance -xgb_lrnr <- Lrnr_xgboost$new() -xgb_importance_screener <- Lrnr_screener_importance$new( - learner = xgb_lrnr, num_screen = 3 -) -xgb_screen_glm_pipe <- Pipeline$new(xgb_importance_screener, glm_lrnr) -xgb_screen_glm_pipe_fit <- xgb_screen_glm_pipe$train(mtcars_task) -
+
+

Examples

+
data(mtcars)
+mtcars_task <- sl3_Task$new(
+  data = mtcars,
+  covariates = c(
+    "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
+    "gear", "carb"
+  ),
+  outcome = "mpg"
+)
+glm_lrnr <- make_learner(Lrnr_glm)
+
+# screening based on \code{\link{Lrnr_ranger}} variable importance
+ranger_lrnr_importance <- Lrnr_ranger$new(importance = "impurity_corrected")
+ranger_importance_screener <- Lrnr_screener_importance$new(
+  learner = ranger_lrnr_importance, num_screen = 3
+)
+ranger_screen_glm_pipe <- Pipeline$new(ranger_importance_screener, glm_lrnr)
+ranger_screen_glm_pipe_fit <- ranger_screen_glm_pipe$train(mtcars_task)
+
+# screening based on \code{\link{Lrnr_randomForest}} variable importance
+rf_lrnr <- Lrnr_randomForest$new()
+rf_importance_screener <- Lrnr_screener_importance$new(
+  learner = rf_lrnr, num_screen = 3
+)
+rf_screen_glm_pipe <- Pipeline$new(rf_importance_screener, glm_lrnr)
+rf_screen_glm_pipe_fit <- rf_screen_glm_pipe$train(mtcars_task)
+
+# screening based on \code{\link{Lrnr_randomForest}} variable importance
+xgb_lrnr <- Lrnr_xgboost$new()
+xgb_importance_screener <- Lrnr_screener_importance$new(
+  learner = xgb_lrnr, num_screen = 3
+)
+xgb_screen_glm_pipe <- Pipeline$new(xgb_importance_screener, glm_lrnr)
+xgb_screen_glm_pipe_fit <- xgb_screen_glm_pipe$train(mtcars_task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_sl.html b/docs/reference/Lrnr_sl.html index 6711f002..26e675d0 100644 --- a/docs/reference/Lrnr_sl.html +++ b/docs/reference/Lrnr_sl.html @@ -1,79 +1,20 @@ - - - - - - - -The Super Learner Algorithm — Lrnr_sl • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The Super Learner Algorithm — Lrnr_sl • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -153,140 +85,150 @@

The Super Learner Algorithm

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learners

The "library" of learners to include

-
metalearner

The metalearner to be fit on predictions from -the library.

If null, default_metalearner is used to +
learners
+

The "library" of learners to include

+ +
metalearner
+

The metalearner to be fit on predictions from +the library.

+ If null, default_metalearner is used to construct a metalearner based on the outcome_type of the training task. -
folds=NULL

An origami folds object. If NULL, +

folds=NULL
+

An origami folds object. If NULL, folds from the task are used.

-
keep_extra=TRUE

Stores all sub-parts of the SL computation. + +

keep_extra=TRUE
+

Stores all sub-parts of the SL computation. When set to FALSE the resultant object has a memory footprint that is significantly reduced through the discarding of intermediary data structures.

-
...

Not used.

-
+
...
+

Not used.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_solnp.html b/docs/reference/Lrnr_solnp.html index 794a34ad..a814b0ca 100644 --- a/docs/reference/Lrnr_solnp.html +++ b/docs/reference/Lrnr_solnp.html @@ -1,46 +1,5 @@ - - - - - - - -Nonlinear Optimization via Augmented Lagrange — Lrnr_solnp • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Nonlinear Optimization via Augmented Lagrange — Lrnr_solnp • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This meta-learner provides fitting procedures for any pairing of loss or risk function and metalearner function, subject to constraints. The optimization -problem is solved by making use of solnp, using -Lagrange multipliers. An important note from the solnp +problem is solved by making use of solnp, using +Lagrange multipliers. An important note from the solnp documentation states that the control parameters tol and delta are key in getting any possibility of successful convergence, therefore it is suggested that the user change these appropriately to reflect their @@ -165,29 +97,29 @@

Nonlinear Optimization via Augmented Lagrange

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
+ -# instantiate SL with GA metalearner -solnp_meta <- Lrnr_solnp$new() -sl <- Lrnr_sl$new(lrnr_stack, solnp_meta) -sl_fit <- sl$train(task) -
+
+

Examples

+
# define ML task
+data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# build relatively fast learner library (not recommended for real analysis)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr)
+names(lrnrs) <- c("lasso", "glm", "ranger")
+lrnr_stack <- make_learner(Stack, lrnrs)
+
+# instantiate SL with GA metalearner
+solnp_meta <- Lrnr_solnp$new()
+sl <- Lrnr_sl$new(lrnr_stack, solnp_meta)
+sl_fit <- sl$train(task)
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_solnp_density.html b/docs/reference/Lrnr_solnp_density.html index f5ec57df..bb1105df 100644 --- a/docs/reference/Lrnr_solnp_density.html +++ b/docs/reference/Lrnr_solnp_density.html @@ -1,82 +1,23 @@ - - - - - - - -Nonlinear Optimization via Augmented Lagrange — Lrnr_solnp_density • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Nonlinear Optimization via Augmented Lagrange — Lrnr_solnp_density • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -153,136 +85,138 @@

Nonlinear Optimization via Augmented Lagrange

This meta-learner provides fitting procedures for density estimation, finding convex combinations of candidate density estimators by minimizing the cross-validated negative log-likelihood loss of each candidate density. The -optimization problem is solved by making use of solnp, +optimization problem is solved by making use of solnp, using Lagrange multipliers. For further details, consult the documentation of the Rsolnp package.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
...

Not currently used.

+
...
+

Not currently used.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_stratified.html b/docs/reference/Lrnr_stratified.html index 5380e234..9dc6896d 100644 --- a/docs/reference/Lrnr_stratified.html +++ b/docs/reference/Lrnr_stratified.html @@ -1,77 +1,18 @@ - - - - - - - -Stratify learner fits by a single variable — Lrnr_stratified • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Stratify learner fits by a single variable — Lrnr_stratified • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,121 +81,123 @@

Stratify learner fits by a single variable

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner="learner"

An initialized Lrnr_* object.

-
variable_stratify="variable_stratify"

character giving +

learner="learner"
+

An initialized Lrnr_* object.

+ +
variable_stratify="variable_stratify"
+

character giving the variable in the covariates on which to stratify. Supports only variables with discrete levels coded as numeric.

-
...

Other parameters passed directly to -learner$train. See its documentation for details.

-
+
...
+

Other parameters passed directly to +learner$train. See its documentation for details.

-

See also

- +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_subset_covariates.html b/docs/reference/Lrnr_subset_covariates.html index 4f14eacf..5418d861 100644 --- a/docs/reference/Lrnr_subset_covariates.html +++ b/docs/reference/Lrnr_subset_covariates.html @@ -1,78 +1,19 @@ - - - - - - - -Learner with Covariate Subsetting — Lrnr_subset_covariates • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Learner with Covariate Subsetting — Lrnr_subset_covariates • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Learner with Covariate Subsetting

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
...

Not currently used.

+
...
+

Not currently used.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_svm.html b/docs/reference/Lrnr_svm.html index 09be55a6..e34b5918 100644 --- a/docs/reference/Lrnr_svm.html +++ b/docs/reference/Lrnr_svm.html @@ -1,82 +1,23 @@ - - - - - - - -Support Vector Machines — Lrnr_svm • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Support Vector Machines — Lrnr_svm • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -155,164 +87,163 @@

Support Vector Machines

and Chang and Lin (2011) , the core library to which e1071 -is an interface) through a call to the function svm.

+is an interface) through a call to the function svm.

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • scale = TRUE: A logical vector indicating the variables to be +

    • scale = TRUE: A logical vector indicating the variables to be scaled. For a detailed description, please consult the documentation -for svm.

    • +for svm.

    • type = NULL: SVMs can be used as a classification machine, as a a regression machine, or for novelty detection. Depending of whether the outcome is a factor or not, the default setting for this argument is "C-classification" or "eps-regression", respectively. This may be overwritten by setting an explicit value. For a full set of options, -please consult the documentation for svm.

    • +please consult the documentation for svm.

    • kernel = "radial": The kernel used in training and predicting. You may consider changing some of the optional parameters, depending on the kernel type. Kernel options include: "linear", "polynomial", "radial" (the default), "sigmoid". For a detailed description, consult -the documentation for svm.

    • +the documentation for svm.

    • fitted = TRUE: Logical indicating whether the fitted values should be computed and included in the model fit object or not.

    • probability = FALSE: Logical indicating whether the model should allow for probability predictions.

    • -
    • ...: Other parameters passed to svm. See its +

    • ...: Other parameters passed to svm. See its documentation for details.

    • -
    - -

    References

    - +
+
+

References

Chang C, Lin C (2011). -“LIBSVM: A library for support vector machines.” +“LIBSVM: A library for support vector machines.” ACM Transactions on Intelligent Systems and Technology, 2(3), 27:1--27:27. -Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm.

Meyer D, Dimitriadou E, Hornik K, Weingessel A, Leisch F (2021). +Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm.

Meyer D, Dimitriadou E, Hornik K, Weingessel A, Leisch F (2021). e1071: Misc Functions of the Department of Statistics, Probability Theory Group (Formerly: E1071), TU Wien. -R package version 1.7-6, https://CRAN.R-project.org/package=e1071.

-

See also

- - +R package version 1.7-6, https://CRAN.R-project.org/package=e1071.

+
+ -

Examples

-
data(mtcars) -# create task for prediction -mtcars_task <- sl3_Task$new( - data = mtcars, - covariates = c( - "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am", - "gear", "carb" - ), - outcome = "mpg" -) -# initialization, training, and prediction with the defaults -svm_lrnr <- Lrnr_svm$new() -svm_fit <- svm_lrnr$train(mtcars_task) -svm_preds <- svm_fit$predict() -
+
+

Examples

+
data(mtcars)
+# create task for prediction
+mtcars_task <- sl3_Task$new(
+  data = mtcars,
+  covariates = c(
+    "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
+    "gear", "carb"
+  ),
+  outcome = "mpg"
+)
+# initialization, training, and prediction with the defaults
+svm_lrnr <- Lrnr_svm$new()
+svm_fit <- svm_lrnr$train(mtcars_task)
+svm_preds <- svm_fit$predict()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_tsDyn.html b/docs/reference/Lrnr_tsDyn.html index 3802fff6..dcd4b877 100644 --- a/docs/reference/Lrnr_tsDyn.html +++ b/docs/reference/Lrnr_tsDyn.html @@ -1,78 +1,19 @@ - - - - - - - -Nonlinear Time Series Analysis — Lrnr_tsDyn • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Nonlinear Time Series Analysis — Lrnr_tsDyn • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,119 +83,121 @@

Nonlinear Time Series Analysis

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+ +
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_ts_weights.html b/docs/reference/Lrnr_ts_weights.html index 2563dcea..35830605 100644 --- a/docs/reference/Lrnr_ts_weights.html +++ b/docs/reference/Lrnr_ts_weights.html @@ -1,82 +1,23 @@ - - - - - - - -Time-specific weighting of prediction losses — Lrnr_ts_weights • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Time-specific weighting of prediction losses — Lrnr_ts_weights • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
@@ -159,26 +91,33 @@

Time-specific weighting of prediction losses

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
learner

The learner to wrap

-
folds=NULL

An origami folds object. If NULL, +

learner
+

The learner to wrap

+ +
folds=NULL
+

An origami folds object. If NULL, folds from the task are used

-
full_fit=FALSE

If TRUE, also fit the underlying + +

full_fit=FALSE
+

If TRUE, also fit the underlying learner on the full data. This can then be accessed with predict_fold(task, fold_number="full")

-
window

Observations corresponding to times outside of the + +

window
+

Observations corresponding to times outside of the window are assigned weight of 0, and obervations corresponding to times within the window are assigned weight of 1. The window is defined with respect to the difference from the maximum time, where all times are @@ -189,10 +128,14 @@

P window are assigned according to the rate argument (and potentially delay_decay), and the times outside of the window are still assigned weight of 0.

-
rate

A rate of decay to apply to the losses, where the decay + +

rate
+

A rate of decay to apply to the losses, where the decay function is (1-rate)^lag and the lag is the difference from all times to the maximum time.

-
delay_decay

The amount of time to delay decaying weights, + +

delay_decay
+

The amount of time to delay decaying weights, for optional use with rate argument. The delay decay is subtracted from the lags, such that lags less than the delay decay have lag of 0 and thus weight of 1. For example, a delay decay of 10 assigns weight 1 to @@ -202,103 +145,102 @@

P In this example, observations corresponding to 11 time points away from the maximum time would be assigned lag=1, 11-10, when setting the weights with respect to (1-rate)^lag.

-
...

Not currently used.

-
- -

See also

- - +
...
+

Not currently used.

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Lrnr_xgboost.html b/docs/reference/Lrnr_xgboost.html index d88e2f10..48dc3149 100644 --- a/docs/reference/Lrnr_xgboost.html +++ b/docs/reference/Lrnr_xgboost.html @@ -1,82 +1,23 @@ - - - - - - - -xgboost: eXtreme Gradient Boosting — Lrnr_xgboost • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -xgboost: eXtreme Gradient Boosting — Lrnr_xgboost • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+

This learner provides fitting procedures for xgboost models, using -the xgboost package, via xgb.train. Such +the xgboost package, via xgb.train. Such models are classification and regression trees with extreme gradient boosting. For details on the fitting procedure, consult the documentation of the xgboost and Chen and Guestrin (2016) @@ -159,145 +91,144 @@

xgboost: eXtreme Gradient Boosting

- -

Format

- -

An R6Class object inheriting from -Lrnr_base.

-

Value

- -

A learner object inheriting from Lrnr_base with +

+

Format

+

An R6Class object inheriting from +Lrnr_base.

+
+
+

Value

+

A learner object inheriting from Lrnr_base with methods for training and prediction. For a full list of learner -functionality, see the complete documentation of Lrnr_base.

-

Parameters

- +functionality, see the complete documentation of Lrnr_base.

+
+
+

Parameters

-
    -
  • nrounds=20: Number of fitting iterations.

  • -
  • ...: Other parameters passed to xgb.train.

  • -
- -

References

- +
  • nrounds=20: Number of fitting iterations.

  • +
  • ...: Other parameters passed to xgb.train.

  • +
+
+

References

Chen T, Guestrin C (2016). -“Xgboost: A scalable tree boosting system.” +“Xgboost: A scalable tree boosting system.” In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, 785--794.

-

See also

- -

Lrnr_gbm for standard gradient boosting models (via the gbm -package) and Lrnr_lightgbm for the faster and more efficient gradient +

+
+

See also

+ - -

Examples

-

+    
-# get feature importance from fitted model -xgb_varimp <- xgb_fit$importance() -
+
+

Examples

+
data(mtcars)
+mtcars_task <- sl3_Task$new(
+  data = mtcars,
+  covariates = c(
+    "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
+    "gear", "carb"
+  ),
+  outcome = "mpg"
+)
+
+# initialization, training, and prediction with the defaults
+xgb_lrnr <- Lrnr_xgboost$new()
+xgb_fit <- xgb_lrnr$train(mtcars_task)
+xgb_preds <- xgb_fit$predict()
+
+# get feature importance from fitted model
+xgb_varimp <- xgb_fit$importance()
+
+
+
-
- +
- - + + diff --git a/docs/reference/Pipeline.html b/docs/reference/Pipeline.html index c73c6eec..3c2582e9 100644 --- a/docs/reference/Pipeline.html +++ b/docs/reference/Pipeline.html @@ -1,84 +1,25 @@ - - - - - - - -Pipeline (chain) of learners. — Pipeline • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Pipeline (chain) of learners. — Pipeline • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -163,131 +95,133 @@

Pipeline (chain) of learners.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
...

Parameters should be individual Learners, in the +

...
+

Parameters should be individual Learners, in the order they should be applied.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/Shared_Data.html b/docs/reference/Shared_Data.html index bcec467d..fe49999e 100644 --- a/docs/reference/Shared_Data.html +++ b/docs/reference/Shared_Data.html @@ -1,77 +1,18 @@ - - - - - - - -Container Class for data.table Shared Between Tasks — Shared_Data • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Container Class for data.table Shared Between Tasks — Shared_Data • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -150,32 +82,27 @@

Container Class for data.table Shared Between Tasks

-
+
-
- +
- - + + diff --git a/docs/reference/Stack.html b/docs/reference/Stack.html index 5a7a84f3..9dff34ae 100644 --- a/docs/reference/Stack.html +++ b/docs/reference/Stack.html @@ -1,78 +1,19 @@ - - - - - - - -Learner Stacking — Stack • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Learner Stacking — Stack • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -151,130 +83,132 @@

Learner Stacking

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
...

Parameters should be individual Learners.

+
...
+

Parameters should be individual Learners.

-
- -

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/SuperLearner_interface.html b/docs/reference/SuperLearner_interface.html index fd790786..5faa5bbc 100644 --- a/docs/reference/SuperLearner_interface.html +++ b/docs/reference/SuperLearner_interface.html @@ -1,84 +1,25 @@ - - - - - - - -Use SuperLearner Wrappers, Screeners, and Methods, in sl3 — Lrnr_pkg_SuperLearner • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Use SuperLearner Wrappers, Screeners, and Methods, in sl3 — Lrnr_pkg_SuperLearner • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -157,137 +89,141 @@

Use SuperLearner Wrappers, Screeners, and Methods, in sl3

SuperLearner package. These components add support for a range of algorithms not currently implemented natively in sl3.

Lrnr_pkg_SuperLearner - Interface for SuperLearner -wrapper functions. Use SuperLearner::listWrappers("SL") for a list.

-

Use SuperLearner::listWrappers("method") for a list of options.

-

Use SuperLearner::listWrappers("screen") for a list of options.

+wrapper functions. Use SuperLearner::listWrappers("SL") for a list.

+

Use SuperLearner::listWrappers("method") for a list of options.

+

Use SuperLearner::listWrappers("screen") for a list of options.

- -

Format

- +
+

Format

R6Class object.

-

Value

- +
+
+

Value

Learner object with methods for training and prediction. See -Lrnr_base for documentation on learners.

-

Parameters

- +Lrnr_base for documentation on learners.

+
+
+

Parameters

-
-
SL_wrapper

The wrapper function to use.

-
...

Currently not used.

+
SL_wrapper
+

The wrapper function to use.

-
+
...
+

Currently not used.

-

Common Parameters

+
+
+

Common Parameters

Individual learners have their own sets of parameters. Below is a list of shared parameters, implemented by Lrnr_base, and shared by all learners.

-
-
covariates

A character vector of covariates. The learner will use this to subset the covariates for any specified task

-
outcome_type

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

-
...

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

- -
- -

See also

- - +
covariates
+

A character vector of covariates. The learner will use this to subset the covariates for any specified task

+ +
outcome_type
+

A variable_type object used to control the outcome_type used by the learner. Overrides the task outcome_type if specified

+ +
...
+

All other parameters should be handled by the invidual learner classes. See the documentation for the learner class you're instantiating

+ + +
+
+
-
- +
- - + + diff --git a/docs/reference/args_to_list.html b/docs/reference/args_to_list.html index ef0df44e..8f2205c6 100644 --- a/docs/reference/args_to_list.html +++ b/docs/reference/args_to_list.html @@ -1,77 +1,18 @@ - - - - - - - -Get all arguments of parent call (both specified and defaults) as list — args_to_list • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Get all arguments of parent call (both specified and defaults) as list — args_to_list • sl3 - - - - - + + - - - -
-
- -
- -
+
@@ -148,38 +80,36 @@

Get all arguments of parent call (both specified and defaults) as list

Get all arguments of parent call (both specified and defaults) as list

-
args_to_list()
- - -

Value

+
+
args_to_list()
+
+
+

Value

A list of all arguments for the parent function call.

+
+
-
- +
- - + + diff --git a/docs/reference/bound.html b/docs/reference/bound.html index 8f063de5..413d2f42 100644 --- a/docs/reference/bound.html +++ b/docs/reference/bound.html @@ -1,77 +1,18 @@ - - - - - - - -Truncates predictions to ensure loss function is bounded. — bound • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Truncates predictions to ensure loss function is bounded. — bound • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,52 +80,45 @@

Truncates predictions to ensure loss function is bounded.

Truncates predictions to ensure loss function is bounded.

-
bound(preds, bounds = 0.001)
- -

Arguments

- - - - - - - - - - -
preds

A numeric vector of predictions to to be bounded.

bounds

Either a numeric vector of length two, giving the -closed interval (lower, upper), or just a lower bound. In the latter case, -the upper bound is computed as (1 - lower). The default is 0.001.

- -

Value

+
+
bound(preds, bounds = 0.001)
+
+
+

Arguments

+
preds
+

A numeric vector of predictions to to be bounded.

+
bounds
+

Either a numeric vector of length two, giving the +closed interval (lower, upper), or just a lower bound. In the latter case, +the upper bound is computed as (1 - lower). The default is 0.001.

+
+
+

Value

Truncated predictions.

+
+
-
- +
- - + + diff --git a/docs/reference/bsds.html b/docs/reference/bsds.html index fe9d1f22..5f76bd73 100644 --- a/docs/reference/bsds.html +++ b/docs/reference/bsds.html @@ -1,77 +1,18 @@ - - - - - - - -Bicycle sharing time series dataset — bsds • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bicycle sharing time series dataset — bsds • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,59 +80,60 @@

Bicycle sharing time series dataset

Bicycle sharing time series dataset from the UCI Machine Learning Repository.

-
data(bsds)
- - -

Source

+
+
data(bsds)
+
-

https://archive.ics.uci.edu/ml/datasets/bike+sharing+dataset

+
+

Source

+

https://archive.ics.uci.edu/ml/datasets/bike+sharing+dataset

Fanaee-T, Hadi, and Gama, Joao, 'Event labeling combining ensemble detectors and background knowledge', Progress in Artificial Intelligence (2013): pp. 1-15, Springer Berlin Heidelberg

+
-

Examples

-
data(bsds) -head(bsds) -
#> instant dteday season yr mnth holiday weekday workingday weathersit -#> 1 1 2011-01-01 1 0 1 0 6 0 2 -#> 2 2 2011-01-02 1 0 1 0 0 0 2 -#> 3 3 2011-01-03 1 0 1 0 1 1 1 -#> 4 4 2011-01-04 1 0 1 0 2 1 1 -#> 5 5 2011-01-05 1 0 1 0 3 1 1 -#> 6 6 2011-01-06 1 0 1 0 4 1 1 -#> temp atemp hum windspeed casual registered cnt -#> 1 0.344167 0.363625 0.805833 0.1604460 331 654 985 -#> 2 0.363478 0.353739 0.696087 0.2485390 131 670 801 -#> 3 0.196364 0.189405 0.437273 0.2483090 120 1229 1349 -#> 4 0.200000 0.212122 0.590435 0.1602960 108 1454 1562 -#> 5 0.226957 0.229270 0.436957 0.1869000 82 1518 1600 -#> 6 0.204348 0.233209 0.518261 0.0895652 88 1518 1606
# -
+
+

Examples

+
data(bsds)
+head(bsds)
+#>   instant     dteday season yr mnth holiday weekday workingday weathersit
+#> 1       1 2011-01-01      1  0    1       0       6          0          2
+#> 2       2 2011-01-02      1  0    1       0       0          0          2
+#> 3       3 2011-01-03      1  0    1       0       1          1          1
+#> 4       4 2011-01-04      1  0    1       0       2          1          1
+#> 5       5 2011-01-05      1  0    1       0       3          1          1
+#> 6       6 2011-01-06      1  0    1       0       4          1          1
+#>       temp    atemp      hum windspeed casual registered  cnt
+#> 1 0.344167 0.363625 0.805833 0.1604460    331        654  985
+#> 2 0.363478 0.353739 0.696087 0.2485390    131        670  801
+#> 3 0.196364 0.189405 0.437273 0.2483090    120       1229 1349
+#> 4 0.200000 0.212122 0.590435 0.1602960    108       1454 1562
+#> 5 0.226957 0.229270 0.436957 0.1869000     82       1518 1600
+#> 6 0.204348 0.233209 0.518261 0.0895652     88       1518 1606
+#
+
+
+
-
- +
- - + + diff --git a/docs/reference/call_with_args.html b/docs/reference/call_with_args.html index cd0f9f4f..a87ca5cf 100644 --- a/docs/reference/call_with_args.html +++ b/docs/reference/call_with_args.html @@ -1,78 +1,19 @@ - - - - - - - -Call with filtered argument list — call_with_args • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Call with filtered argument list — call_with_args • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -150,67 +82,51 @@

Call with filtered argument list

matched in the function prototype

-
call_with_args(fun, args, other_valid = list(), keep_all = FALSE,
-  silent = FALSE, ignore = c())
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
fun

A function whose signature will be used to reduce the

args

A list of function arguments to use.

other_valid

A list of function arguments names that are valid, -but not formals of fun.

keep_all

A logical don't drop arguments, even if they aren't -matched in either the function prototype or other_valid.

silent

A logical indicating whether to pass messages -when arguments not found in formals are passed to fun.

ignore

A character vector indicating which arguments should be dropped

+
+
call_with_args(fun, args, other_valid = list(), keep_all = FALSE,
+  silent = FALSE, ignore = c())
+
+
+

Arguments

+
fun
+

A function whose signature will be used to reduce the

+
args
+

A list of function arguments to use.

+
other_valid
+

A list of function arguments names that are valid, +but not formals of fun.

+
keep_all
+

A logical don't drop arguments, even if they aren't +matched in either the function prototype or other_valid.

+
silent
+

A logical indicating whether to pass messages +when arguments not found in formals are passed to fun.

+
ignore
+

A character vector indicating which arguments should be dropped

+
+
-
- +
- - + + diff --git a/docs/reference/cpp.html b/docs/reference/cpp.html index c913007c..3b5e6f74 100644 --- a/docs/reference/cpp.html +++ b/docs/reference/cpp.html @@ -1,80 +1,21 @@ - - - - - - - -Subset of growth data from the collaborative perinatal project (CPP) — cpp • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subset of growth data from the collaborative perinatal project (CPP) — cpp • sl3 - - - - - - - - - - - - - - - + + - - -
-
- -
- -
+
@@ -154,115 +86,180 @@

Subset of growth data from the collaborative perinatal project (CPP)

purposes of simplifying testing and examples.

-
data(cpp)
-
-data(cpp_imputed)
+
+
data(cpp)
 
+data(cpp_imputed)
+
-

Format

- +
+

Format

A data frame with 1,912 repated-measures observations and 500 unique subjects:

-
-
subjid

Subject ID

-
agedays

Age since birth at examination (days)

-
wtkg

Weight (kg)

-
htcm

Standing height (cm)

-
lencm

Recumbent length (cm)

-
bmi

BMI (kg/m**2)

-
waz

Weight for age z-score

-
haz

Length/height for age z-score

-
whz

Weight for length/height z-score

-
baz

BMI for age z-score

-
siteid

Investigational Site ID

-
sexn

Sex (num)

-
sex

Sex

-
feedingn

Maternal breastfeeding status (num)

-
feeding

Maternal breastfeeding status

-
gagebrth

Gestational age at birth (days)

-
birthwt

Birth weight (gm)

-
birthlen

Birth length (cm)

-
apgar1

APGAR Score 1 min after birth

-
apgar5

APGAR Score 5 min after birth

-
mage

Maternal age at birth of child (yrs)

-
mracen

Maternal race (num)

-
mrace

Maternal race

-
mmaritn

Mothers marital status (num)

-
mmarit

Mothers marital status

-
meducyrs

Mother, years of education

-
sesn

Socio-economic status (num)

-
ses

Socio-economic status

-
parity

Maternal parity

-
gravida

Maternal num pregnancies

-
smoked

Maternal smoking status

-
mcignum

Num cigarettes mom smoked per day

-
comprisk

Maternal risk factors

- -
- -

Source

- -

https://catalog.archives.gov/id/606622

+
subjid
+

Subject ID

+ +
agedays
+

Age since birth at examination (days)

+ +
wtkg
+

Weight (kg)

+ +
htcm
+

Standing height (cm)

+ +
lencm
+

Recumbent length (cm)

+ +
bmi
+

BMI (kg/m**2)

+ +
waz
+

Weight for age z-score

+ +
haz
+

Length/height for age z-score

+ +
whz
+

Weight for length/height z-score

+ +
baz
+

BMI for age z-score

+ +
siteid
+

Investigational Site ID

+ +
sexn
+

Sex (num)

+ +
sex
+

Sex

+ +
feedingn
+

Maternal breastfeeding status (num)

+ +
feeding
+

Maternal breastfeeding status

+ +
gagebrth
+

Gestational age at birth (days)

+ +
birthwt
+

Birth weight (gm)

+ +
birthlen
+

Birth length (cm)

+ +
apgar1
+

APGAR Score 1 min after birth

+ +
apgar5
+

APGAR Score 5 min after birth

+ +
mage
+

Maternal age at birth of child (yrs)

+ +
mracen
+

Maternal race (num)

+ +
mrace
+

Maternal race

+ +
mmaritn
+

Mothers marital status (num)

+ +
mmarit
+

Mothers marital status

+ +
meducyrs
+

Mother, years of education

+ +
sesn
+

Socio-economic status (num)

+ +
ses
+

Socio-economic status

+ +
parity
+

Maternal parity

+ +
gravida
+

Maternal num pregnancies

+ +
smoked
+

Maternal smoking status

+ +
mcignum
+

Num cigarettes mom smoked per day

+ +
comprisk
+

Maternal risk factors

+ + +
+
+

Source

+

https://catalog.archives.gov/id/606622

Broman, Sarah. 'The collaborative perinatal project: an overview.' Handbook of longitudinal research 1 (1984): 185-227.

+
-

Examples

-
data(cpp) -head(cpp) -
#> subjid agedays wtkg htcm lencm bmi waz haz whz baz siteid sexn -#> 1 1 1 4.621 55 55 15.27603 2.38 2.61 0.19 1.35 5 1 -#> 2 1 123 8.760 NA NA NA 1.99 NA NA NA 5 1 -#> 3 1 366 14.500 79 79 23.23346 3.84 1.35 4.02 3.89 5 1 -#> 4 2 1 3.345 51 51 12.86044 0.06 0.50 -0.64 -0.43 5 1 -#> 5 2 123 4.340 NA NA NA -3.99 NA NA NA 5 1 -#> 6 2 366 8.400 73 73 15.76281 -1.27 -1.17 -0.96 -0.80 5 1 -#> sex feedingn feeding gagebrth birthwt birthlen apgar1 apgar5 mage mracen -#> 1 Male 90 Unknown 287 4621 55 8 9 21 5 -#> 2 Male 90 Unknown 287 4621 55 8 9 21 5 -#> 3 Male 90 Unknown 287 4621 55 8 9 21 5 -#> 4 Male 90 Unknown 280 3345 51 8 9 15 5 -#> 5 Male 90 Unknown 280 3345 51 8 9 15 5 -#> 6 Male 90 Unknown 280 3345 51 8 9 15 5 -#> mrace mmaritn mmarit meducyrs sesn ses parity gravida smoked -#> 1 White 1 Married 12 50 Middle 1 1 0 -#> 2 White 1 Married 12 50 Middle 1 1 0 -#> 3 White 1 Married 12 50 Middle 1 1 0 -#> 4 White 1 Married NA NA . 0 0 1 -#> 5 White 1 Married NA NA . 0 0 1 -#> 6 White 1 Married NA NA . 0 0 1 -#> mcignum comprisk -#> 1 0 none -#> 2 0 none -#> 3 0 none -#> 4 35 none -#> 5 35 none -#> 6 35 none
# -
+
+

Examples

+
data(cpp)
+head(cpp)
+#>   subjid agedays   wtkg htcm lencm      bmi   waz   haz   whz   baz siteid sexn
+#> 1      1       1  4.621   55    55 15.27603  2.38  2.61  0.19  1.35      5    1
+#> 2      1     123  8.760   NA    NA       NA  1.99    NA    NA    NA      5    1
+#> 3      1     366 14.500   79    79 23.23346  3.84  1.35  4.02  3.89      5    1
+#> 4      2       1  3.345   51    51 12.86044  0.06  0.50 -0.64 -0.43      5    1
+#> 5      2     123  4.340   NA    NA       NA -3.99    NA    NA    NA      5    1
+#> 6      2     366  8.400   73    73 15.76281 -1.27 -1.17 -0.96 -0.80      5    1
+#>    sex feedingn feeding gagebrth birthwt birthlen apgar1 apgar5 mage mracen
+#> 1 Male       90 Unknown      287    4621       55      8      9   21      5
+#> 2 Male       90 Unknown      287    4621       55      8      9   21      5
+#> 3 Male       90 Unknown      287    4621       55      8      9   21      5
+#> 4 Male       90 Unknown      280    3345       51      8      9   15      5
+#> 5 Male       90 Unknown      280    3345       51      8      9   15      5
+#> 6 Male       90 Unknown      280    3345       51      8      9   15      5
+#>   mrace mmaritn  mmarit meducyrs sesn          ses parity gravida smoked
+#> 1 White       1 Married       12   50       Middle      1       1      0
+#> 2 White       1 Married       12   50       Middle      1       1      0
+#> 3 White       1 Married       12   50       Middle      1       1      0
+#> 4 White       1 Married       NA   NA            .      0       0      1
+#> 5 White       1 Married       NA   NA            .      0       0      1
+#> 6 White       1 Married       NA   NA            .      0       0      1
+#>   mcignum comprisk
+#> 1       0     none
+#> 2       0     none
+#> 3       0     none
+#> 4      35     none
+#> 5      35     none
+#> 6      35     none
+#
+
+
+
-
- +
- - + + diff --git a/docs/reference/cpp_1yr.html b/docs/reference/cpp_1yr.html index 10e7312b..799c848c 100644 --- a/docs/reference/cpp_1yr.html +++ b/docs/reference/cpp_1yr.html @@ -1,79 +1,20 @@ - - - - - - - -Subset of growth data from the collaborative perinatal project (CPP) — cpp_1yr • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subset of growth data from the collaborative perinatal project (CPP) — cpp_1yr • sl3 - - - - - - - - - - - - - - - + + - - -
-
- -
- -
+

Subset of growth data from the collaborative perinatal project (CPP) at single time-point. The rows in original cpp data were subset for -agedays==366. See ?cpp for the description of the variables.

+agedays==366. See ?cpp for the description of the variables.

-
data(cpp_1yr)
- - -

Source

+
+
data(cpp_1yr)
+
-

https://catalog.archives.gov/id/606622

+
+

Source

+

https://catalog.archives.gov/id/606622

Broman, Sarah. 'The collaborative perinatal project: an overview.' Handbook of longitudinal research 1 (1984): 185-227.

+
-

Examples

-
data(cpp_1yr) -head(cpp_1yr) -
#> subjid agedays wtkg htcm lencm bmi waz haz whz baz siteid sexn -#> 3 1 366 14.5 79 79 23.23346 3.84 1.35 4.02 3.89 5 1 -#> 6 2 366 8.4 73 73 15.76281 -1.27 -1.17 -0.96 -0.80 5 1 -#> 14 7 366 12.6 79 79 20.18907 2.46 1.35 2.38 2.21 5 1 -#> 18 8 366 11.3 81 81 17.22298 1.45 2.20 0.72 0.31 5 1 -#> 23 9 366 10.7 77 77 18.04689 1.43 1.15 1.28 1.10 5 2 -#> 30 11 366 9.0 78 78 14.79290 -0.64 0.93 -1.39 -1.63 5 1 -#> sex feedingn feeding gagebrth birthwt birthlen apgar1 -#> 3 Male 90 Unknown 287 4621 55 8 -#> 6 Male 90 Unknown 280 3345 51 8 -#> 14 Male 90 Unknown 287 3260 53 6 -#> 18 Male 2 Exclusively formula fed 287 3629 53 9 -#> 23 Female 2 Exclusively formula fed 287 3657 55 8 -#> 30 Male 90 Unknown 266 2835 51 9 -#> apgar5 mage mracen mrace mmaritn mmarit meducyrs sesn ses parity -#> 3 9 21 5 White 1 Married 12 50 Middle 1 -#> 6 9 15 5 White 1 Married NA NA . 0 -#> 14 7 19 5 White 1 Married 12 75 Upper 0 -#> 18 9 22 5 White 1 Married 12 63 Upper-middle 1 -#> 23 9 23 5 White 1 Married 12 63 Upper-middle 2 -#> 30 9 27 3 Black 1 Married NA NA . 0 -#> gravida smoked mcignum comprisk -#> 3 1 0 0 none -#> 6 0 1 35 none -#> 14 0 0 0 none -#> 18 1 0 0 none -#> 23 2 0 0 none -#> 30 0 0 0
table(cpp_1yr[["agedays"]]) -
#> -#> 366 -#> 428
# -
+
+

Examples

+
data(cpp_1yr)
+head(cpp_1yr)
+#>    subjid agedays wtkg htcm lencm      bmi   waz   haz   whz   baz siteid sexn
+#> 3       1     366 14.5   79    79 23.23346  3.84  1.35  4.02  3.89      5    1
+#> 6       2     366  8.4   73    73 15.76281 -1.27 -1.17 -0.96 -0.80      5    1
+#> 14      7     366 12.6   79    79 20.18907  2.46  1.35  2.38  2.21      5    1
+#> 18      8     366 11.3   81    81 17.22298  1.45  2.20  0.72  0.31      5    1
+#> 23      9     366 10.7   77    77 18.04689  1.43  1.15  1.28  1.10      5    2
+#> 30     11     366  9.0   78    78 14.79290 -0.64  0.93 -1.39 -1.63      5    1
+#>       sex feedingn                 feeding gagebrth birthwt birthlen apgar1
+#> 3    Male       90                 Unknown      287    4621       55      8
+#> 6    Male       90                 Unknown      280    3345       51      8
+#> 14   Male       90                 Unknown      287    3260       53      6
+#> 18   Male        2 Exclusively formula fed      287    3629       53      9
+#> 23 Female        2 Exclusively formula fed      287    3657       55      8
+#> 30   Male       90                 Unknown      266    2835       51      9
+#>    apgar5 mage mracen mrace mmaritn  mmarit meducyrs sesn          ses parity
+#> 3       9   21      5 White       1 Married       12   50       Middle      1
+#> 6       9   15      5 White       1 Married       NA   NA            .      0
+#> 14      7   19      5 White       1 Married       12   75        Upper      0
+#> 18      9   22      5 White       1 Married       12   63 Upper-middle      1
+#> 23      9   23      5 White       1 Married       12   63 Upper-middle      2
+#> 30      9   27      3 Black       1 Married       NA   NA            .      0
+#>    gravida smoked mcignum comprisk
+#> 3        1      0       0     none
+#> 6        0      1      35     none
+#> 14       0      0       0     none
+#> 18       1      0       0     none
+#> 23       2      0       0     none
+#> 30       0      0       0         
+table(cpp_1yr[["agedays"]])
+#> 
+#> 366 
+#> 428 
+#
+
+
+
-
- +
- - + + diff --git a/docs/reference/cv_helpers.html b/docs/reference/cv_helpers.html index d3ff2428..522b0988 100644 --- a/docs/reference/cv_helpers.html +++ b/docs/reference/cv_helpers.html @@ -1,89 +1,30 @@ - - - - - - - -Subset Tasks for CV +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Subset Tasks for CV THe functions use origami folds to subset tasks. These functions are used by Lrnr_cv (and therefore other learners that use Lrnr_cv). So that nested cv works properly, currently the subsetted task objects do not have fold structures of their own, and so generate them from -defaults if nested cv is requested. — train_task • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - -
-
- -
- -
+
@@ -168,49 +100,41 @@

Subset Tasks for CV defaults if nested cv is requested.

-
train_task(task, fold)
-
-validation_task(task, fold)
+
+
train_task(task, fold)
 
-    

Arguments

- - - - - - - - - - -
task

a task to subset

fold

an origami fold object to use for subsetting

+validation_task(task, fold)
+
+
+

Arguments

+
task
+

a task to subset

+
fold
+

an origami fold object to use for subsetting

+
+
-
- +
- - + + diff --git a/docs/reference/cv_risk.html b/docs/reference/cv_risk.html index c4a312cd..3ecb4556 100644 --- a/docs/reference/cv_risk.html +++ b/docs/reference/cv_risk.html @@ -1,78 +1,19 @@ - - - - - - - -Cross-validated Risk Estimation — cv_risk • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Cross-validated Risk Estimation — cv_risk • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -150,52 +82,42 @@

Cross-validated Risk Estimation

function, which can be either a loss or a risk function.

-
cv_risk(learner, eval_fun = NULL, coefs = NULL)
- -

Arguments

- - - - - - - - - - - - - - -
learner

A trained learner object.

eval_fun

A valid loss or risk function. See -loss_functions and risk_functions.

coefs

A numeric vector of coefficients.

+
+
cv_risk(learner, eval_fun = NULL, coefs = NULL)
+
+
+

Arguments

+
learner
+

A trained learner object.

+
eval_fun
+

A valid loss or risk function. See +loss_functions and risk_functions.

+
coefs
+

A numeric vector of coefficients.

+
+
-
- +
- - + + diff --git a/docs/reference/debug_helpers.html b/docs/reference/debug_helpers.html index 342cca02..d4e5b899 100644 --- a/docs/reference/debug_helpers.html +++ b/docs/reference/debug_helpers.html @@ -1,77 +1,18 @@ - - - - - - - -Helper functions to debug sl3 Learners — debug_train • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Helper functions to debug sl3 Learners — debug_train • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,61 +80,51 @@

Helper functions to debug sl3 Learners

Helper functions to debug sl3 Learners

-
debug_train(learner, once = FALSE)
-
-debugonce_train(learner)
+    
+
debug_train(learner, once = FALSE)
 
-debug_predict(learner, once = FALSE)
+debugonce_train(learner)
 
-debugonce_predict(learner)
+debug_predict(learner, once = FALSE)
 
-sl3_debug_mode(enabled = TRUE)
+debugonce_predict(learner)
 
-undebug_learner(learner)
+sl3_debug_mode(enabled = TRUE) -

Arguments

- - - - - - - - - - - - - - -
learner

the learner to debug

once

if true, use debugonce instead of debug

enabled

enable/disable the use of future (debugging is easier without futures)

+undebug_learner(learner)
+
+
+

Arguments

+
learner
+

the learner to debug

+
once
+

if true, use debugonce instead of debug

+
enabled
+

enable/disable the use of future (debugging is easier without futures)

+
+ -
- +
- - + + diff --git a/docs/reference/default_metalearner.html b/docs/reference/default_metalearner.html index 998eae0f..d6a9883e 100644 --- a/docs/reference/default_metalearner.html +++ b/docs/reference/default_metalearner.html @@ -1,79 +1,20 @@ - - - - - - - -Automatically Defined Metalearner — default_metalearner • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Automatically Defined Metalearner — default_metalearner • sl3 - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
-

A sensible metalearner based on Lrnr_solnp is chosen based on +

A sensible metalearner based on Lrnr_solnp is chosen based on outcome type. This amounts to choosing an appropriate loss function and combination function.

-
default_metalearner(outcome_type)
- -

Arguments

- - - - - - -
outcome_type

a Variable_Type object

- -

Details

+
+
default_metalearner(outcome_type)
+
+
+

Arguments

+
outcome_type
+

a Variable_Type object

+
+
+

Details

- - - - - - -
Outcome TypeCombination FunctionLoss Function
binomialmetalearner_logistic_binomialloss_squared_error
categoricalmetalearner_linear_multinomialloss_loglik_multinomial
continuousmetalearner_linearloss_squared_error
multivariatemetalearner_linear_multivariateloss_squared_error_multivariate
- - +
Outcome TypeCombination FunctionLoss Function
binomialmetalearner_logistic_binomialloss_squared_error
categoricalmetalearner_linear_multinomialloss_loglik_multinomial
continuousmetalearner_linearloss_squared_error
multivariatemetalearner_linear_multivariateloss_squared_error_multivariate
+
-
- +
- - + + diff --git a/docs/reference/density_dat.html b/docs/reference/density_dat.html index b754e9b0..83d732d6 100644 --- a/docs/reference/density_dat.html +++ b/docs/reference/density_dat.html @@ -1,78 +1,19 @@ - - - - - - - -Simulated data with continuous exposure — density_dat • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simulated data with continuous exposure — density_dat • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,46 +82,46 @@

Simulated data with continuous exposure

density estimation.

-
data(density_dat)
- +
+
data(density_dat)
+
-

Examples

-
data(density_dat) -head(density_dat) -
#> ID W1 W2 W3 sA.mu sA like.sA -#> 1 1 1 0 1 1.31 1.1353774 0.3929059 -#> 2 2 1 1 0 1.56 0.8893833 0.3186054 -#> 3 3 1 0 0 0.98 1.4874258 0.3507509 -#> 4 4 1 0 1 1.31 2.5574343 0.1832352 -#> 5 5 0 0 0 0.00 -1.2482755 0.1830430 -#> 6 6 0 0 1 0.33 -1.6047187 0.0613901
# -
+
+

Examples

+
data(density_dat)
+head(density_dat)
+#>   ID W1 W2 W3 sA.mu         sA   like.sA
+#> 1  1  1  0  1  1.31  1.1353774 0.3929059
+#> 2  2  1  1  0  1.56  0.8893833 0.3186054
+#> 3  3  1  0  0  0.98  1.4874258 0.3507509
+#> 4  4  1  0  1  1.31  2.5574343 0.1832352
+#> 5  5  0  0  0  0.00 -1.2482755 0.1830430
+#> 6  6  0  0  1  0.33 -1.6047187 0.0613901
+#
+
+
+
-
- +
- - + + diff --git a/docs/reference/drop_offsets_chain.html b/docs/reference/drop_offsets_chain.html index 405c3ea1..0b6c5deb 100644 --- a/docs/reference/drop_offsets_chain.html +++ b/docs/reference/drop_offsets_chain.html @@ -1,79 +1,20 @@ - - - - - - - -Chain while dropping offsets — drop_offsets_chain • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Chain while dropping offsets — drop_offsets_chain • sl3 - - - - - - - - - - - - - - - + + - - -
-
- -
- -
+
@@ -152,43 +84,37 @@

Chain while dropping offsets

USE ONLY.

-
drop_offsets_chain(learner, task)
- -

Arguments

- - - - - - -
task

An object of class sl3_Task.

+
+
drop_offsets_chain(learner, task)
+
+
+

Arguments

+
task
+

An object of class sl3_Task.

+
+
-
- +
- - + + diff --git a/docs/reference/factors_to_indicators.html b/docs/reference/factors_to_indicators.html index 8eb06026..9b9bec51 100644 --- a/docs/reference/factors_to_indicators.html +++ b/docs/reference/factors_to_indicators.html @@ -1,78 +1,19 @@ - - - - - - - -Convert Factors to indicators — factor_to_indicators • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Convert Factors to indicators — factor_to_indicators • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,53 +82,43 @@

Convert Factors to indicators

Replicates the functionality of model.matrix, but faster

-
factor_to_indicators(x, ind_ref_mat = NULL)
-
-dt_expand_factors(dt)
+
+
factor_to_indicators(x, ind_ref_mat = NULL)
 
-    

Arguments

- - - - - - - - - - - - - - -
x

the factor to expand

ind_ref_mat

a matrix used for expansion, if NULL generated automatically

dt

the dt to expand

+dt_expand_factors(dt)
+
+
+

Arguments

+
x
+

the factor to expand

+
ind_ref_mat
+

a matrix used for expansion, if NULL generated automatically

+
dt
+

the dt to expand

+
+
-
- +
- - + + diff --git a/docs/reference/importance.html b/docs/reference/importance.html index 02a363fb..f7e41f2a 100644 --- a/docs/reference/importance.html +++ b/docs/reference/importance.html @@ -1,93 +1,35 @@ - - - - - - - -Importance +<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Importance Extract variable importance measures produced by randomForest and order in decreasing order of -importance. — importance • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + -
-
- -
- -
+
-

Function that takes a cross-validated fit (i.e., cross-validated learner that -has already been trained on a task), which could be a cross-validated single -learner or super learner, and generates a risk-based variable importance -score for either each covariate or each group of covariates in the task. -This function outputs a data.table, where each row corresponds to the -risk difference or the risk ratio between the following two risks: the risk -when a covariate (or group of covariates) is permuted or removed, and the -original risk (i.e., when all covariates are included as they were in the -observed data). A higher risk ratio/difference corresponds to a more -important covariate/group. A plot can be generated from the returned -data.table by calling companion function importance_plot.

+

Function that takes a cross-validated fit (i.e., cross-validated learner +that has already been trained on a task), which could be a cross-validated +single learner or super learner, and generates a risk-based variable +importance score for either each covariate or each group of covariates in +the task. This function outputs a data.table, where each row +corresponds to the risk difference or the risk ratio between the following +two risks: the risk when a covariate (or group of covariates) is permuted or +removed, and the original risk (i.e., when all covariates are included as +they were in the observed data). A higher risk ratio/difference corresponds +to a more important covariate/group. A plot can be generated from the +returned data.table by calling companion function +importance_plot.

-
importance(fit, eval_fun = NULL, fold_number = "validation",
-  type = c("remove", "permute"), importance_metric = c("difference",
-  "ratio"), covariate_groups = NULL)
-
-importance(fit, eval_fun = NULL, fold_number = "validation",
-  type = c("remove", "permute"), importance_metric = c("difference",
-  "ratio"), covariate_groups = NULL)
- -

Arguments

- - - - - - -
type

either 1 or 2, specifying the type of importance measure (1=mean -decrease in accuracy, 2=mean decrease in node impurity).

- -

Value

- -

A data.table of variable importance for each covariate.

-

Parameters

+
+
importance(fit, eval_fun = NULL, fold_number = "validation",
+  type = c("remove", "permute"), importance_metric = c("difference",
+  "ratio"), covariate_groups = NULL)
 
-    
+importance(fit, eval_fun = NULL, fold_number = "validation",
+  type = c("remove", "permute"), importance_metric = c("difference",
+  "ratio"), covariate_groups = NULL)
+
-
    -
  • fit: A trained cross-validated (CV) learner (such as a CV stack -or super learner), from which cross-validated predictions can be -generated.

  • -
  • eval_fun = NULL: The evaluation function (risk or loss function) -for evaluating the risk. Defaults vary based on the outcome type, -matching defaults in default_metalearner. See -loss_functions and risk_functions for -options.

  • -
  • fold_number: The fold number to use for obtaining the predictions -from the fit. Either a positive integer for obtaining predictions from -a specific fold's fit; "full" for obtaining predictions from a -fit on all of the data, or "validation" (default) for obtaining +

    +

    Arguments

    +
    fit
    +

    A trained cross-validated (CV) learner (such as a CV stack or +super learner), from which cross-validated predictions can be generated.

    +
    eval_fun
    +

    The evaluation function (risk or loss function) for +evaluating the risk. Defaults vary based on the outcome type, matching +defaults in default_metalearner. See +loss_functions and risk_functions for options. +Default is NULL.

    +
    fold_number
    +

    The fold number to use for obtaining the predictions from +the fit. Either a positive integer for obtaining predictions from a +specific fold's fit; "full" for obtaining predictions from a fit on +all of the data, or "validation" (default) for obtaining cross-validated predictions, where the data used for training and -prediction never overlaps across the folds. Note that if a positive -integer or "full" is supplied here then there will be overlap -between the data used for training and validation, so -fold_number ="validation" is recommended.

  • -
  • type: Which method should be used to obscure the relationship -between each covariate / covariate group and the outcome? When -type is "remove" (default), each covariate / covariate -group is removed one at a time from the task; the cross-validated -learner is refit to this modified task; and finally, predictions are -obtained from this refit. When type is "permute", each -covariate / covariate group is permuted (sampled without replacement) -one at a time, and then predictions are obtained from this modified -data.

  • -
  • importance_metric: Either "ratio" or "difference" -(default). For each covariate / covariate group, "ratio" -returns the risk of the permuted/removed covariate / covariate group -divided by observed/original risk (i.e., the risk with all covariates -as they existed in the sample) and "difference" returns the -difference between the risk with the permuted/removed covariate / -covariate group and the observed risk.

  • -
  • covariate_groups: Optional named list covariate groups which will +prediction never overlaps across the folds. Note that if a positive integer +or "full" is supplied here then there will be overlap between the +data used for training and validation, so fold_number ="validation" +is recommended.

    +
    type
    +

    Which method should be used to obscure the relationship between +each covariate / covariate group and the outcome? When type is +"remove" (default), each covariate / covariate group is removed one +at a time from the task; the cross-validated learner is refit to this +modified task; and finally, predictions are obtained from this refit. When +type is "permute", each covariate / covariate group is +permuted (sampled without replacement) one at a time, and then predictions +are obtained from this modified data.

    +
    importance_metric
    +

    Either "ratio" or "difference" +(default). For each covariate / covariate group, "ratio" returns the +risk of the permuted/removed covariate / covariate group divided by +observed/original risk (i.e., the risk with all covariates as they existed +in the sample) and "difference" returns the difference between the +risk with the permuted/removed covariate / covariate group and the observed +risk.

    +
    covariate_groups
    +

    Optional named list covariate groups which will invoke variable importance evaluation at the group-level, by -removing/permuting all covariates in the same group together. If -covariates in the task are not specified in the list of groups, then -those covariates will be added as additional single-covariate groups.

  • -
- - -

Examples

-
# define ML task -data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") - -# build relatively fast learner library (not recommended for real analysis) -lasso_lrnr <- Lrnr_glmnet$new() -glm_lrnr <- Lrnr_glm$new() -ranger_lrnr <- Lrnr_ranger$new() -lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr) -names(lrnrs) <- c("lasso", "glm", "ranger") -lrnr_stack <- make_learner(Stack, lrnrs) - -# instantiate SL with default metalearner -sl <- Lrnr_sl$new(lrnr_stack) -sl_fit <- sl$train(task) +removing/permuting all covariates in the same group together. If covariates +in the task are not specified in the list of groups, then those covariates +will be added as additional single-covariate groups.

+
+
+

Value

+

A data.table of variable importance for each covariate.

+
-importance_result <- importance(sl_fit) -importance_result -
#> covariate MSE_difference -#> 1: mage 0.042068515 -#> 2: meducyrs 0.030364012 -#> 3: gagebrth 0.027932527 -#> 4: parity 0.011838647 -#> 5: apgar1 0.007700316 -#> 6: apgar5 -0.005016752
-# importance with groups of covariates -groups <- list( - scores = c("apgar1", "apgar5"), - maternal = c("parity", "mage", "meducyrs") -) -importance_result_groups <- importance(sl_fit, covariate_groups = groups) -importance_result_groups -
#> covariate_group MSE_difference -#> 1: scores 7.21635410 -#> 2: maternal 0.14856504 -#> 3: gagebrth 0.02746983
+
+

Examples

+
# define ML task
+data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# build relatively fast learner library (not recommended for real analysis)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr)
+names(lrnrs) <- c("lasso", "glm", "ranger")
+lrnr_stack <- make_learner(Stack, lrnrs)
+
+# instantiate SL with default metalearner
+sl <- Lrnr_sl$new(lrnr_stack)
+sl_fit <- sl$train(task)
+
+importance_result <- importance(sl_fit)
+importance_result
+#>    covariate MSE_difference
+#> 1:      mage    0.037359716
+#> 2:  meducyrs    0.025972615
+#> 3:  gagebrth    0.025055637
+#> 4:    parity    0.014997018
+#> 5:    apgar1    0.011974978
+#> 6:    apgar5    0.002613177
+
+# importance with groups of covariates
+groups <- list(
+  scores = c("apgar1", "apgar5"),
+  maternal = c("parity", "mage", "meducyrs")
+)
+importance_result_groups <- importance(sl_fit, covariate_groups = groups)
+importance_result_groups
+#>    covariate_group MSE_difference
+#> 1:          scores    10.62103170
+#> 2:        maternal     0.13109238
+#> 3:        gagebrth     0.02414671
+
+
+
-
- +
- - + + diff --git a/docs/reference/importance_plot-1.png b/docs/reference/importance_plot-1.png index c9c4f93daa2571a2cabbfe54ebbee57f1cdb9462..365a1d8069420fd0182f3bd91cd46a372fc50862 100644 GIT binary patch literal 35198 zcmeEvc|6v6`>&?$X_{(Gi;`v97sW_OwwlPOBq7OGDT)xXZ%xg#2}Nb62-%Z;y=w{~ zgpj?g+4tpk<38`p^epF`-#NeM_j*0QKhEns&ugAnO%wO``&q8*dN0@I_OYW1OTOj) zmV<+1iQ+GE$2mCW+j4NsJ^Pmh_>;OvPX_SIg0qJeT5OMU;wM`dqdvCB?_x^j%-#^F=ePgj(?ak?Hht%Rk-kGpx z2J&S@e)2AU*C-P6ndvCi{<+q{smd^WT-Vs?vTov-VMo~UNVVC=ySIl~tTX#NjwKsD z&8Oe}vUQFS{krexMYeP3H$NPDxtM;vckCNo`t|B>KMZ_BzuEZUDi{6w(UpTa~+(=!7--v zjqbDk^78Tz9zK-U)YN=>Jn~c>p8X`l+38)dtZdGBc7HBos)+IC-ns)J4&!}g;Y$8r zDk78}2VM2<)|qDRJP~{9VI_BeW`E9z&`_YHjr-8h(1LMwZEYTt+9btsakIv(9Vh&F zefhk!Kc+Xmc<~};ydfaoSb1v5n{gzV|MksfW_=bv4o2y!icTk8tk^s`*1L8~u%pG) zz)jh^;!Tc;jWS-lg7E4!l^N-auWn@J3ORFnYg;JBcDvrW6Y}iYR%bS=DPKHi&~4A> z-uqVNhu6`) zk!7Q0FVs$)2ro^|n-Z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v0Gc&W*7OF8gLu@1wq%`E{#Mp?u7dTO_?dTbps)otgc5mntJ@TW$0&pr z(@0trDKKFj+tb%7 diff --git a/docs/reference/importance_plot.html b/docs/reference/importance_plot.html index 18119eef..8427e179 100644 --- a/docs/reference/importance_plot.html +++ b/docs/reference/importance_plot.html @@ -1,77 +1,18 @@ - - - - - - - -Variable Importance Plot — importance_plot • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Variable Importance Plot — importance_plot • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,70 +80,69 @@

Variable Importance Plot

Variable Importance Plot

-
importance_plot(x, nvar = min(30, nrow(x)))
- - -

Value

- -

A ggplot of variable importance.

-

Parameters

+
+
importance_plot(x, nvar = min(30, nrow(x)))
+
- +
+

Arguments

+
x
+

The two-column data.table returned by +importance, where the first column is the covariate/groups +and the second column is the importance score.

+
nvar
+

The maximum number of predictors to be plotted. Defaults to the +minimum between 30 and the number of rows in x.

+
+
+

Value

+

A ggplot of variable importance.

+
-
    -
  • x: The 2-column data.table returned by -importance, where the first column is the -covariate/groups and the second column is the importance score.

  • -
  • nvar: The maximum number of predictors to be plotted. Defaults to -the minimum between 30 and the number of rows in x.

  • -
- - -

Examples

-
# define ML task -data(cpp_imputed) -covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs") -task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz") - -# build relatively fast learner library (not recommended for real analysis) -lasso_lrnr <- Lrnr_glmnet$new() -glm_lrnr <- Lrnr_glm$new() -ranger_lrnr <- Lrnr_ranger$new() -lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr) -names(lrnrs) <- c("lasso", "glm", "ranger") -lrnr_stack <- make_learner(Stack, lrnrs) - -# instantiate SL with default metalearner -sl <- Lrnr_sl$new(lrnr_stack) -sl_fit <- sl$train(task) -importance_result <- importance(sl_fit) -importance_plot(importance_result) -
+
+

Examples

+
# define ML task
+data(cpp_imputed)
+covs <- c("apgar1", "apgar5", "parity", "gagebrth", "mage", "meducyrs")
+task <- sl3_Task$new(cpp_imputed, covariates = covs, outcome = "haz")
+
+# build relatively fast learner library (not recommended for real analysis)
+lasso_lrnr <- Lrnr_glmnet$new()
+glm_lrnr <- Lrnr_glm$new()
+ranger_lrnr <- Lrnr_ranger$new()
+lrnrs <- c(lasso_lrnr, glm_lrnr, ranger_lrnr)
+names(lrnrs) <- c("lasso", "glm", "ranger")
+lrnr_stack <- make_learner(Stack, lrnrs)
+
+# instantiate SL with default metalearner
+sl <- Lrnr_sl$new(lrnr_stack)
+sl_fit <- sl$train(task)
+importance_result <- importance(sl_fit)
+importance_plot(importance_result)
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index e0818d65..13c138a8 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,76 +1,18 @@ - - - - - - - -Function reference • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • sl3 - - - - - - - - + + -
-
- -
- -
+
- - - - - - - - - - -
-

Defining A Task

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+

Defining A Task

+

make_sl3_Task()

Define a Machine Learning Task

+

variable_type()

Specify Variable Type

-

Finding Learners

+
+

Finding Learners

+

sl3_list_properties() sl3_list_learners()

List sl3 Learners

-

sl3 Learners

+
+

sl3 Learners

+

Lrnr_HarmonicReg

Harmonic Regression

+

Lrnr_arima

Univariate ARIMA Models

+

Lrnr_bartMachine

bartMachine: Bayesian Additive Regression Trees (BART)

+

make_learner()

Base Class for all sl3 Learners

+

Lrnr_bayesglm

Bayesian Generalized Linear Models

+

Lrnr_bilstm

Bidirectional Long short-term memory Recurrent Neural Network (LSTM)

+

Lrnr_bound

Bound Predictions

+

Lrnr_caret

Wrapping Learner for Package Caret

+

Lrnr_cv

Fit/Predict a learner with Cross Validation

+

Lrnr_cv_selector

Cross-Validated Selector

+

Lrnr_dbarts

Discrete Bayesian Additive Regression Tree sampler

+

Lrnr_define_interactions

Define interactions terms

+

Lrnr_density_discretize

Density from Classification

+

Lrnr_density_hse

Density Estimation With Mean Model and Homoscedastic Errors

+

Lrnr_density_semiparametric

Density Estimation With Mean Model and Homoscedastic Errors

+

Lrnr_earth

Earth: Multivariate Adaptive Regression Splines

+

Lrnr_expSmooth

Exponential Smoothing state space model

+

Lrnr_ga

Nonlinear Optimization via Genetic Algorithm (GA)

+

Lrnr_gam

GAM: Generalized Additive Models

+

Lrnr_gbm

GBM: Generalized Boosted Regression Models

+

Lrnr_glm

Generalized Linear Models

+

Lrnr_glm_fast

Computationally Efficient Generalized Linear Model (GLM) Fitting

+

Lrnr_glmnet

GLMs with Elastic Net Regularization

+

Lrnr_grf

Generalized Random Forests Learner

+

Lrnr_gru_keras

Recurrent Neural Network with Gated Recurrent Unit (GRU) with Keras

+

Lrnr_gts

Grouped Time-Series Forecasting

+

define_h2o_X()

h2o Model Definition

+

Lrnr_h2o_grid

Grid Search Models with h2o

+

Lrnr_hal9001

Scalable Highly Adaptive Lasso (HAL)

+

Lrnr_haldensify

Conditional Density Estimation with the Highly Adaptive LASSO

+

Lrnr_hts

Hierarchical Time-Series Forecasting

+

Lrnr_independent_binomial

Classification from Binomial Regression

+

Lrnr_lightgbm

LightGBM: Light Gradient Boosting Machine

+

Lrnr_lstm_keras

Long short-term memory Recurrent Neural Network (LSTM) with Keras

+

Lrnr_mean

Fitting Intercept Models

+

Lrnr_multiple_ts

Stratify univariable time-series learners by time-series

+

Lrnr_multivariate

Multivariate Learner

+

Lrnr_nnet

Feed-Forward Neural Networks and Multinomial Log-Linear Models

+

Lrnr_nnls

Non-negative Linear Least Squares

+

Lrnr_optim

Optimize Metalearner according to Loss Function using optim

+

Lrnr_pca

Principal Component Analysis and Regression

+

Lrnr_polspline

Polyspline - multivariate adaptive polynomial spline regression (polymars) and polychotomous regression and multiple classification (polyclass)

+

Lrnr_pooled_hazards

Classification from Pooled Hazards

+

Lrnr_randomForest

Random Forests

+

Lrnr_ranger

Ranger: Fast(er) Random Forests

+

Lrnr_revere_task

Learner that chains into a revere task

+

Lrnr_rpart

Learner for Recursive Partitioning and Regression Trees.

+

Lrnr_rugarch

Univariate GARCH Models

+

Lrnr_screener_augment

Augmented Covariate Screener

+

Lrnr_screener_coefs

Coefficient Magnitude Screener

+

Lrnr_screener_correlation

Correlation Screening Procedures

+

Lrnr_screener_importance

Variable Importance Screener

+

Lrnr_sl

The Super Learner Algorithm

+

Lrnr_solnp

Nonlinear Optimization via Augmented Lagrange

+

Lrnr_solnp_density

Nonlinear Optimization via Augmented Lagrange

+

Lrnr_stratified

Stratify learner fits by a single variable

+

Lrnr_subset_covariates

Learner with Covariate Subsetting

+

Lrnr_svm

Support Vector Machines

+

Lrnr_tsDyn

Nonlinear Time Series Analysis

+

Lrnr_ts_weights

Time-specific weighting of prediction losses

+

Lrnr_xgboost

xgboost: eXtreme Gradient Boosting

+

Lrnr_pkg_SuperLearner

Use SuperLearner Wrappers, Screeners, and Methods, in sl3

-

Composing Learners

+
+

Composing Learners

+

Pipeline

Pipeline (chain) of learners.

+

Stack

Learner Stacking

+

customize_chain()

Customize chaining for a learner

-

Loss functions

+
+

Loss functions

+

loss_squared_error() loss_loglik_true_cat() loss_loglik_binomial() loss_loglik_multinomial() loss_squared_error_multivariate()

Loss Function Definitions

+

risk()

Risk Estimation

-

Metalearner functions

+
+

Metalearner functions

+

metalearner_logistic_binomial() metalearner_linear() metalearner_linear_multivariate() metalearner_linear_multinomial()

Combine predictions from multiple learners

-

Helpful for Defining Learners

+
+

Helpful for Defining Learners

+

write_learner_template()

Generate a file containing a template sl3 Learner

+

args_to_list()

Get all arguments of parent call (both specified and defaults) as list

+

call_with_args()

Call with filtered argument list

+

true_obj_size()

Estimate object size using serialization

+

safe_dim()

dim that works for vectors too

+

delayed_make_learner() learner_train() delayed_learner_train() learner_fit_predict() delayed_learner_fit_predict() learner_fit_chain() delayed_learner_fit_chain() learner_subset_covariates() learner_process_formula() delayed_learner_subset_covariates() delayed_learner_process_formula()

Learner helpers

-

Sample Datasets

+
+

Sample Datasets

+

cpp cpp_imputed

Subset of growth data from the collaborative perinatal project (CPP)

+

cpp_1yr

Subset of growth data from the collaborative perinatal project (CPP)

+

bsds

Bicycle sharing time series dataset

+

density_dat

Simulated data with continuous exposure

-

Miscellaneous

+
+

Miscellaneous

+

sl3Options()

Querying/setting a single sl3 option

-

Index

+
+

Index

+

CV_lrnr_sl()

Estimates cross-validated risk of the Super Learner

+

customize_chain()

Customize chaining for a learner

+

Lrnr_HarmonicReg

Harmonic Regression

+

Lrnr_arima

Univariate ARIMA Models

+

Lrnr_bartMachine

bartMachine: Bayesian Additive Regression Trees (BART)

+

make_learner()

Base Class for all sl3 Learners

+

Lrnr_bayesglm

Bayesian Generalized Linear Models

+

Lrnr_bilstm

Bidirectional Long short-term memory Recurrent Neural Network (LSTM)

+

Lrnr_bound

Bound Predictions

+

Lrnr_caret

Wrapping Learner for Package Caret

+

Lrnr_cv

Fit/Predict a learner with Cross Validation

+

Lrnr_cv_selector

Cross-Validated Selector

+

Lrnr_dbarts

Discrete Bayesian Additive Regression Tree sampler

+

Lrnr_define_interactions

Define interactions terms

+

Lrnr_density_discretize

Density from Classification

+

Lrnr_density_hse

Density Estimation With Mean Model and Homoscedastic Errors

+

Lrnr_density_semiparametric

Density Estimation With Mean Model and Homoscedastic Errors

+

Lrnr_earth

Earth: Multivariate Adaptive Regression Splines

+

Lrnr_expSmooth

Exponential Smoothing state space model

+

Lrnr_ga

Nonlinear Optimization via Genetic Algorithm (GA)

+

Lrnr_gam

GAM: Generalized Additive Models

+

Lrnr_gbm

GBM: Generalized Boosted Regression Models

+

Lrnr_glm

Generalized Linear Models

+

Lrnr_glm_fast

Computationally Efficient Generalized Linear Model (GLM) Fitting

+

Lrnr_glmnet

GLMs with Elastic Net Regularization

+

Lrnr_grf

Generalized Random Forests Learner

+

Lrnr_gru_keras

Recurrent Neural Network with Gated Recurrent Unit (GRU) with Keras

+

Lrnr_gts

Grouped Time-Series Forecasting

+

define_h2o_X()

h2o Model Definition

+

Lrnr_h2o_grid

Grid Search Models with h2o

+

Lrnr_hal9001

Scalable Highly Adaptive Lasso (HAL)

+

Lrnr_haldensify

Conditional Density Estimation with the Highly Adaptive LASSO

+

Lrnr_hts

Hierarchical Time-Series Forecasting

+

Lrnr_independent_binomial

Classification from Binomial Regression

+

Lrnr_lightgbm

LightGBM: Light Gradient Boosting Machine

+

Lrnr_lstm_keras

Long short-term memory Recurrent Neural Network (LSTM) with Keras

+

Lrnr_mean

Fitting Intercept Models

+

Lrnr_multiple_ts

Stratify univariable time-series learners by time-series

+

Lrnr_multivariate

Multivariate Learner

+

Lrnr_nnet

Feed-Forward Neural Networks and Multinomial Log-Linear Models

+

Lrnr_nnls

Non-negative Linear Least Squares

+

Lrnr_optim

Optimize Metalearner according to Loss Function using optim

+

Lrnr_pca

Principal Component Analysis and Regression

+

Lrnr_polspline

Polyspline - multivariate adaptive polynomial spline regression (polymars) and polychotomous regression and multiple classification (polyclass)

+

Lrnr_pooled_hazards

Classification from Pooled Hazards

+

Lrnr_randomForest

Random Forests

+

Lrnr_ranger

Ranger: Fast(er) Random Forests

+

Lrnr_revere_task

Learner that chains into a revere task

+

Lrnr_rpart

Learner for Recursive Partitioning and Regression Trees.

+

Lrnr_rugarch

Univariate GARCH Models

+

Lrnr_screener_augment

Augmented Covariate Screener

+

Lrnr_screener_coefs

Coefficient Magnitude Screener

+

Lrnr_screener_correlation

Correlation Screening Procedures

+

Lrnr_screener_importance

Variable Importance Screener

+

Lrnr_sl

The Super Learner Algorithm

+

Lrnr_solnp

Nonlinear Optimization via Augmented Lagrange

+

Lrnr_solnp_density

Nonlinear Optimization via Augmented Lagrange

+

Lrnr_stratified

Stratify learner fits by a single variable

+

Lrnr_subset_covariates

Learner with Covariate Subsetting

+

Lrnr_svm

Support Vector Machines

+

Lrnr_tsDyn

Nonlinear Time Series Analysis

+

Lrnr_ts_weights

Time-specific weighting of prediction losses

+

Lrnr_xgboost

xgboost: eXtreme Gradient Boosting

+

Pipeline

Pipeline (chain) of learners.

+

Shared_Data

Container Class for data.table Shared Between Tasks

+

Stack

Learner Stacking

+

Lrnr_pkg_SuperLearner

Use SuperLearner Wrappers, Screeners, and Methods, in sl3

+

args_to_list()

Get all arguments of parent call (both specified and defaults) as list

+

bsds

Bicycle sharing time series dataset

+

cpp cpp_imputed

Subset of growth data from the collaborative perinatal project (CPP)

+

cpp_1yr

Subset of growth data from the collaborative perinatal project (CPP)

+

train_task() validation_task()

Subset Tasks for CV @@ -1208,200 +736,139 @@

+

cv_risk()

Cross-validated Risk Estimation

+

debug_train() debugonce_train() debug_predict() debugonce_predict() sl3_debug_mode() undebug_learner()

Helper functions to debug sl3 Learners

+

default_metalearner()

Automatically Defined Metalearner

+

density_dat

Simulated data with continuous exposure

+

factor_to_indicators() dt_expand_factors()

Convert Factors to indicators

+

importance() importance()

Importance Extract variable importance measures produced by -randomForest and order in decreasing order of +randomForest and order in decreasing order of importance.

+

importance_plot()

Variable Importance Plot

+

inverse_sample()

Inverse CDF Sampling

+

delayed_make_learner() learner_train() delayed_learner_train() learner_fit_predict() delayed_learner_fit_predict() learner_fit_chain() delayed_learner_fit_chain() learner_subset_covariates() learner_process_formula() delayed_learner_subset_covariates() delayed_learner_process_formula()

Learner helpers

+

sl3_list_properties() sl3_list_learners()

List sl3 Learners

+

loss_squared_error() loss_loglik_true_cat() loss_loglik_binomial() loss_loglik_multinomial() loss_squared_error_multivariate()

Loss Function Definitions

+

make_learner_stack()

Make a stack of sl3 learners

+

metalearner_logistic_binomial() metalearner_linear() metalearner_linear_multivariate() metalearner_linear_multinomial()

Combine predictions from multiple learners

+

pack_predictions() unpack_predictions()

Pack multidimensional predictions into a vector (and unpack again)

+

pooled_hazard_task()

Generate A Pooled Hazards Task from a Failure Time (or Categorical) Task

+

predict_classes()

Predict Class from Predicted Probabilities

+

prediction_plot()

Plot predicted and true values for diganostic purposes

+

risk()

Risk Estimation

+

custom_ROCR_risk()

FACTORY RISK FUNCTION FOR ROCR PERFORMANCE MEASURES WITH BINARY OUTCOMES

+

safe_dim()

dim that works for vectors too

+

sl3Options()

Querying/setting a single sl3 option

+

make_sl3_Task()

Define a Machine Learning Task

+

sl3_revere_Task

Revere (SplitSpecific) Task

+

subset_folds()

Make folds work on subset of data

+

undocumented_learner

Undocumented Learner

+

variable_type()

Specify Variable Type

+

write_learner_template()

Generate a file containing a template sl3 Learner

- +
+
-
- +
- - + + diff --git a/docs/reference/inverse_sample.html b/docs/reference/inverse_sample.html index 17ba43d1..1f847731 100644 --- a/docs/reference/inverse_sample.html +++ b/docs/reference/inverse_sample.html @@ -1,77 +1,18 @@ - - - - - - - -Inverse CDF Sampling — inverse_sample • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Inverse CDF Sampling — inverse_sample • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,52 +80,42 @@

Inverse CDF Sampling

Inverse CDF Sampling

-
inverse_sample(n_samples, cdf = NULL, pdf = NULL)
- -

Arguments

- - - - - - - - - - - - - - -
n_samples

If true, remove entries after failure time for each -observation.

cdf

A list with x and y representing the cdf

pdf

A list with x and y representing the pdf

+
+
inverse_sample(n_samples, cdf = NULL, pdf = NULL)
+
+
+

Arguments

+
n_samples
+

If true, remove entries after failure time for each +observation.

+
cdf
+

A list with x and y representing the cdf

+
pdf
+

A list with x and y representing the pdf

+
+
-
- +
- - + + diff --git a/docs/reference/keep_only_fun_args.html b/docs/reference/keep_only_fun_args.html index 25ff1e9b..5c67a0eb 100644 --- a/docs/reference/keep_only_fun_args.html +++ b/docs/reference/keep_only_fun_args.html @@ -1,78 +1,19 @@ - - - - - - - -Streamline Function Arguments — keep_only_fun_args • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Streamline Function Arguments — keep_only_fun_args • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,48 +82,40 @@

Streamline Function Arguments

only the arguments that belong to the function signature.

-
keep_only_fun_args(Args, fun)
- -

Arguments

- - - - - - - - - - -
Args

A list of function arguments to be streamlined.

fun

A function whose signature will be used to reduce the -arguments passed in.

+
+
keep_only_fun_args(Args, fun)
+
+
+

Arguments

+
Args
+

A list of function arguments to be streamlined.

+
fun
+

A function whose signature will be used to reduce the +arguments passed in.

+
+
-
- +
- - + + diff --git a/docs/reference/learner_helpers.html b/docs/reference/learner_helpers.html index 0d0c945d..d1cfe040 100644 --- a/docs/reference/learner_helpers.html +++ b/docs/reference/learner_helpers.html @@ -1,77 +1,18 @@ - - - - - - - -Learner helpers — delayed_make_learner • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Learner helpers — delayed_make_learner • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,88 +80,70 @@

Learner helpers

Learner helpers

-
delayed_make_learner(learner_class, ...)
-
-learner_train(learner, task, trained_sublearners)
+    
+
delayed_make_learner(learner_class, ...)
 
-delayed_learner_train(learner, task, name = NULL)
+learner_train(learner, task, trained_sublearners)
 
-learner_fit_predict(learner_fit, task = NULL)
+delayed_learner_train(learner, task, name = NULL)
 
-delayed_learner_fit_predict(learner_fit, task = NULL)
+learner_fit_predict(learner_fit, task = NULL)
 
-learner_fit_chain(learner_fit, task = NULL)
+delayed_learner_fit_predict(learner_fit, task = NULL)
 
-delayed_learner_fit_chain(learner_fit, task = NULL)
+learner_fit_chain(learner_fit, task = NULL)
 
-learner_subset_covariates(learner, task)
+delayed_learner_fit_chain(learner_fit, task = NULL)
 
-learner_process_formula(learner, task)
+learner_subset_covariates(learner, task)
 
-delayed_learner_subset_covariates(learner, task)
+learner_process_formula(learner, task)
 
-delayed_learner_process_formula(learner, task)
+delayed_learner_subset_covariates(learner, task) -

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
learner_class

The learner class to instantiate.

...

Parameters with which to instantiate the learner.

learner

A learner object to fit to the task.

task

The task on which to fit.

trained_sublearners

Any data obtained from a train_sublearners -step.

name

a more detailed name for this delayed task, if necessary

learner_fit

a learner object that has already been fit

+delayed_learner_process_formula(learner, task)
+
+
+

Arguments

+
learner_class
+

The learner class to instantiate.

+
...
+

Parameters with which to instantiate the learner.

+
learner
+

A learner object to fit to the task.

+
task
+

The task on which to fit.

+
trained_sublearners
+

Any data obtained from a train_sublearners +step.

+
name
+

a more detailed name for this delayed task, if necessary

+
learner_fit
+

a learner object that has already been fit

+
+ -
- +
- - + + diff --git a/docs/reference/list_learners.html b/docs/reference/list_learners.html index 80efc569..ba9bb3bf 100644 --- a/docs/reference/list_learners.html +++ b/docs/reference/list_learners.html @@ -1,78 +1,19 @@ - - - - - - - -List sl3 Learners — sl3_list_properties • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -List sl3 Learners — sl3_list_properties • sl3 - - - - - + + - - - -
-
- -
- -
+
@@ -150,48 +82,43 @@

List sl3 Learners

and inherit from Lrnr_base)

-
sl3_list_properties()
-
-sl3_list_learners(properties = c())
- -

Arguments

- - - - - - -
properties

a vector of properties that learners must match to be returned

+
+
sl3_list_properties()
 
-    

Value

+sl3_list_learners(properties = c())
+
+
+

Arguments

+
properties
+

a vector of properties that learners must match to be returned

+
+
+

Value

a vector of learner names that match the property list

+
+
-
- +
- - + + diff --git a/docs/reference/loss_functions.html b/docs/reference/loss_functions.html index 51f0904b..b1f3b886 100644 --- a/docs/reference/loss_functions.html +++ b/docs/reference/loss_functions.html @@ -1,77 +1,18 @@ - - - - - - - -Loss Function Definitions — loss_functions • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Loss Function Definitions — loss_functions • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,61 +80,55 @@

Loss Function Definitions

Loss functions for use in evaluating learner fits.

-
loss_squared_error(pred, observed)
+    
+
loss_squared_error(pred, observed)
 
-loss_loglik_true_cat(pred, observed)
+loss_loglik_true_cat(pred, observed)
 
-loss_loglik_binomial(pred, observed)
+loss_loglik_binomial(pred, observed)
 
-loss_loglik_multinomial(pred, observed)
+loss_loglik_multinomial(pred, observed)
 
-loss_squared_error_multivariate(pred, observed)
- -

Arguments

- - - - - - - - - - -
pred

A vector of predicted values

observed

A vector of observed values

- -

Value

+loss_squared_error_multivariate(pred, observed)
+
+
+

Arguments

+
pred
+

A vector of predicted values

+
observed
+

A vector of observed values

+
+
+

Value

A vector of loss values

-

Note

- +
+
+

Note

Assumes predicted probabilities are "packed" into a single vector.

+
+ -
- +
- - + + diff --git a/docs/reference/make_learner_stack.html b/docs/reference/make_learner_stack.html index 4a1d7afd..aa8a590d 100644 --- a/docs/reference/make_learner_stack.html +++ b/docs/reference/make_learner_stack.html @@ -1,78 +1,19 @@ - - - - - - - -Make a stack of sl3 learners — make_learner_stack • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Make a stack of sl3 learners — make_learner_stack • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,65 +82,62 @@

Make a stack of sl3 learners

The resultant stack of learners may then be used as normal.

-
make_learner_stack(...)
- -

Arguments

- - - - - - -
...

Each argument is a list that will be passed to -make_learner

- -

Value

+
+
make_learner_stack(...)
+
-

An sl3 Stack consisting of the learners passed in as +

+

Arguments

+
...
+

Each argument is a list that will be passed to +make_learner

+
+
+

Value

+

An sl3Stack consisting of the learners passed in as arguments the list argument to this function. This Stack has all of the standard methods associated with such objects.

+
-

Examples

-
# constructing learners with default settings -sl_stack_easy <- make_learner_stack( - "Lrnr_mean", "Lrnr_glm_fast", - "Lrnr_xgboost" -) - -# constructing learners with arguments passed in -sl_stack <- make_learner_stack( - "Lrnr_mean", - list("Lrnr_hal9001", - n_folds = 10, - use_min = TRUE - ) -) -
+
+

Examples

+
# constructing learners with default settings
+sl_stack_easy <- make_learner_stack(
+  "Lrnr_mean", "Lrnr_glm_fast",
+  "Lrnr_xgboost"
+)
+
+# constructing learners with arguments passed in
+sl_stack <- make_learner_stack(
+  "Lrnr_mean",
+  list("Lrnr_hal9001",
+    n_folds = 10,
+    use_min = TRUE
+  )
+)
+
+
+
-
- +
- - + + diff --git a/docs/reference/metalearners.html b/docs/reference/metalearners.html index 2bc4fb6e..c9c4089f 100644 --- a/docs/reference/metalearners.html +++ b/docs/reference/metalearners.html @@ -1,77 +1,18 @@ - - - - - - - -Combine predictions from multiple learners — metalearners • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Combine predictions from multiple learners — metalearners • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,57 +80,47 @@

Combine predictions from multiple learners

Combine predictions from multiple learners

-
metalearner_logistic_binomial(alpha, X, trim)
-
-metalearner_linear(alpha, X)
+    
+
metalearner_logistic_binomial(alpha, X, trim)
 
-metalearner_linear_multivariate(alpha, X)
+metalearner_linear(alpha, X)
 
-metalearner_linear_multinomial(alpha, X)
+metalearner_linear_multivariate(alpha, X) -

Arguments

- - - - - - - - - - - - - - -
alpha

a vector of combination coefficients

X

a matrix of predictions

trim

a value use to trim predictions away from 0 and 1.

+metalearner_linear_multinomial(alpha, X)
+
+
+

Arguments

+
alpha
+

a vector of combination coefficients

+
X
+

a matrix of predictions

+
trim
+

a value use to trim predictions away from 0 and 1.

+
+ -
- +
- - + + diff --git a/docs/reference/pack_predictions.html b/docs/reference/pack_predictions.html index 12e103aa..5b358ca3 100644 --- a/docs/reference/pack_predictions.html +++ b/docs/reference/pack_predictions.html @@ -1,77 +1,18 @@ - - - - - - - -Pack multidimensional predictions into a vector (and unpack again) — pack_predictions • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Pack multidimensional predictions into a vector (and unpack again) — pack_predictions • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,49 +80,41 @@

Pack multidimensional predictions into a vector (and unpack again)

Pack multidimensional predictions into a vector (and unpack again)

-
pack_predictions(pred_matrix)
-
-unpack_predictions(x)
+
+
pack_predictions(pred_matrix)
 
-    

Arguments

- - - - - - - - - - -
pred_matrix

a matrix of prediciton values

x

a packed prediction list

+unpack_predictions(x)
+
+
+

Arguments

+
pred_matrix
+

a matrix of prediciton values

+
x
+

a packed prediction list

+
+
-
- +
- - + + diff --git a/docs/reference/pooled_hazard_task.html b/docs/reference/pooled_hazard_task.html index b3a1fc33..f44098c7 100644 --- a/docs/reference/pooled_hazard_task.html +++ b/docs/reference/pooled_hazard_task.html @@ -1,77 +1,18 @@ - - - - - - - -Generate A Pooled Hazards Task from a Failure Time (or Categorical) Task — pooled_hazard_task • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Generate A Pooled Hazards Task from a Failure Time (or Categorical) Task — pooled_hazard_task • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -148,48 +80,40 @@

Generate A Pooled Hazards Task from a Failure Time (or Categorical) Task

Generate A Pooled Hazards Task from a Failure Time (or Categorical) Task

-
pooled_hazard_task(task, trim = TRUE)
- -

Arguments

- - - - - - - - - - -
task

A sl3_Task where the outcome is failure time.

trim

If true, remove entries after failure time for each -observation.

+
+
pooled_hazard_task(task, trim = TRUE)
+
+
+

Arguments

+
task
+

A sl3_Task where the outcome is failure time.

+
trim
+

If true, remove entries after failure time for each +observation.

+
+
-
- +
- - + + diff --git a/docs/reference/predict_classes.html b/docs/reference/predict_classes.html index ff6732a5..5dff9d70 100644 --- a/docs/reference/predict_classes.html +++ b/docs/reference/predict_classes.html @@ -1,78 +1,19 @@ - - - - - - - -Predict Class from Predicted Probabilities — predict_classes • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Predict Class from Predicted Probabilities — predict_classes • sl3 - - - - - + + - - - -
-
- -
- -
+
@@ -150,47 +82,42 @@

Predict Class from Predicted Probabilities

probabilities

-
predict_classes(predictions)
- -

Arguments

- - - - - - -
predictions

the nxc matrix where each row are predicted probabilities -for one observation for each of c classes.

- -

Value

+
+
predict_classes(predictions)
+
+
+

Arguments

+
predictions
+

the nxc matrix where each row are predicted probabilities +for one observation for each of c classes.

+
+
+

Value

a vector of length n, the predicted class labels as a factor variable

+
+
-
- +
- - + + diff --git a/docs/reference/prediction_plot.html b/docs/reference/prediction_plot.html index 07882b5a..ec380b7c 100644 --- a/docs/reference/prediction_plot.html +++ b/docs/reference/prediction_plot.html @@ -1,78 +1,19 @@ - - - - - - - -Plot predicted and true values for diganostic purposes — prediction_plot • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Plot predicted and true values for diganostic purposes — prediction_plot • sl3 - - - - - + + - - - -
-
- -
- -
+
@@ -150,46 +82,41 @@

Plot predicted and true values for diganostic purposes

Otherwise, non cross-validated predictions will be used an an error will be thrown

-
prediction_plot(learner_fit)
- -

Arguments

- - - - - - -
learner_fit

A fit sl3 learner object. Ideally from a Lrnr_sl

- -

Value

+
+
prediction_plot(learner_fit)
+
+
+

Arguments

+
learner_fit
+

A fit sl3 learner object. Ideally from a Lrnr_sl

+
+
+

Value

A ggplot2 object

+
+
-
- +
- - + + diff --git a/docs/reference/reduce_fit_test.html b/docs/reference/reduce_fit_test.html index 85737242..0df5cd1a 100644 --- a/docs/reference/reduce_fit_test.html +++ b/docs/reference/reduce_fit_test.html @@ -1,78 +1,19 @@ - - - - - - - -Drop components from learner fits — reduce_fit_test • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Drop components from learner fits — reduce_fit_test • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,44 +82,38 @@

Drop components from learner fits

keeping track of which components are needed for prediction.

-
reduce_fit_test(learner_fit)
- -

Arguments

- - - - - - -
learner_fit

A Lrnr_* object, inheriting from -Lrnr_base, that has been trained.

+
+
reduce_fit_test(learner_fit)
+
+
+

Arguments

+
learner_fit
+

A Lrnr_* object, inheriting from +Lrnr_base, that has been trained.

+
+
-
- +
- - + + diff --git a/docs/reference/replace_add_user_args.html b/docs/reference/replace_add_user_args.html index b6ce57a7..7383122e 100644 --- a/docs/reference/replace_add_user_args.html +++ b/docs/reference/replace_add_user_args.html @@ -1,78 +1,19 @@ - - - - - - - -Replace an argument in mainArgs if it also appears in userArgs — replace_add_user_args • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Replace an argument in mainArgs if it also appears in userArgs — replace_add_user_args • sl3 - - - - - - + + - - -
-
- -
- -
+
-

Add any argument from userArgs that appears in formals(fun) of +

Add any argument from userArgs that appears in formals(fun) of the function fun.

-
replace_add_user_args(mainArgs, userArgs, fun)
- +
+
replace_add_user_args(mainArgs, userArgs, fun)
+
+
-
- +
- - + + diff --git a/docs/reference/risk.html b/docs/reference/risk.html index 00e29b39..ccd3335b 100644 --- a/docs/reference/risk.html +++ b/docs/reference/risk.html @@ -1,77 +1,18 @@ - - - - - - - -Risk Estimation — risk • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Risk Estimation — risk • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,55 +80,43 @@

Risk Estimation

Estimates a risk for a given set of predictions and loss function.

-
risk(pred, observed, loss = loss_squared_error, weights = NULL)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
pred

A vector of predicted values.

observed

A vector of observed values.

loss

A loss function. For options, see loss_functions.

weights

A vector of weights.

+
+
risk(pred, observed, loss = loss_squared_error, weights = NULL)
+
+
+

Arguments

+
pred
+

A vector of predicted values.

+
observed
+

A vector of observed values.

+
loss
+

A loss function. For options, see loss_functions.

+
weights
+

A vector of weights.

+
+
-
- +
- - + + diff --git a/docs/reference/risk_functions.html b/docs/reference/risk_functions.html index f3884c75..4c8f346f 100644 --- a/docs/reference/risk_functions.html +++ b/docs/reference/risk_functions.html @@ -1,78 +1,19 @@ - - - - - - - -FACTORY RISK FUNCTION FOR ROCR PERFORMANCE MEASURES WITH BINARY OUTCOMES — risk_functions • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FACTORY RISK FUNCTION FOR ROCR PERFORMANCE MEASURES WITH BINARY OUTCOMES — risk_functions • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,79 +82,60 @@

FACTORY RISK FUNCTION FOR ROCR PERFORMANCE MEASURES WITH BINARY OUTCOMES

-
custom_ROCR_risk(measure, cutoff = 0.5, name = NULL, ...)
+
+
custom_ROCR_risk(measure, cutoff = 0.5, name = NULL, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
measure

A character indicating which ROCR performance measure +

+

Arguments

+
measure
+

A character indicating which ROCR performance measure to use for evaluation. The measure must be either cutoff-dependent so a single value can be selected (e.g., "tpr"), or it's value is a scalar -(e.g., "aucpr"). For more information, see performance.

cutoff

A numeric value specifying the cutoff for choosing a single -performance measure from the returned set. Only used for performance measures -that are cutoff-dependent and default is 0.5. See -performance for more detail.

name

An optional character string for user to supply their desired +(e.g., "aucpr"). For more information, see performance.

+
cutoff
+

A numeric value specifying the cutoff for choosing a single +performance measure from the returned set. Only used for performance +measures that are cutoff-dependent and default is 0.5. See +performance for more detail.

+
name
+

An optional character string for user to supply their desired name for the performance measure, which will be used for naming subsequent risk-related tables and metrics (e.g., cv_risk column names). When -name is not supplied, the measure will be used for naming.

...

Optional arguments to specific ROCR performance -measures. See performance for more detail.

pred

A vector of predicted values.

observed

A vector of binary observed values.

- -

Note

- +name is not supplied, the measure will be used for naming.

+
...
+

Optional arguments to specific ROCR performance +measures. See performance for more detail.

+
+
+

Note

This risk does not take into account weights. In order to use this risk, it must first be instantiated with respect to the ROCR performance measure of interest, and then the user-defined function can be used.

+
+
-
- +
- - + + diff --git a/docs/reference/safe_dim.html b/docs/reference/safe_dim.html index b54c273b..c2e2d87d 100644 --- a/docs/reference/safe_dim.html +++ b/docs/reference/safe_dim.html @@ -1,78 +1,19 @@ - - - - - - - -dim that works for vectors too — safe_dim • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -dim that works for vectors too — safe_dim • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,43 +82,37 @@

dim that works for vectors too

length if dim returns NULL

-
safe_dim(x)
- -

Arguments

- - - - - - -
x

the object to get dimensions from

+
+
safe_dim(x)
+
+
+

Arguments

+
x
+

the object to get dimensions from

+
+
-
- +
- - + + diff --git a/docs/reference/sl3Options.html b/docs/reference/sl3Options.html index 9e63961a..d44ad4d3 100644 --- a/docs/reference/sl3Options.html +++ b/docs/reference/sl3Options.html @@ -1,79 +1,20 @@ - - - - - - - -Querying/setting a single sl3 option — sl3Options • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Querying/setting a single sl3 option — sl3Options • sl3 - - - - - - - - - - - - - - - + + - - -
-
- -
- -
+
@@ -152,56 +84,50 @@

Querying/setting a single sl3 option

use the value parameter too.

-
sl3Options(o, value)
- -

Arguments

- - - - - - - - - - -
o

Option name (string).

value

Value to assign (optional)

- - -

Examples

-
if (FALSE) { -sl3Options() -sl3Options("sl3.verbose") -sl3Options("sl3.temp.dir") -sl3Options("sl3.verbose", TRUE) -} -# -
+
+
sl3Options(o, value)
+
+ +
+

Arguments

+
o
+

Option name (string).

+
value
+

Value to assign (optional)

+
+ +
+

Examples

+
if (FALSE) {
+sl3Options()
+sl3Options("sl3.verbose")
+sl3Options("sl3.temp.dir")
+sl3Options("sl3.verbose", TRUE)
+}
+#
+
+
+
-
- +
- - + + diff --git a/docs/reference/sl3_Task.html b/docs/reference/sl3_Task.html index 47635459..f48efb16 100644 --- a/docs/reference/sl3_Task.html +++ b/docs/reference/sl3_Task.html @@ -1,79 +1,20 @@ - - - - - - - -Define a Machine Learning Task — sl3_Task • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Define a Machine Learning Task — sl3_Task • sl3 - - - - - - - - - - - - - - - - - + + -
-
- +
- - + + diff --git a/docs/reference/sl3_revere_Task.html b/docs/reference/sl3_revere_Task.html index 9134e2d3..ea38e675 100644 --- a/docs/reference/sl3_revere_Task.html +++ b/docs/reference/sl3_revere_Task.html @@ -1,78 +1,19 @@ - - - - - - - -Revere (SplitSpecific) Task — sl3_revere_Task • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Revere (SplitSpecific) Task — sl3_revere_Task • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -151,37 +83,33 @@

Revere (SplitSpecific) Task

- -

Details

- +
+

Details

Learners with property "cv" must use these tasks correctly

Other learners will treat this as the equivalent of the "full" task.

+
+
-
- +
- - + + diff --git a/docs/reference/subset_dt_cols.html b/docs/reference/subset_dt_cols.html index 956fa92c..3f8381af 100644 --- a/docs/reference/subset_dt_cols.html +++ b/docs/reference/subset_dt_cols.html @@ -1,77 +1,18 @@ - - - - - - - -Subset data.table columns — subset_dt_cols • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subset data.table columns — subset_dt_cols • sl3 - - - - - + + - - - -
-
- -
- -
+
@@ -148,50 +80,43 @@

Subset data.table columns

Subset data.table columns

-
subset_dt_cols(dt, cols)
- -

Arguments

- - - - - - - - - - -
dt

A data.table.

cols

Columns to subset.

- -

Value

+
+
subset_dt_cols(dt, cols)
+
-

Subset of input data.table.

+
+

Arguments

+
dt
+

A data.table.

+
cols
+

Columns to subset.

+
+
+

Value

+

Subset of input data.table.

+
+
-
- +
- - + + diff --git a/docs/reference/subset_folds.html b/docs/reference/subset_folds.html index 631d73c8..00226f83 100644 --- a/docs/reference/subset_folds.html +++ b/docs/reference/subset_folds.html @@ -1,78 +1,19 @@ - - - - - - - -Make folds work on subset of data — subset_folds • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Make folds work on subset of data — subset_folds • sl3 - - - - - - + + - - -
-
- -
- -
+
@@ -150,47 +82,39 @@

Make folds work on subset of data

list of folds applicable to a subset, by subsetting the training and validation index vectors

-
subset_folds(folds, subset)
- -

Arguments

- - - - - - - - - - -
folds

an origami style folds list

subset

an index vector to be used to subset the data

+
+
subset_folds(folds, subset)
+
+
+

Arguments

+
folds
+

an origami style folds list

+
subset
+

an index vector to be used to subset the data

+
+
-
- +
- - + + diff --git a/docs/reference/true_obj_size.html b/docs/reference/true_obj_size.html index bd250844..ab608299 100644 --- a/docs/reference/true_obj_size.html +++ b/docs/reference/true_obj_size.html @@ -1,78 +1,19 @@ - - - - - - - -Estimate object size using serialization — true_obj_size • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Estimate object size using serialization — true_obj_size • sl3 - - - - - + + - - - -
-
- -
- -
+

Attempts to get a better estimate of object size than that returned by -object.size

+object.size

-
true_obj_size(obj)
- -

Arguments

- - - - - - -
obj

the object to get the size of

- -

Value

+
+
true_obj_size(obj)
+
+
+

Arguments

+
obj
+

the object to get the size of

+
+
+

Value

the size of obj in bytes

+
+
-
- +
- - + + diff --git a/docs/reference/undocumented_learner.html b/docs/reference/undocumented_learner.html index b43d9b6c..ab09a283 100644 --- a/docs/reference/undocumented_learner.html +++ b/docs/reference/undocumented_learner.html @@ -1,77 +1,18 @@ - - - - - - - -Undocumented Learner — undocumented_learner • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Undocumented Learner — undocumented_learner • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -149,116 +81,115 @@

Undocumented Learner

- -

Format

- +
+

Format

R6Class object.

-

Value

- -

Lrnr_base object with methods for training and +

+
+

Value

+

Lrnr_base object with methods for training and prediction.

-

Fields

- +
+ +
+
-
- +
- - + + diff --git a/docs/reference/variable_type.html b/docs/reference/variable_type.html index ba47c4cd..a9e8c0fb 100644 --- a/docs/reference/variable_type.html +++ b/docs/reference/variable_type.html @@ -1,77 +1,18 @@ - - - - - - - -Specify Variable Type — Variable_Type • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Specify Variable Type — Variable_Type • sl3 - - - - - - - - + + -
-
- -
- -
+
@@ -148,62 +80,48 @@

Specify Variable Type

Specify Variable Type

-
variable_type(type = NULL, levels = NULL, bounds = NULL, x = NULL,
-  pcontinuous = getOption("sl3.pcontinuous"))
- -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
type

A type name. Valid choices include "binomial", "categorical", -"continuous", and "multivariate". When not specified, this is inferred.

levels

Valid levels for discrete types.

bounds

Bounds for continuous variables.

x

Data to use for inferring type if not specified.

pcontinuous

If type above is inferred, the proportion of -unique observations above which the variable is considered continuous.

+
+
variable_type(type = NULL, levels = NULL, bounds = NULL, x = NULL,
+  pcontinuous = getOption("sl3.pcontinuous"))
+
+
+

Arguments

+
type
+

A type name. Valid choices include "binomial", "categorical", +"continuous", and "multivariate". When not specified, this is inferred.

+
levels
+

Valid levels for discrete types.

+
bounds
+

Bounds for continuous variables.

+
x
+

Data to use for inferring type if not specified.

+
pcontinuous
+

If type above is inferred, the proportion of +unique observations above which the variable is considered continuous.

+
+
-
- +
- - + + diff --git a/docs/reference/write_learner_template.html b/docs/reference/write_learner_template.html index 95597294..7f2b040c 100644 --- a/docs/reference/write_learner_template.html +++ b/docs/reference/write_learner_template.html @@ -1,79 +1,20 @@ - - - - - - - -Generate a file containing a template sl3 Learner — write_learner_template • sl3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Generate a file containing a template sl3 Learner — write_learner_template • sl3 - - - - - - - - - - - - - - + + - - - -
-
- -
- -
+

Generates a template file that can be used to write new sl3 Learners. For more information, see the -Defining New Learners vignette.

+Defining New Learners vignette.

-
write_learner_template(file)
- -

Arguments

- - - - - - -
file

the path where the file should be written

- -

Value

+
+
write_learner_template(file)
+
-

the return from file.copy. TRUE if writing the +

+

Arguments

+
file
+

the path where the file should be written

+
+
+

Value

+

the return from file.copy. TRUE if writing the template was successful.

+
+
-
- +
- - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index cde3e438..2c212e3d 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,8 +1,32 @@ + + https://tlverse.org/sl3/404.html + + + https://tlverse.org/sl3/CONTRIBUTING.html + + + https://tlverse.org/sl3/LICENSE-text.html + + + https://tlverse.org/sl3/articles/custom_lrnrs.html + + + https://tlverse.org/sl3/articles/index.html + + + https://tlverse.org/sl3/articles/intro_sl3.html + + + https://tlverse.org/sl3/authors.html + https://tlverse.org/sl3/index.html + + https://tlverse.org/sl3/news/index.html + https://tlverse.org/sl3/reference/CV_lrnr_sl.html @@ -108,6 +132,9 @@ https://tlverse.org/sl3/reference/Lrnr_lightgbm.html + + https://tlverse.org/sl3/reference/Lrnr_lstm.html + https://tlverse.org/sl3/reference/Lrnr_lstm_keras.html @@ -249,6 +276,9 @@ https://tlverse.org/sl3/reference/importance_plot.html + + https://tlverse.org/sl3/reference/index.html + https://tlverse.org/sl3/reference/inverse_sample.html @@ -313,21 +343,21 @@ https://tlverse.org/sl3/reference/subset_folds.html - https://tlverse.org/sl3/reference/true_obj_size.html + https://tlverse.org/sl3/reference/transform_losses.html - https://tlverse.org/sl3/reference/undocumented_learner.html + https://tlverse.org/sl3/reference/transform_risk.html - https://tlverse.org/sl3/reference/variable_type.html + https://tlverse.org/sl3/reference/true_obj_size.html - https://tlverse.org/sl3/reference/write_learner_template.html + https://tlverse.org/sl3/reference/undocumented_learner.html - https://tlverse.org/sl3/articles/custom_lrnrs.html + https://tlverse.org/sl3/reference/variable_type.html - https://tlverse.org/sl3/articles/intro_sl3.html + https://tlverse.org/sl3/reference/write_learner_template.html diff --git a/man/importance.Rd b/man/importance.Rd index 3e27df62..b1a28d92 100644 --- a/man/importance.Rd +++ b/man/importance.Rd @@ -16,69 +16,65 @@ importance(fit, eval_fun = NULL, fold_number = "validation", "ratio"), covariate_groups = NULL) } \arguments{ -\item{type}{either 1 or 2, specifying the type of importance measure (1=mean -decrease in accuracy, 2=mean decrease in node impurity).} +\item{fit}{A trained cross-validated (CV) learner (such as a CV stack or +super learner), from which cross-validated predictions can be generated.} + +\item{eval_fun}{The evaluation function (risk or loss function) for +evaluating the risk. Defaults vary based on the outcome type, matching +defaults in \code{\link{default_metalearner}}. See +\code{\link{loss_functions}} and \code{\link{risk_functions}} for options. +Default is \code{NULL}.} + +\item{fold_number}{The fold number to use for obtaining the predictions from +the fit. Either a positive integer for obtaining predictions from a +specific fold's fit; \code{"full"} for obtaining predictions from a fit on +all of the data, or \code{"validation"} (default) for obtaining +cross-validated predictions, where the data used for training and +prediction never overlaps across the folds. Note that if a positive integer +or \code{"full"} is supplied here then there will be overlap between the +data used for training and validation, so \code{fold_number ="validation"} +is recommended.} + +\item{type}{Which method should be used to obscure the relationship between +each covariate / covariate group and the outcome? When \code{type} is +\code{"remove"} (default), each covariate / covariate group is removed one +at a time from the task; the cross-validated learner is refit to this +modified task; and finally, predictions are obtained from this refit. When +\code{type} is \code{"permute"}, each covariate / covariate group is +permuted (sampled without replacement) one at a time, and then predictions +are obtained from this modified data.} + +\item{importance_metric}{Either \code{"ratio"} or \code{"difference"} +(default). For each covariate / covariate group, \code{"ratio"} returns the +risk of the permuted/removed covariate / covariate group divided by +observed/original risk (i.e., the risk with all covariates as they existed +in the sample) and \code{"difference"} returns the difference between the +risk with the permuted/removed covariate / covariate group and the observed +risk.} + +\item{covariate_groups}{Optional named list covariate groups which will +invoke variable importance evaluation at the group-level, by +removing/permuting all covariates in the same group together. If covariates +in the task are not specified in the list of groups, then those covariates +will be added as additional single-covariate groups.} } \value{ A \code{data.table} of variable importance for each covariate. } \description{ -Function that takes a cross-validated fit (i.e., cross-validated learner that -has already been trained on a task), which could be a cross-validated single -learner or super learner, and generates a risk-based variable importance -score for either each covariate or each group of covariates in the task. -This function outputs a \code{data.table}, where each row corresponds to the -risk difference or the risk ratio between the following two risks: the risk -when a covariate (or group of covariates) is permuted or removed, and the -original risk (i.e., when all covariates are included as they were in the -observed data). A higher risk ratio/difference corresponds to a more -important covariate/group. A plot can be generated from the returned -\code{data.table} by calling companion function \code{\link{importance_plot}}. +Function that takes a cross-validated fit (i.e., cross-validated learner +that has already been trained on a task), which could be a cross-validated +single learner or super learner, and generates a risk-based variable +importance score for either each covariate or each group of covariates in +the task. This function outputs a \code{data.table}, where each row +corresponds to the risk difference or the risk ratio between the following +two risks: the risk when a covariate (or group of covariates) is permuted or +removed, and the original risk (i.e., when all covariates are included as +they were in the observed data). A higher risk ratio/difference corresponds +to a more important covariate/group. A plot can be generated from the +returned \code{data.table} by calling companion function +\code{\link{importance_plot}}. } -\section{Parameters}{ - -\itemize{ -\item \code{fit}: A trained cross-validated (CV) learner (such as a CV stack -or super learner), from which cross-validated predictions can be -generated. -\item \code{eval_fun = NULL}: The evaluation function (risk or loss function) -for evaluating the risk. Defaults vary based on the outcome type, -matching defaults in \code{\link{default_metalearner}}. See -\code{\link{loss_functions}} and \code{\link{risk_functions}} for -options. -\item \code{fold_number}: The fold number to use for obtaining the predictions -from the fit. Either a positive integer for obtaining predictions from -a specific fold's fit; \code{"full"} for obtaining predictions from a -fit on all of the data, or \code{"validation"} (default) for obtaining -cross-validated predictions, where the data used for training and -prediction never overlaps across the folds. Note that if a positive -integer or \code{"full"} is supplied here then there will be overlap -between the data used for training and validation, so -\code{fold_number ="validation"} is recommended. -\item \code{type}: Which method should be used to obscure the relationship -between each covariate / covariate group and the outcome? When -\code{type} is \code{"remove"} (default), each covariate / covariate -group is removed one at a time from the task; the cross-validated -learner is refit to this modified task; and finally, predictions are -obtained from this refit. When \code{type} is \code{"permute"}, each -covariate / covariate group is permuted (sampled without replacement) -one at a time, and then predictions are obtained from this modified -data. -\item \code{importance_metric}: Either \code{"ratio"} or \code{"difference"} -(default). For each covariate / covariate group, \code{"ratio"} -returns the risk of the permuted/removed covariate / covariate group -divided by observed/original risk (i.e., the risk with all covariates -as they existed in the sample) and \code{"difference"} returns the -difference between the risk with the permuted/removed covariate / -covariate group and the observed risk. -\item \code{covariate_groups}: Optional named list covariate groups which will -invoke variable importance evaluation at the group-level, by -removing/permuting all covariates in the same group together. If -covariates in the task are not specified in the list of groups, then -those covariates will be added as additional single-covariate groups. -} -} - \examples{ # define ML task data(cpp_imputed) diff --git a/man/importance_plot.Rd b/man/importance_plot.Rd index 266088e7..067b8c40 100644 --- a/man/importance_plot.Rd +++ b/man/importance_plot.Rd @@ -6,23 +6,20 @@ \usage{ importance_plot(x, nvar = min(30, nrow(x))) } +\arguments{ +\item{x}{The two-column \code{data.table} returned by +\code{\link{importance}}, where the first column is the covariate/groups +and the second column is the importance score.} + +\item{nvar}{The maximum number of predictors to be plotted. Defaults to the +minimum between 30 and the number of rows in \code{x}.} +} \value{ A \code{\link[ggplot2]{ggplot}} of variable importance. } \description{ Variable Importance Plot } -\section{Parameters}{ - -\itemize{ -\item \code{x}: The 2-column \code{data.table} returned by -\code{\link{importance}}, where the first column is the -covariate/groups and the second column is the importance score. -\item \code{nvar}: The maximum number of predictors to be plotted. Defaults to -the minimum between 30 and the number of rows in \code{x}. -} -} - \examples{ # define ML task data(cpp_imputed) diff --git a/man/risk_functions.Rd b/man/risk_functions.Rd index 0a3c6686..06b96881 100644 --- a/man/risk_functions.Rd +++ b/man/risk_functions.Rd @@ -14,8 +14,8 @@ so a single value can be selected (e.g., "tpr"), or it's value is a scalar (e.g., "aucpr"). For more information, see \code{\link[ROCR]{performance}}.} \item{cutoff}{A numeric value specifying the cutoff for choosing a single -performance measure from the returned set. Only used for performance measures -that are cutoff-dependent and default is 0.5. See +performance measure from the returned set. Only used for performance +measures that are cutoff-dependent and default is 0.5. See \code{\link[ROCR]{performance}} for more detail.} \item{name}{An optional character string for user to supply their desired @@ -25,10 +25,6 @@ risk-related tables and metrics (e.g., \code{cv_risk} column names). When \item{...}{Optional arguments to specific \code{ROCR} performance measures. See \code{\link[ROCR]{performance}} for more detail.} - -\item{pred}{A vector of predicted values.} - -\item{observed}{A vector of binary observed values.} } \description{ Factory function for estimating an ROCR-based risk for a given ROCR measure,
-
- -
- -
+
@@ -152,67 +84,89 @@

Define a Machine Learning Task

including which variables are to be used as covariates and outcomes.

-
make_sl3_Task(...)
- -

Arguments

- - - - - - -
...

Passes all arguments to the constructor. See documentation for -Constructor below.

- -

Format

+
+
make_sl3_Task(...)
+
+
+

Format

R6Class object.

-

Value

- +
+
+

Arguments

+
...
+

Passes all arguments to the constructor. See documentation for +Constructor below.

+
+
+

Value

sl3_Task object

-

Constructor

- +
+
+

Constructor

make_sl3_Task(data, covariates, outcome = NULL, outcome_type = NULL, outcome_levels = NULL, id = NULL, weights = NULL, offset = NULL, nodes = NULL, column_names = NULL, row_index = NULL, folds = NULL)

-
-
data

A data.frame or data.table containing the underlying data

-
covariates

A character vector of variable names that define the set of covariates

-
outcome

A character vector of variable names that define the set of outcomes. Usually just one variable, although some learners support multivariate outcomes. Use sl3_list_learners("multivariate_outcome") to find such learners.

-
outcome_type

A Variable_type object that defines the variable type of the outcome. Alternatively, a character specifying such a type. See variable_type for details on defining variable types.

-
outcome_levels

A vector of levels expected for the outcome variable. If outcome_type is a character, this will be used to construct an appropriate variable_type object.

-
id

A character indicating which variable (if any) to be used as an observation "id", for learners that support clustered observations. Use sl3_list_learners("id") to find such learners.

-
weights

A character indicating which variable (if any) to be used as observation weights, for learners that support that. Use sl3_list_learners("weights") to find such learners.

-
offset

A character indicating which variable (if any) to be used as an observation "id", for methods that support clustered observations. Use sl3_list_learners("offset") to find such learners.

-
nodes

A list of character vectors as nodes. This will override the covariates, outcome, id, weights, and offset arguments if specified, and is an alternative way to specify those arguments.

-
column_names

A named list of characters that maps between column names in data and how those variables are referenced in sl3_Task functions.

- -
- -

Methods

+
data
+

A data.frame or data.table containing the underlying data

+ +
covariates
+

A character vector of variable names that define the set of covariates

+
outcome
+

A character vector of variable names that define the set of outcomes. Usually just one variable, although some learners support multivariate outcomes. Use sl3_list_learners("multivariate_outcome") to find such learners.

+ +
outcome_type
+

A Variable_type object that defines the variable type of the outcome. Alternatively, a character specifying such a type. See variable_type for details on defining variable types.

+ +
outcome_levels
+

A vector of levels expected for the outcome variable. If outcome_type is a character, this will be used to construct an appropriate variable_type object.

+ +
id
+

A character indicating which variable (if any) to be used as an observation "id", for learners that support clustered observations. Use sl3_list_learners("id") to find such learners.

+ +
weights
+

A character indicating which variable (if any) to be used as observation weights, for learners that support that. Use sl3_list_learners("weights") to find such learners.

+ +
offset
+

A character indicating which variable (if any) to be used as an observation "id", for methods that support clustered observations. Use sl3_list_learners("offset") to find such learners.

+ +
nodes
+

A list of character vectors as nodes. This will override the covariates, outcome, id, weights, and offset arguments if specified, and is an alternative way to specify those arguments.

+ +
column_names
+

A named list of characters that maps between column names in data and how those variables are referenced in sl3_Task functions.

+ + +
+
+

Methods

-
-
add_interactions(interactions, warn_on_existing = TRUE)

Adds interaction terms to task, returns a task with interaction terms added to covariate list.

    -
  • interactions: A list of lists, where each sublist describes one interaction term, listing the variables that comprise it

  • +
    add_interactions(interactions, warn_on_existing = TRUE)
    +

    Adds interaction terms to task, returns a task with interaction terms added to covariate list.

    +
    • interactions: A list of lists, where each sublist describes one interaction term, listing the variables that comprise it

    • warn_on_existing: If TRUE, produce a warning if there is already a column with a name matching this interaction term

    • -

    +
-
add_columns(fit_uuid, new_data, global_cols=FALSE)

Add columns to internal data, returning an updated vector of column_names

    -
  • fit_uuid: A uuid character that is used to generate unique internal column names. + +

    add_columns(fit_uuid, new_data, global_cols=FALSE)
    +

    Add columns to internal data, returning an updated vector of column_names

    +
    • fit_uuid: A uuid character that is used to generate unique internal column names. This prevents two added columns with the same name overwriting each other, provided they have different fit_uuid.

    • new_data: A data.table containing the columns to add

    • global_cols: If true, don't use the fit_uuid to make unique column names

    • -

    +
+
next_in_chain(covariates=NULL, outcome=NULL, id=NULL, weights=NULL, - offset=NULL, column_names=NULL, new_nodes=NULL, ...)

Used by learner$chain methods to generate a task with the same underlying data, but redefined nodes. -Most of the parameter values are passed to the sl3_Task constructor, documented above.

    -
  • covariates: An updated covariates character vector

  • + offset=NULL, column_names=NULL, new_nodes=NULL, ...)
    +

    Used by learner$chain methods to generate a task with the same underlying data, but redefined nodes. +Most of the parameter values are passed to the sl3_Task constructor, documented above.

    +
    • covariates: An updated covariates character vector

    • outcome: An updated outcome character vector

    • id: An updated id character value

    • weights: An updated weights character value

    • @@ -220,78 +174,106 @@

      Methods
    • column_names: An updated column_names character vector

    • new_nodes: An updated list of node names

    • ...: Other arguments passed to the sl3_Task constructor for the new task

    • -

    - -
    subset_task(row_index)

    Returns a task with rows subsetted using the row_index index vector

      -
    • row_index: An index vector defining the subset

    • -

    - -
    get_data(rows, columns)

    Returns a data.table containing a subset of task data.

      -
    • rows: An index vector defining the rows to return

    • -
    -
      -
    • columns: A character vector of columns to return.

    • -

    -
    has_node(node_name)

    Returns true if the node is defined in the task

      -
    • node_name: The name of the node to look for

    • -

    - -
    get_node(node_name, generator_fun=NULL)

    Returns a ddta.table with the requested node's data

      -
    • node_name: The name of the node to look for

    • -
    • generator_fun: A function(node_name, n) that can generate the node if it was not specified in the task.

    • -

    +
+ + +
subset_task(row_index)
+

Returns a task with rows subsetted using the row_index index vector

+
  • row_index: An index vector defining the subset

  • +
-
+
get_data(rows, columns)
+

Returns a data.table containing a subset of task data.

+
  • rows: An index vector defining the rows to return

  • +
  • columns: A character vector of columns to return.

  • +
+ +
has_node(node_name)
+

Returns true if the node is defined in the task

+
  • node_name: The name of the node to look for

  • +
+ + +
get_node(node_name, generator_fun=NULL)
+

Returns a ddta.table with the requested node's data

+
  • node_name: The name of the node to look for

  • +
  • generator_fun: A function(node_name, n) that can generate the node if it was not specified in the task.

  • +
-

Fields

+ +
+
+

Fields

-
-
raw_data

Internal representation of the data

-
data

Formatted task data

-
nrow

Number of observations

-
nodes

A list of node variables

-
X

a data.table containing the covariates

-
X

a data.table containing the covariates and an intercept term

-
Y

a vector containing the outcomes

-
offsets

a vector containing the offset. Will return an error if the offset wasn't specified on construction

-
weights

a vector containing the observation weights. If weights aren't specified on construction, weights will default to 1

-
id

a vector containing the observation units. If the ids aren't specified on construction, id will return seq_len(nrow)

-
folds

An origami fold object, as generated by make_folds, specifying a cross-validation scheme

-
uuid

A unique identifier of this task

-
column_names

The named list mapping variable names to internal column names

-
outcome_type

A variable_type object specifying the type of the outcome

- -
+
raw_data
+

Internal representation of the data

+ +
data
+

Formatted task data

+ +
nrow
+

Number of observations

+ +
nodes
+

A list of node variables

+ +
X
+

a data.table containing the covariates

+ +
X
+

a data.table containing the covariates and an intercept term

+ +
Y
+

a vector containing the outcomes

+ +
offsets
+

a vector containing the offset. Will return an error if the offset wasn't specified on construction

+ +
weights
+

a vector containing the observation weights. If weights aren't specified on construction, weights will default to 1

+
id
+

a vector containing the observation units. If the ids aren't specified on construction, id will return seq_len(nrow)

+ +
folds
+

An origami fold object, as generated by make_folds, specifying a cross-validation scheme

+ +
uuid
+

A unique identifier of this task

+ +
column_names
+

The named list mapping variable names to internal column names

+ +
outcome_type
+

A variable_type object specifying the type of the outcome

+ + +
+