Skip to content

Instantly share code, notes, and snippets.

@bryanl
Created August 2, 2012 14:27
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 bryanl/3237459 to your computer and use it in GitHub Desktop.
Save bryanl/3237459 to your computer and use it in GitHub Desktop.
(defn choose-orientation [gender]
(let [header (first orientation-data)
data (rest orientation-data)
lookup {0 "hetero", 1 "samesex"}]
(for [[gender-type & probs] data :when (= gender-type gender)]
(let [o-probs (map #(Double/parseDouble %) probs)
o-index (vose-alias (double-array o-probs))]
(lookup o-index)))))
;; this returns ("hetero"). I want to return "hetero".
gender hetero samesex
male 0.8 0.2
female 0.8 0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment