Skip to content

Instantly share code, notes, and snippets.

@BinarySpoon
Created February 25, 2021 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BinarySpoon/0eafac8d93ff8532ccabc02f251db44c to your computer and use it in GitHub Desktop.
Save BinarySpoon/0eafac8d93ff8532ccabc02f251db44c to your computer and use it in GitHub Desktop.
# E.Analysing Results -->
# 1.Decision Tree Classifier -->
print("-----------------------------------")
print('Decision Tree Classifier')
print('Accuracy Score: {:,.2f}'.format(dtc.score(X_test, y_test)))
print()
print(classification_report(y_test, dtc.predict(X_test)))
print()
print('confusion_matrix: \n {}'.format(confusion_matrix(y_test, dtc.predict(X_test))))
print()
print("-----------------------------------")
# 2.Random Forest Classifier -->
print("-----------------------------------")
print('Random Forest Classification')
print('Accuracy Score: {:,.2f}'.format(rf.score(X_test,y_test)))
print()
print(classification_report(y_test, rf.predict(X_test)))
print()
print('confusion_matrix: \n {}'.format(confusion_matrix(y_test,rf.predict(X_test))))
print()
print("-----------------------------------")
# 3.Gradient Boosted regressor -->
print("-----------------------------------")
print('Gradient Booster')
print('Accuracy Score: {:,.2f}'.format(gbc.score(X_test, y_test)))
print()
print(classification_report(y_test, gbc.predict(X_test)))
print()
print('confusion_matrix: \n {}'.format(confusion_matrix(y_test, gbc.predict(X_test))))
print()
print("-----------------------------------")
# 4.Support Vector classification -->
print("-----------------------------------")
print('Support Vector Machine')
print('Accuracy score: {:,.2f}'.format(svc.score(X_test,y_test)))
print()
print(classification_report(y_test, svc.predict(X_test)))
print()
print('confusion_matrix: \n {}'.format(confusion_matrix(y_test,svc.predict(X_test))))
print()
print("-----------------------------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment