Skip to content
Snippets Groups Projects
Commit 88e86f39 authored by Andreas Mueller's avatar Andreas Mueller
Browse files

FIX don't compare things that can be arrays to strings.

parent 1774f3fc
Branches
Tags
No related merge requests found
......@@ -352,6 +352,7 @@ def explained_variance_score(y_true, y_pred,
output_scores[valid_score] = 1 - (numerator[valid_score] /
denominator[valid_score])
output_scores[nonzero_numerator & ~nonzero_denominator] = 0.
if isinstance(multioutput, string_types):
if multioutput == 'raw_values':
# return scores individually
return output_scores
......@@ -393,8 +394,9 @@ def r2_score(y_true, y_pred,
'variance_weighted'] or None or array-like of shape (n_outputs)
Defines aggregating of multiple output scores.
Array-like value defines weights used to average scores.
Default value correponds to 'variance_weighted', but
will be changed to 'uniform_average' in next versions.
Default value correponds to 'variance_weighted', this behaviour is
deprecated since version 0.17 and will be changed to 'uniform_average'
starting from 0.19.
'raw_values' :
Returns a full set of scores in case of multioutput input.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment