mod_penalized: Fits a GLM penalized model using k-fold cross-validation to...

View source: R/mod_penalized.R

mod_penalizedR Documentation

Fits a GLM penalized model using k-fold cross-validation to tune the lambda hyperparameter

Description

Fits a GLM penalized model using k-fold cross-validation to tune the lambda hyperparameter

Usage

mod_penalized(
  data,
  x_names = character(),
  y_name,
  alpha = 1,
  type_measure = "mse"
)

Arguments

data

A numeric dataset in matrix-convertible format

x_names

A character vector of explainatory variables names

y_name

A character naming the variable to explain

alpha

A numeric to compromise between ridge (alpha=0) and lasso (alpha=1, default) penalization

type_measure

A character naming the error metric used for the cross-validation (defaults to "mse")

Value

The fitted model


cottinlola/modeleVariablesAP documentation built on April 30, 2022, 7:42 a.m.