         (assoc :Precision (/ TP (+ TP FP))))))
 
 (defn confusion-matrix [preds facts exp]
-  {:pre [(coll? preds) (coll? facts) (map? exp)]}
+  {:pre [(coll? preds) (coll? facts) (map? exp)]
+   ;; :post [(map? %)]
+   }
   (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)]}
   (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


(defn predict
  ([model xs]
   {:pre [(instance? Model model) (coll? xs)]
    :post [(integer? %)]}
   (predict (:ass model) (:bs model) (:betas model) xs))
  ([ass bs betas xs]
   {:pre [(coll? ass) (coll? (first ass)) (coll? bs) (coll? betas) (coll? xs)]}
