Cloudy_Green
Cloudy_Green

Reputation: 113

What does clf.score(X_train,Y_train) evaluate in decision tree?

I'm trying to build a decision tree, and found the following code online.

My question is:

enter image description here

Upvotes: 2

Views: 24868

Answers (1)

desertnaut
desertnaut

Reputation: 60390

As correctly pointed out in the comments, it is the mean training accuracy indeed; you should have been able to guess that already, by simply comparing the four different scores in your 2nd screenshot with the training one in your 1st. But in any case, and before proceeding to open such questions here, you should first consult the relevant documentation, which is arguably your best friend in similar cases. Quoting from the score method of the scikit-learn DecisionTreeClassifier docs:

score (X, y, sample_weight=None)

Returns the mean accuracy on the given test data and labels.

Upvotes: 2

Related Questions