a3.r2: Cross-Validated R^2

Description Usage Arguments Value

Description

Applies cross validation to obtain the cross-validated R^2 for a model: the fraction of the squared error explained by the model compared to the null model (which is defined as the average response). A pseudo R^2 is implemented for classification.

Usage

1
a3.r2(y, x, simulate.fn, cv.folds)

Arguments

y

a vector or responses.

x

a matrix of features.

simulate.fn

a function object that creates a model and predicts y.

cv.folds

the cross-validation folds.

Value

A list comprising of the following elements:

R2

the cross-validated R^2

predicted

the predicted responses

observed

the observed responses


A3 documentation built on May 2, 2019, 9:36 a.m.

Related to a3.r2 in A3...