easystats / easystats/performance
performance_accuracy: cross-validated R2 vs cor(pred, resp)
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 8
Description
Currently, in performance_accuracy(), accuracy for linear models is indexed as the average correlation between the test sample predictions and responses. That's a potential index accuracy, but I think users might confuse it for the cross-validated R2.
The cross-validated R2 is 1 - mean((pred - resp)^2) / mean((resp - mean(resp))^2)
cor(pred, resp) is different because it standardizes the pred and resp variables, removing any misestiamates of the predicted mean or variance.
We should either replace the current metric with the cross-validated R2 or add both as an option. What do you think of "sample_R" as the name for the current metric? Does that convey the difference/potential issue?
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 performance_accuracy() entry point and inspect how accuracy for linear models currently uses correlations across test samples. Compare that behavior with the cross-validated R2 formula stated in the issue; done requires a resolved decision on whether to replace the metric or expose both metrics and how to name the existing one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100