         (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 train-model
  ([dataset L & {:keys [norm] :or {norm false}}]
   {:pre [(instance? DataSet dataset) (integer? L)]
    :post [(instance? Model %)]}
   (let [normf (if norm data/normalize identity)
         d (data/num-of-feature dataset)
         ass (make-ass d L)
