Skip to content

Instantly share code, notes, and snippets.

@Kamaldeep0077
Created October 1, 2020 13:44
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 Kamaldeep0077/1e874be76b1afa48112641fee84c54d5 to your computer and use it in GitHub Desktop.
Save Kamaldeep0077/1e874be76b1afa48112641fee84c54d5 to your computer and use it in GitHub Desktop.
#Training the model using mode of target
from sklearn.metrics import f1_score, accuracy_score, confusion_matrix
pred_test = []
for i in range (0, 13020):
pred_test.append(y_train.mode()[0])
#Printing f1 and accuracy scores
print('The accuracy for mode model is:', accuracy_score(y_test, pred_test))
print('The f1 score for the model model is:',f1_score(y_test, pred_test))
#Ploting the cunfusion matrix
conf_matrix(y_test, pred_test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment