get_best: Get best model from a "beset" class object

View source: R/get_best.R

get_bestR Documentation

Get best model from a "beset" class object

Description

get_best is a generic function used to obtain the best performing predictive model from beset objects based on information or cross-validation metrics.

Usage

get_best(object, ...)

Arguments

object

A beset object.

n_pred

(Optional) integer number of predictors that the best model should contain. If specified, all other arguments are ignored.

metric

Character string giving prediction metric on which to base model selection. Can be one of "mce" (mean cross entropy–the default), "mse" (mean squared error), "aic" (Akaike informatio criterion, not applicable for elastic net), "auc" (area under the ROC curve–only applicable if response is binomial), or "mae" (mean absolute error–only applicable if response is numeric).

oneSE

Logical indicating whether or not to use the "one standard error" rule. If TRUE (default) the simplest model within one standard error of the optimal model is returned. If FALSE the model with the optimal cross-validation performance is returned.

alpha

(Optional) numeric value to force selection of elastic-net model with the given alpha parameter. If left NULL, the best value of alpha will be chosen using the cross-validation metric and oneSE rule.

lambda

(Optional) numeric value to force selection of elastic- net model with the given lambda parameter. If left NULL, the best value of lambda will be chosen using the cross-validation metric and oneSE rule.


jashu/beset documentation built on April 20, 2023, 5:28 a.m.