Lazy Generic Boosting Regressor (AutoML Hold-out set validation)

LazyBoostingRegressor(
  verbose = 0,
  ignore_warnings = TRUE,
  custom_metric = NULL,
  predictions = FALSE,
  sort_by = "RMSE",
  random_state = 42,
  estimators = "all",
  preprocess = FALSE,
  n_jobs = NULL
)

Arguments

verbose:

int, progress bar (yes = 1) or not (no = 0) (currently).

ignore_warnings:

bool, ignore warnings.

custom_metric:

function, custom metric.

predictions:

bool, return predictions.

sort_by:

str, sort by metric.

random_state:

int, random state.

estimators:

str, estimators to use. List of names for custom, or just 'all'.

preprocess:

bool, preprocess data or not.

n_jobs:

int, number of jobs.

Value

LazyBoostingRegressor object

Examples


library(mlsauce)
library(datasets)

data(mtcars)

X <- as.matrix(mtcars[, -1])
y <- as.integer(mtcars[, 1]) 

n <- dim(X)[1]
p <- dim(X)[2]

set.seed(21341)
train_index <- sample(x = 1:n, size = floor(0.8*n), replace = TRUE)
test_index <- -train_index

X_train <- as.matrix(X[train_index, ])
y_train <- as.integer(y[train_index])
X_test <- as.matrix(X[test_index, ])
y_test <- as.integer(y[test_index])

obj <- LazyBoostingRegressor(verbose=0, ignore_warnings=TRUE,
                              custom_metric=NULL, preprocess=FALSE)

obj$fit(X_train, X_test, y_train, y_test)
#> [[1]]
#>                           Adjusted R-Squared R-Squared     RMSE Time Taken
#> RandomForestRegressor             -0.1609670 0.8065055 1.848996 0.26891112
#> GradientBoostingRegressor         -0.2596835 0.7900528 1.926002 0.11517501
#> XGBRegressor                      -1.3776574 0.6037238 2.646065 0.09465313
#> 
#> [[2]]
#>                           Adjusted R-Squared R-Squared     RMSE Time Taken
#> RandomForestRegressor             -0.1609670 0.8065055 1.848996 0.26891112
#> GradientBoostingRegressor         -0.2596835 0.7900528 1.926002 0.11517501
#> XGBRegressor                      -1.3776574 0.6037238 2.646065 0.09465313
#>