Linear regression via h2oSource:
This model uses regularized least squares to fit models with numeric outcomes.
For this engine, there is a single mode: regression
This model has 2 tuning parameters:
mixture: Proportion of Lasso Penalty (type: double, default: see below)
penalty: Amount of Regularization (type: double, default: see below)
By default, when not given a fixed
h2o::h2o.glm() uses a heuristic approach to select
the optimal value of
penalty based on training data. Setting the
TRUE enables an efficient version
of the grid search, see more details at
The choice of
mixture depends on the engine parameter
is automatically chosen given training data and the specification of
other model parameters. When
solver is set to
defaults to 0 (ridge regression) and 0.5 otherwise.
Translation from parsnip to the original package
linear_reg() is a
family = "gaussian".
linear_reg(penalty = 1, mixture = 0.5) %>% set_engine("h2o") %>% translate()
## Linear Regression Model Specification (regression) ## ## Main Arguments: ## penalty = 1 ## mixture = 0.5 ## ## Computational engine: h2o ## ## Model fit template: ## agua::h2o_train_glm(x = missing_arg(), y = missing_arg(), weights = missing_arg(), ## validation_frame = missing_arg(), lambda = 1, alpha = 0.5, ## family = "gaussian")
Factor/categorical predictors need to be converted to numeric values
(e.g., dummy or indicator variables) for this engine. When using the
formula method via
fit(), parsnip will
convert factor columns to indicators.
Predictors should have the same scale. One way to achieve this is to center and scale each so that each predictor has mean zero and a variance of one.
h2o::h2o.glm() uses the argument
standardize = TRUE to center and scale the data.
To use the h2o engine with tidymodels, please run
first. By default, This connects R to the local h2o server. This needs
to be done in every new R session. You can also connect to a remote h2o
server with an IP address, for more details see
You can control the number of threads in the thread pool used by h2o
nthreads argument. By default, it uses all CPUs on the host.
This is different from the usual parallel processing mechanism in
tidymodels for tuning, while tidymodels parallelizes over resamples, h2o
parallelizes over hyperparameter combinations for a given resample.
h2o will automatically shut down the local h2o instance started by R
when R is terminated. To manually stop the h2o server, run