easystats / easystats/performance
Argument for additional metrics in model_performance()
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 8
Description
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 the metrics argument, there were an additional_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:
m <- lm(formula = mpg ~ wt + qsec + am, data = mtcars)
performance(m, metrics = "common", additional_metrics = list(`R2 CI` = confint_R2, AICC = performance_aicc))
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:
m <- lm(formula = mpg ~ wt + qsec + am, data = mtcars)
performance(m, metrics = "list(R2 = r2, `R2 CI` = confint_R2, AICC = performance_aicc, Sigma = get_sigma))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the R package's model_performance() entry point and inspect how the current metrics argument selects performance measures. Compare the additional_metrics named-list proposal with the alternative of accepting named functions in metrics, then use the supplied lm example to define how custom results should become columns in the performance data frame.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100