Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Fixing score_samples #184

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

DRudel
Copy link

@DRudel DRudel commented Jun 13, 2018

This version of score_samples scores each sample on a coordinate-by-coordinate basis.

It follows the internals of scikit-learn's r2_score implementation in that coordinates that have no variance are arbitrarily set to a score of 1. This prevents division by zero and -inf scores.

… shape with unidimensional outputs.

Replace denominator of scoring function with np.var(y). This means samples with equal error will have equal score. It also allows the average value of the samples to equal the r2_score for the entire set in the case of unidimensional data.
… shape with unidimensional outputs.

Replace denominator of scoring function with np.var(y). This means samples with equal error will have equal score. It also allows the average value of the samples to equal the r2_score for the entire set in the case of unidimensional data.
jcrudy added a commit that referenced this pull request Dec 9, 2018
@jcrudy
Copy link
Collaborator

jcrudy commented Dec 10, 2018

I've merged this into the branch v0.2dev. Unfortunately, the latest version of scikit-learn's check_estimator test requires that the score_samples method operate on X only, which obviously doesn't make sense for py-earth. So, the score_samples method is currently commented out in that branch until I can figure out the best way to proceed.

If anyone is looking for this functionality now, I would suggest just working directly off of this PR.

Note: this PR was in response to the discussion in issue #182.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants