Created
June 1, 2012 19:47
-
-
Save trappist/2854732 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 build_weights | |
| twitter_weights.destroy_all | |
| Variable.all.each do |var| | |
| Scheme.all.each do |scheme| | |
| hash = tweets_of_followers.send(var.name) | |
| total = hash.values.sum | |
| hash.each do |key,val| | |
| twitter_weights.create( | |
| :scheme => scheme, | |
| :variable => var, | |
| :value => key, | |
| :weight => (val/total.to_f) | |
| ) | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment