py-earth icon indicating copy to clipboard operation
py-earth copied to clipboard

Fixing score_samples

Open DRudel opened this issue 7 years ago • 1 comments

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.

DRudel avatar Jun 13 '18 06:06 DRudel

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.

jcrudy avatar Dec 10 '18 01:12 jcrudy