Created
July 28, 2018 18:35
-
-
Save uds5501/42c96e1108907075966b3093e88d3dde to your computer and use it in GitHub Desktop.
for blog post 2
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.tree import DecisionTreeClassifier | |
myClassifier2 = DecisionTreeClassifier(max_depth = 5, min_samples_leaf = 2) | |
myClassifier2.fit(X_train, y_train) | |
predictions2 = myClassifier2.predict(X_test) | |
cnf2 = confusion_matrix(y_test, predictions2) | |
score2 = accuracy_score(y_test, predictions2) | |
print ("Confusion Matrix for our Decision Tree classifier is :\n ", cnf2) | |
print("While the accuracy score for the same is %.2f percent" % (score2 * 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment