performance_accuracy: cross-validated R2 vs cor(pred, resp)

Open
#364 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
data

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.

Description

Enhancement :boom:

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?

Dominant language
R
Stars
1.2k
Forks
113
Avg merge
9h 8m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from easystats/performance

All issues in easystats/performance

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.