Linda
Linda

Reputation: 2405

scikit-learn - explained_variance_score

I'm using scikit-learn to build a sample classifier which was trained and tested by an svm. Now i want to analyze the classifier and found the explained_variance_score but i don't understand this score. For e.g I get the classification report of the clf and it looks like this...

             precision    recall  f1-score   support

        0.0       0.80      0.80      0.80        10
        1.0       0.80      0.80      0.80        10

avg / total       0.80      0.80      0.80        20 

not bad but the EVS is only 0.2...sometimes its -0.X...so how could this happen? Is it important to have an good EVS? maybe someone could explain me this...

Y_true and Y_pred:

[ 1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  0.  0.  0.  0.  0.  0.  0.  0.
  0.  0.]

[ 1.  1.  1.  1.  1.  0.  0.  1.  1.  1.  1.  0.  0.  0.  0.  0.  1.  0.
  0.  0.]

Upvotes: 0

Views: 2818

Answers (2)

Niranjan Mangotri
Niranjan Mangotri

Reputation: 31

explained_variance_score, EVS tells you how much variance is explained by your model. The maximum value is one. Higher the EVS better is your model.

Upvotes: 0

lejlot
lejlot

Reputation: 66795

Explained variance is a regression metric, this not well defined for the classification problem, there is no point in applying this for such testing. This is a method for validating models like Support Vector Regression, Linear Regression, etc.

Upvotes: 9

Related Questions