Skip to content

Instantly share code, notes, and snippets.

@douglaspsteen
Created August 29, 2020 22:26
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 douglaspsteen/46659b96656c0b61b807773d8714cca6 to your computer and use it in GitHub Desktop.
Save douglaspsteen/46659b96656c0b61b807773d8714cca6 to your computer and use it in GitHub Desktop.
# Plot f1 scores and number of pseudo-labels added for all iterations
fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(6,8))
ax1.plot(range(iterations), test_f1s)
ax1.set_ylabel('f1 Score')
ax2.bar(x=range(iterations), height=pseudo_labels)
ax2.set_ylabel('Pseudo-Labels Created')
ax2.set_xlabel('# Iterations');
# View confusion matrix after self-training
plot_confusion_matrix(clf, X_test, y_test, cmap='Blues', normalize='true',
display_labels=['No Comp.', 'Complication']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment