caretSummary | R Documentation |
Returns various metrics comparing predicted data with the values of the hold-out fold.
caretSummary(data, lev = NULL, model = NULL, plot = FALSE)
data |
data frame with a column named |
lev |
levels (unused here) |
model |
model (unused here) |
plot |
if TRUE, observations regressed on predictions will be plotted |
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)
Timothee Flutre
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.