Skip to content

Instantly share code, notes, and snippets.

@akanik
Created December 30, 2015 21:04
Show Gist options
  • Save akanik/be3ca9beffe1acab274d to your computer and use it in GitHub Desktop.
Save akanik/be3ca9beffe1acab274d to your computer and use it in GitHub Desktop.
coral_asset_diversity_score
def asset_diversity_score(threads, alpha=2, beta=2):
X = set()
n = 0
for t in threads:
users, n_comments = unique_participants(t)
X = X | users
n += n_comments
y = len(X)
return {'diversity_score': beta_binomial_model(y, n, alpha, beta, 0.05)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment