             [incanter.core :as c :exclude [update]])
   (:import [clj_elm.data DataSet]))
 
-(defn ^Number sign
+(defn sign
   "The signum function for a real number x."
-  ([^Number x]
+  ([x]
    {:pre [(number? x)]}
    (cond
      (> x 0) 1
      (= x 0) 0
      :else -1)))
 
-(defn ^clojure.lang.PersistentVector make-weights
+(defn make-weights
   "Make a d-dimension-random-feature vector. d is number of dimention of
    feature. All elements are in [-1,1]"
-  ([^Integer d]
+  ([d]
    {:pre [(integer? d)]}
    (take d (repeatedly #(dec (rand 2))))))
 
-(defn ^clojure.lang.PersistentVector make-ass
-  ([^Integer d ^Integer L]
+(defn make-ass
+  ([d L]
    {:pre [(integer? d) (integer? L)]}
    (take L (repeatedly #(make-weights d)))))
 
-(defn ^clojure.lang.PersistentVector make-bs
-  ([^Integer L]
+(defn make-bs
+  ([L]
    {:pre (integer? L)}
    (take L (repeatedly #(first (make-weights 1))))))
 
-(defn ^Number standard-sigmoid
-  ([^Number x]
+(defn standard-sigmoid
+  ([x]
    {:pre [(number? x)]
     :post [(number? %)]}
    (/ 1 (+ 1 (Math/exp (- x))))))


(defrecord Model [ass bs betas])

(defn ^Model train-model
  ([^DataSet dataset ^Integer L & {:keys [^Boolean norm] :or {norm false}}]
   {:pre [(instance? DataSet dataset) (integer? L)]}
   (let [normf (if norm data/normalize identity)
         d (data/num-of-feature dataset)
         ass (make-ass d L)

         (as-> eva (do (println eva)
                       eva))))))

(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
