Description Usage Arguments Value Author(s) Examples
View source: R/fit-interface.R
This package provides implementation of bolasso to select variables. This is done via bootsrapping the training set and running a lasso in every bootstrap sample. Then, only variables that appear in most of the bootstrap samples are selected and a ridge is trained with those variables
bolasso()
applies bolasso to dataset. Bolasso is a feature selection technique
that applies lasso for feature to different bootstrap samples of the dataset, and
then keeps the features that are selection most of the time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x |
Depending on the context:
|
... |
Most importantly, n_bootstraps, threshold_selection, and ... of cv.glmnet. |
y |
When
|
formula |
A formula specifying the outcome terms on the left-hand side, and the predictor terms on the right-hand side. |
data |
When a recipe or formula is used,
|
A bolasso
object.
Maintainer: David Masip david26694@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | predictors <- mtcars[,c("mpg", "disp", "hp", "drat", "wt")]
outcome <- mtcars[, "vs"]
# XY interface
mod <- bolasso(predictors, outcome)
# Formula interface
mod2 <- bolasso(vs ~ ., mtcars)
# Recipes interface
library(recipes)
rec <- recipe(mpg ~ ., mtcars)
rec <- step_log(rec, disp)
mod3 <- bolasso(rec, mtcars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.