   "Return output of hidden-layer_i with xs. As_i is d-dimension. B_i is number.
    Xs is d-dimension."
   ([as_i b_i xs]
-   {:pre [(coll? as_i) (number? b_i) (coll? xs)]}
+   {:pre [(coll? as_i) (number? b_i) (coll? xs)]
+    :post [(float? %)]}
    (g (+ (c/inner-product as_i xs)
          b_i))))
 

        (assoc :Precision (/ TP (+ TP FP))))))

(defn confusion-matrix [preds facts exp]
  {:pre [(coll? preds) (coll? facts) (map? exp)]}
  (if (or (empty? preds) (empty? facts))
    (exp-result exp)
    (let [pred (first preds)


(defn cross-validate
  ([dataset L k]
   {:pre [(instance? DataSet dataset) (integer? k) (integer? L)]
    :post [(map? %)]}
   (let [norm-dataset (DataSet. (:classes dataset) (data/normalize (:features dataset)))
         numd (count (:classes norm-dataset)) ; number of data
         groupn (quot numd k)]                ; number of one group's element
