Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX use float64 in metrics.r2_score() to prevent overflow
Without this, if the input arrays are of type np.float32, their sums may be computed with an large accumulated error, resulting in the wrong scor with very long arrays (millions of elements). The "1 - numerator / denominator" calculation at the very end produces a float64 anyway, so the returned type does not change--only the accuracy. Fixes scikit-learn#2158.
- Loading branch information