evaluation | R Documentation |
Evaluation predictions of a classification or a regression model.
evaluation(
predictions,
gt,
eval = ifelse(is.factor(gt), "accuracy", "r2"),
...
)
predictions |
The predictions of a classification model ( |
gt |
The ground truth of the dataset ( |
eval |
The evaluation method. |
... |
Other parameters. |
The evaluation of the predictions (numeric value).
confusion
, evaluation.accuracy
, evaluation.fmeasure
, evaluation.fowlkesmallows
, evaluation.goodness
, evaluation.jaccard
, evaluation.kappa
,
evaluation.precision
, evaluation.recall
,
evaluation.msep
, evaluation.r2
, performance
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.