2010-03-07 17:22:04 +00:00
|
|
|
(ns clj-ml.kernel-functions-test
|
|
|
|
(:use [clj-ml kernel-functions] :reload-all)
|
2012-01-05 22:12:14 +00:00
|
|
|
(:use clojure.test midje.sweet))
|
2010-03-07 17:22:04 +00:00
|
|
|
|
|
|
|
(deftest make-kernel-function-polynomic
|
2012-01-05 22:12:14 +00:00
|
|
|
(fact
|
|
|
|
(let [kernel (clj-ml.kernel-functions/make-kernel-function :polynomic {:exponent 0.3})
|
|
|
|
options (vec (.getOptions kernel))]
|
|
|
|
options => (contains ["-E" "0.3"]))))
|
2010-03-07 17:22:04 +00:00
|
|
|
|
|
|
|
(deftest make-kernel-function-radial-basis
|
2012-01-05 22:12:14 +00:00
|
|
|
(fact
|
|
|
|
(let [kernel (clj-ml.kernel-functions/make-kernel-function :radial-basis {:gamma 0.3})
|
|
|
|
options (vec (.getOptions kernel))]
|
|
|
|
options => (contains ["-G" "0.3"]))))
|
2010-03-07 17:22:04 +00:00
|
|
|
|
|
|
|
(deftest make-kernel-function-string
|
2012-01-05 22:12:14 +00:00
|
|
|
(fact
|
|
|
|
(let [kernel (clj-ml.kernel-functions/make-kernel-function :string {:lambda 0})
|
|
|
|
options (vec (.getOptions kernel))]
|
|
|
|
options => (contains ["-L" "0.0"]))))
|