
Plot method for comparing model performances
Source:R/plot.compare_performance.R
plot.see_compare_performance.Rd
The plot()
method for the performance::compare_performance()
function.
Usage
# S3 method for see_compare_performance
plot(x, size_line = 1, ...)
Arguments
- x
An object.
- size_line
Numeric value specifying size of line geoms.
- ...
Arguments passed to or from other methods.
Examples
library(performance)
data(iris)
lm1 <- lm(Sepal.Length ~ Species, data = iris)
lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris)
lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)
result <- compare_performance(lm1, lm2, lm3)
result
#> # Comparison of Model Performance Indices
#>
#> Name | Model | AIC | AIC weights | BIC | BIC weights | R2 | R2 (adj.) | RMSE | Sigma
#> ------------------------------------------------------------------------------------------------
#> lm1 | lm | 231.452 | < 0.001 | 243.494 | < 0.001 | 0.619 | 0.614 | 0.510 | 0.515
#> lm2 | lm | 106.233 | 0.566 | 121.286 | 0.964 | 0.837 | 0.833 | 0.333 | 0.338
#> lm3 | lm | 106.767 | 0.434 | 127.842 | 0.036 | 0.840 | 0.835 | 0.330 | 0.336
plot(result)