Last active
October 1, 2020 14:14
-
-
Save Kamaldeep0077/ec6d72173a47a6b8c65430fd656a0ac6 to your computer and use it in GitHub Desktop.
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
#importing and training the model | |
from sklearn.linear_model import LogisticRegression | |
lr = LogisticRegression(solver='newton-cg', class_weight='balanced') | |
lr.fit(x_train, y_train) | |
# Predicting on the test data | |
pred_test = lr.predict(x_test) | |
#Calculating and printing the f1 score | |
f1_test = f1_score(y_test, pred_test) | |
print('The f1 score for the testing data:', f1_test) | |
#Ploting the confusion 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