Skip to content

Commit

Permalink
Updated function to use map-for
Browse files Browse the repository at this point in the history
  • Loading branch information
dwysocki committed Mar 19, 2015
1 parent 65fcd51 commit ced6db7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hidden_markov_music/stats.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns hidden-markov-music.stats
"General statistical functions.")
"General statistical functions."
(:require [hidden-markov-music.util :refer [map-for]]))

(defn normalize
"Normalizes a sequence."
Expand Down Expand Up @@ -39,7 +40,6 @@
element `h`, one could use `(get-in X [2 1])`."
[row-keys col-keys]
(let [n-cols (count col-keys)]
(into {}
(for [r row-keys]
(let [col-probs (random-stochastic-vector n-cols)]
[r, (zipmap col-keys col-probs)])))))
(map-for [r row-keys]
(let [col-probs (random-stochastic-vector n-cols)]
(zipmap col-keys col-probs)))))

0 comments on commit ced6db7

Please sign in to comment.