From ced6db7b871048bd5e9b660dddc42fe798d4113d Mon Sep 17 00:00:00 2001 From: Dan Wysocki Date: Thu, 19 Mar 2015 00:11:42 -0400 Subject: [PATCH] Updated function to use map-for --- src/hidden_markov_music/stats.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hidden_markov_music/stats.clj b/src/hidden_markov_music/stats.clj index 090bf82..33afb4e 100644 --- a/src/hidden_markov_music/stats.clj +++ b/src/hidden_markov_music/stats.clj @@ -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." @@ -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)))))