predscore: Score predictive performance

View source: R/cv.R

predscoreR Documentation

Score predictive performance

Description

Calculate performance metrics for predictions from classification or regression.

Usage

predscore(x, ref)

Arguments

x

The predicted values.

ref

The reference (observed) values.

Value

For classification, a numeric matrix with a row for each class and columns called "Recall" and "Precision".

For regression, a numeric vector with elements named "RMSE", "MAE", and "MAPE".

Author(s)

Kylie A. Bemis

Examples

set.seed(1)
n <- 250
s <- c("a", "b", "c")
x <- sample(s, n, replace=TRUE)
pred <- ifelse(runif(n) > 0.1, x, sample(s, n, replace=TRUE))
predscore(pred, x)

kuwisdelu/matter documentation built on Dec. 8, 2024, 8:09 p.m.