Learn R Programming

fdm2id (version 1.0.1)

evaluation.adjr2: Adjusted R2 evaluation of regression predictions

Description

Evaluation predictions of a regression model according to the adjusted R2, i.e. the R2 penalized by the number of variables used by the model.

Usage

evaluation.adjr2(predictions, gt, nrow = length(predictions), ncol, ...)

Value

The evaluation of the predictions (numeric value).

Arguments

predictions

The predictions of a regression model (vector).

gt

The ground truth (vector).

nrow

Number of observations (defaults to the number of predictions).

ncol

Number of predictors used by the model. This one has no default: the adjustment cannot be computed without it. The residual degrees of freedom are nrow - ncol - 1, the intercept counting as one parameter; the value is NA when they run out.

...

Other parameters.

See Also

evaluation.r2, evaluation.msep, evaluation

Examples

Run this code
require (datasets)
data (trees)
d = splitdata (trees, 3)
model.linreg = LINREG (d$train.x, d$train.y)
pred.linreg = predict (model.linreg, d$test.x)
evaluation.adjr2 (pred.linreg, d$test.y, ncol = ncol (d$test.x))

Run the code above in your browser using DataLab