a3.r2 {A3} | R Documentation |
R^2
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.
a3.r2(y, x, simulate.fn, cv.folds)
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. |
A list comprising of the following elements:
R2 |
the cross-validated |
predicted |
the predicted responses |
observed |
the observed responses |