Last active
February 2, 2017 12:08
-
-
Save haydarai/561dabca6474ff97fd0a140a5d52147f to your computer and use it in GitHub Desktop.
Perform 10-fold cross-validation to the dataset and display the accuracy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.cross_validation import cross_val_score | |
dtc = DecisionTreeClassifier() | |
cv_scores = cross_val_score(dtc, all_inputs, all_classes, cv=10) | |
sns.distplot(cv_scores) | |
plt.title('Average score: {}'.format(np.mean(cv_scores))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment