accuracy {mpae}R Documentation

Accuracy measures

Description

Computes accuracy measurements.

Usage

accuracy(pred, obs, na.rm = FALSE, tol = sqrt(.Machine$double.eps))

Arguments

pred

a numeric vector with the predicted values.

obs

a numeric vector with the observed values.

na.rm

a logical indicating whether NA values should be stripped before the computation proceeds.

tol

divide underflow tolerance.

Value

Returns a named vector with the following components:

See Also

pred.plot()

Examples

set.seed(1)
nobs <- nrow(bodyfat)
itrain <- sample(nobs, 0.8 * nobs)
train <- bodyfat[itrain, ]
test <- bodyfat[-itrain, ]
fit <- lm(bodyfat ~ abdomen + wrist, data = train)
pred <- predict(fit, newdata = test)
obs <- test$bodyfat
pred.plot(pred, obs)
accuracy(pred, obs)

[Package mpae version 0.1.2 Index]