3 (:use clojure.contrib.math))
6 ([lst] (nth lst (rand (count lst))))
9 (let [i (rand (count lst))]
11 (pick (concat (take (dec i) lst) (drop i lst)) (dec num))))
14 (defn rand-weight [] (- (rand 2) 1))
16 (defn mean [lst] (if (empty? lst) 0 (/ (reduce + lst) (count lst))))
20 (sqrt (/ (reduce + (map (fn [el] (expt (- m el) 2)) lst))
23 (defn rms-error "Collect the error from an epic"
24 ([net epic] (rms-error net epic identity))
26 (sqrt (/ (reduce + (map (fn [[x d]] (expt (- (pull (run net x)) d) 2)) epic))
27 (* (count epic) (if (coll? (second (first epic)))
28 (count (second (first epic)))