Description Usage Arguments Value Examples
View source: R/regressionEvaluation.R
Evaluate the performance of a regression model.
1 2 | regressionEvaluation(obs, pred, model = NULL, sample_size = 1000,
seed = 1234)
|
obs |
A vector of actual outcomes. |
pred |
A vector of fitted values. |
model |
Optional, the model used to predict |
sample_size |
the maximum sample size, in numbers or percents of total observations, will be used to visualise regression effects. |
seed |
Random seeds for reproducibility. |
A list
of data.table
and ggplot2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(mtcars)
fit <- glm(mpg ~ cyl + disp + hp + drat, data=as.data.frame(mtcars), family = gaussian())
actuals <- mtcars$mpg
probs <- predict(fit, mtcars)
res <- regressionEvaluation(pred = probs,
obs = actuals,
model = fit,
sample_size=1e5,
seed = 1234)
res$descriptive_statistics
res$goodness_of_fit
res$model_details
res$visualisation$residual_vs_fitted
res$visualisation$residual_vs_order
res$visualisation$histograms
res$visualisation$prediction_intervals
res$check_model_assumptions
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.