Learn R Programming

rModeling (version 0.0.3)

predSummary: Calculate the merit of the prediction

Description

produce the confusion matrix using function confusionMatrix from package caret if classify=TRUE, otherwise calculate the RMSE between the predicted and groundtruth values.

Usage

predSummary(reference, prediction, 
              lev = NULL, classify = TRUE)

Arguments

reference

groundtruth values.

prediction

predicted values.

lev

a vector of character, specifying the group names. Ignored if classify=FALSE.

classify

a boolean value, telling whether a classification or regression task.

Value

If classify=TRUE, a list, the output from confusionMatrix Otherwise a numeric value, giving the RMSE of the prediction.

See Also

confusionMatrix