Skip to content

Instantly share code, notes, and snippets.

@terrah27
Created February 3, 2019 21:20
Show Gist options
  • Save terrah27/6a4809815cd46091c716692337aa64c8 to your computer and use it in GitHub Desktop.
Save terrah27/6a4809815cd46091c716692337aa64c8 to your computer and use it in GitHub Desktop.
# trying logistic regression again with the undersampled dataset
y_train = downsampled.Class
X_train = downsampled.drop('Class', axis=1)
undersampled = LogisticRegression(solver='liblinear').fit(X_train, y_train)
undersampled_pred = undersampled.predict(X_test)
# Checking accuracy
accuracy_score(y_test, undersampled_pred)
0.9758
# f1 score
f1_score(y_test, undersampled_pred)
0.1171
recall_score(y_test, undersampled_pred)
0.8636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment