 
 (comment
 
-  (->> (train "data/spam-train" "data/nonspam-train")
-       (test-mails "data/spam-test")
-       (test-mails "data/nonspam-test")
-       :done)
+  (time (->> (train "data/spam-train" "data/nonspam-train")
+             (test-mails "data/spam-test")
+             (test-mails "data/nonspam-test")
+             :done))
 
   )

  (let [raw-spam (read-mails spam-dir)
        raw-ham (read-mails non-spam-dir)
        dictionary (->> (concat raw-spam raw-ham)
                        (pmap #(split % #" "))
                        (apply concat)
                        frequencies
                        (remove (fn [[k v]] (< (count k) 2)))

  "Compute word frequencies in document list restricted to dictionary entries"
  [doc-list]
  (->> doc-list
       (map #(into #{} (split % #" ")))
       (apply concat)
       frequencies
       (map (fn [[k v]] [k (/ v (count doc-list))]))
       (into {})))


