Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

evaluation

Evaluation of classification or regression predictions


Description

Evaluation predictions of a classification or a regression model.

Usage

evaluation(
  predictions,
  gt,
  eval = ifelse(is.factor(gt), "accuracy", "r2"),
  ...
)

Arguments

predictions

The predictions of a classification model (factor or vector).

gt

The ground truth of the dataset (factor or vector).

eval

The evaluation method.

...

Other parameters.

Value

The evaluation of the predictions (numeric value).

See Also

Examples

require (datasets)
data (iris)
d = splitdata (iris, 5)
model.nb = NB (d$train.x, d$train.y)
pred.nb = predict (model.nb, d$test.x)
# Default evaluation for classification
evaluation (pred.nb, d$test.y)
# Evaluation with two criteria
evaluation (pred.nb, d$test.y, eval = c ("accuracy", "kappa"))
data (trees)
d = splitdata (trees, 3)
model.linreg = LINREG (d$train.x, d$train.y)
pred.linreg = predict (model.linreg, d$test.x)
# Default evaluation for regression
evaluation (pred.linreg, d$test.y)

fdm2id

Data Mining and R Programming for Beginners

v0.9.5
GPL-3
Authors
Alexandre Blansché [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.