Instantly share code, notes, and snippets.

@funktor /states.py Secret
Last active Oct 14, 2018

Embed
What would you like to do?
def print_state_features(state_features):
for (attr, label), weight in state_features:
print("%0.6f %-6s %s" % (weight, label, attr))
print("Top positive:")
print_state_features(Counter(info.state_features).most_common(50))
print("\nTop negative:")
print_state_features(Counter(info.state_features).most_common()[-50:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment