caretSummary: Summary for caret

View source: R/caret.R

caretSummaryR Documentation

Summary for caret

Description

Returns various metrics comparing predicted data with the values of the hold-out fold.

Usage

caretSummary(data, lev = NULL, model = NULL, plot = FALSE)

Arguments

data

data frame with a column named "obs" and another named "pred"

lev

levels (unused here)

model

model (unused here)

plot

if TRUE, observations regressed on predictions will be plotted

Value

vector with the root mean square error, variances of observations and predictions (if 0, most other metrics will be NA or NaN), Pearson and Spearman correlations between all data points, the 50% best and the 25% best, as well as the intercept, slope and determination coefficient of the simple linear regression lm(obs ~ pred) (Pineiro et al., 2008), the statistic and p value for testing null bias (Baey, 2014, pages 52-53), and the modelling efficiency (Mayer and Butler, 1993)

Author(s)

Timothee Flutre

Examples

## Not run: set.seed(1859)
n <- 100

## without bias and low coef of determination
d <- data.frame(pred=rnorm(n=n, mean=30, sd=10))
d$obs <- 0 + 1 * d$pred + rnorm(n=n, mean=0, sd=8)
(out1 <- caretSummary(data=d, plot=TRUE))

## with bias and high coef of determination
d <- data.frame(pred=rnorm(n=n, mean=30, sd=10))
d$obs <- 10 + 0.5 * d$pred + rnorm(n=n, mean=0, sd=1)
(out2 <- caretSummary(data=d, plot=TRUE))

## End(Not run)

timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.