Skip to content

Instantly share code, notes, and snippets.

@tejus-gupta
Created November 28, 2018 13:23
Show Gist options
  • Save tejus-gupta/5eacf82fa4841cb0e31165c23ecac308 to your computer and use it in GitHub Desktop.
Save tejus-gupta/5eacf82fa4841cb0e31165c23ecac308 to your computer and use it in GitHub Desktop.
to_remove = []
for class_idx in selected_classes:
if np.sum(y_train[:, class_idx] < 0.5) < 5 or np.sum(y_train[:, class_idx] > 0.5) < 5:
to_remove.append(class_idx)
for class_idx in to_remove:
selected_classes.remove(class_idx)
print('Removed classes with too few examples')
print(selected_classes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment