Created
December 30, 2015 21:04
-
-
Save akanik/be3ca9beffe1acab274d to your computer and use it in GitHub Desktop.
coral_asset_diversity_score
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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