Skip to contents

Class CrossValidation

Class CrossValidation

Details

Class of object returned by the QuadrupenFit$cross_validate() method or the cross_validate() function. Owns print() and plot() methods.

Active bindings

data

a data frame containing the mean cross-validated error and its associated standard error for each values of lambda1 and lambda2.

folds

list of K vectors indicating the folds used for cross-validation.

lambda1

vector of \(\lambda_1\) (\(\ell_1\) or \(\ell_\infty\) penalty levels) for which each cross-validation has been performed.

lambda2

vector (or scalar) of \(\ell_2\)-penalty levels for which each cross-validation has been performed.

lambda1_min

level of \(\lambda_1\) that minimizes the error estimated by cross-validation.

lambda2_min

level of \(\lambda_2\) that minimizes the error estimated by cross-validation.

lambda1_1se

largest level of \(\lambda_1\) such as the cross-validated error is within 1 standard error of the minimum.

lambda2_1se

largest level of \(\lambda_2\) the cross-validated error is within 1 standard error of the minimum (only relevant for ridge regression).

Methods


Method new()

Constructor for a CrossValidation object Should be called internally by an object QuadrupenFit$cross_validate()

Usage

CrossValidation$new(cv_error, folds)

Arguments

cv_error

data frame storing output of a cv job

folds

list of K folds used for cross-validation


Method show()

User friendly print method

Usage

CrossValidation$show()


Method print()

User friendly print method

Usage

CrossValidation$print()


Method plotCV_1D()

Plot 1-dimensional cross-validation

Usage

CrossValidation$plotCV_1D(log_scale = TRUE, title = "Cross-validation error")

Arguments

log_scale

logical, should a log-scale be used for the x-axis

title

graph title

Returns

a ggplot object


Method plotCV_2D()

Plot 2-dimensional cross-validation output (grid lambda1 x lambda2)

Usage

CrossValidation$plotCV_2D(title = "Cross-validation error")

Arguments

title

graph title

Returns

a ggplot2 object


Method plot()

Plot cross-validation job by choosing the most appropriate output (1D- or 2D)

Usage

CrossValidation$plot(log_scale = TRUE, title = "Cross-validation error")

Arguments

log_scale

logical, should a log-scale be used for the x-axis

title

graph title

Returns

a ggplot object


Method clone()

The objects of this class are cloneable with this method.

Usage

CrossValidation$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.