Skip to content

Instantly share code, notes, and snippets.

@terrah27
Created February 3, 2019 21:16
Show Gist options
  • Save terrah27/4764e8a0b8d136e9b25198d2097a71de to your computer and use it in GitHub Desktop.
Save terrah27/4764e8a0b8d136e9b25198d2097a71de to your computer and use it in GitHub Desktop.
# trying logistic regression again with the balanced dataset
y_train = upsampled.Class
X_train = upsampled.drop('Class', axis=1)
upsampled = LogisticRegression(solver='liblinear').fit(X_train, y_train)
upsampled_pred = upsampled.predict(X_test)
# Checking accuracy
accuracy_score(y_test, upsampled_pred)
0.9807
# f1 score
f1_score(y_test, upsampled_pred)
0.1437
recall_score(y_test, upsampled_pred)
0.8712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment