-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument for additional metrics in model_performance() #254
Comments
I would prefer to have less arguments. Regarding AICc, perhaps we should return it by default? Or even instead of the AIC, if that makes sense? |
I think retaining first order AIC makes sense given its ubiquity. I’d really like there to be an option to add R2 CIs and n_obs() to the performance table to facilitate reporting (especially when teaching), so an option to add additional functions to |
You can already request AICc (https://easystats.github.io/performance/reference/model_performance.lm.html). But we could indeed add the other ones, too. |
Ah I missed the casing "AICC” is ignored. |
That's indeed inconsistent, we should convert all input into upper or lower case inside the function, so case can mostly be ignored. |
I just checked, and should already work: library(performance)
m <- lm(formula = mpg ~ wt + qsec + am, data = mtcars)
performance(m, metrics = c("R2", "AICc"))
#> # Indices of model performance
#>
#> AICc | R2
#> ---------------
#> 156.427 | 0.850
performance(m, metrics = c("R2", "AICC"))
#> # Indices of model performance
#>
#> AICc | R2
#> ---------------
#> 156.427 | 0.850
performance(m, metrics = c("R2", "r2_adj", "aicc"))
#> # Indices of model performance
#>
#> AICc | R2 | R2 (adj.)
#> ---------------------------
#> 156.427 | 0.850 | 0.834
performance(m, metrics = c("R2", "r2_adj", "aicc", "AiC"))
#> # Indices of model performance
#>
#> AIC | AICc | R2 | R2 (adj.)
#> -------------------------------------
#> 154.119 | 156.427 | 0.850 | 0.834 Created on 2021-04-05 by the reprex package (v2.0.0) Please re-open if you still find any issues! |
Re-opening to discuss the broader question of adding additional functions. For example, let's say I'd like to add
Within the performance function, the type of I can put together a PR if there is interest. |
Yeah, that sounds reasonable! Please open a PR, if you like. And we could indeed add |
I'd like to be able to request additional performance metrics in
model_performance()
, such as AICC or confidence intervals for R2 or sigma. It would be nice if, in addition to themetrics
argument, there were anadditional_metrics
argument that could take a named list of additional functions to run, each of which should return a vector a results that would be added as additional columns to the performance data frame.For example:
Or perhaps it would be cleaner to just have the one
metrics
argument and allow it to be either the current string vector or a named list of functions:The text was updated successfully, but these errors were encountered: