Skip to content

Instantly share code, notes, and snippets.

@aria42
Created September 19, 2010 19:52
Show Gist options
  • Select an option

  • Save aria42/587062 to your computer and use it in GitHub Desktop.

Select an option

Save aria42/587062 to your computer and use it in GitHub Desktop.
(defn obs-emissions
"if a word has been assigned to a tag, we increment num-keys by 1
and add weight * num-occurences of the word to counts"
[tag-emission-distr word-info weight]
(-> tag-emission-distr
(update-in [:num-keys] (if (> weight 0) inc dec))
(observe (:word word-info) (* weight (:count word-info)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment