Skip to content

Instantly share code, notes, and snippets.

@funktor
Last active October 14, 2018 16:21
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 funktor/53b971da8dce1cce6023065218a08ff0 to your computer and use it in GitHub Desktop.
Save funktor/53b971da8dce1cce6023065218a08ff0 to your computer and use it in GitHub Desktop.
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