Skip to content

Instantly share code, notes, and snippets.

@sgsg704
Created August 24, 2021 06:50
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 sgsg704/580b27b98c973584657773638b6f67a2 to your computer and use it in GitHub Desktop.
Save sgsg704/580b27b98c973584657773638b6f67a2 to your computer and use it in GitHub Desktop.
# Predicting the test set results
y_pred = model.predict(X_test)
y_pred = (y_pred > 0.5)
# confusion matrix
cmap1 = sns.diverging_palette(260,-10,s=50, l=75, n=5, as_cmap=True)
plt.subplots(figsize=(12,8))
cf_matrix = confusion_matrix(y_test, y_pred)
sns.heatmap(cf_matrix/np.sum(cf_matrix), cmap = cmap1, annot = True, annot_kws = {'size':15})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment