sklearn.metrics.explained_variance_score¶
- sklearn.metrics.explained_variance_score(y_true, y_pred, sample_weight=None)¶
Explained variance regression score function
Best possible score is 1.0, lower values are worse.
Parameters: y_true : array-like
Ground truth (correct) target values.
y_pred : array-like
Estimated target values.
sample_weight : array-like of shape = [n_samples], optional
Sample weights.
Returns: score : float
The explained variance.
Notes
This is not a symmetric function.
Examples
>>> from sklearn.metrics import explained_variance_score >>> y_true = [3, -0.5, 2, 7] >>> y_pred = [2.5, 0.0, 2, 8] >>> explained_variance_score(y_true, y_pred) 0.957...