Description Usage Arguments Value See Also Examples
Given a validation set, calculate root mean-squared error (rmse
) or predictive deviance for Bernoulli (1 or 0) data (devBern
).
1 2 |
truth |
The true value from the validation set.
|
prediction |
The predicted value from the model.
For |
A single number giving the metric of interest.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # generate 100 fake datapoints
n <- 100
# 'true' probability of presence
prob <- runif(n)
# true presence/absence
y <- rbinom(n, 1, prob)
# predicted probability of presence
pred <- runif(n)
# Bernoulli deviance of the prediction from the validation set
devBern(y, pred)
# root mean squared error of predicted from true probability of presence
rmse(prob, pred)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.