diff --git a/test/clj_ml/data_test.clj b/test/clj_ml/data_test.clj index b1f8e6c..b7beb17 100644 --- a/test/clj_ml/data_test.clj +++ b/test/clj_ml/data_test.clj @@ -139,11 +139,11 @@ (deftest working-sequences-and-helpers (let [ds (make-dataset "test" [:a :b {:c [:d :e]}] [{:a 1 :b 2 :c nil} [4 nil :e]])] (is (= 2 (dataset-count ds))) - (is (= [{:a 1.0 :b 2.0 :c nil} {:a 4.0 :b nil :c "e"}] (dataset-as-maps ds))) + (is (= [{:a 1.0 :b 2.0 :c nil} {:a 4.0 :b nil :c :e}] (dataset-as-maps ds))) (is (= [{:weight 1.0} {:weight 1.0}] (map meta (dataset-as-maps ds)))) - (is (= [[1.0 2.0 nil] [4.0 nil "e"]] (dataset-as-vecs ds))) + (is (= [[1.0 2.0 nil] [4.0 nil :e]] (dataset-as-vecs ds))) (is (= [{:weight 1.0} {:weight 1.0}] (map #(meta (instance-to-map %1)) (dataset-seq ds)))) - (is (= [{:a 1.0 :b 2.0 :c nil} {:a 4.0 :b nil :c "e"}] (map #(instance-to-map %1) (dataset-seq ds)))))) + (is (= [{:a 1.0 :b 2.0 :c nil} {:a 4.0 :b nil :c :e}] (map #(instance-to-map %1) (dataset-seq ds)))))) (deftest dataset-instance-predicates (let [ds (make-dataset "test" [:a :b {:c [:d :e]}] [{:a 1 :b 2 :c :d} [4 5 :e]]) @@ -228,4 +228,4 @@ [2 :bar] [3 :bar] [4 :foo]])] - (is (= (dataset-as-vecs (take-dataset ds 2)) [[1.0 "foo"] [2.0 "bar"]])))) + (is (= (dataset-as-vecs (take-dataset ds 2)) [[1.0 :foo] [2.0 :bar]])))) diff --git a/test/clj_ml/filters_test.clj b/test/clj_ml/filters_test.clj index 0e14f6b..ce8b959 100644 --- a/test/clj_ml/filters_test.clj +++ b/test/clj_ml/filters_test.clj @@ -183,8 +183,10 @@ {:attributes [0] :counts true :lowercase true :stemmer "weka.core.stemmers.SnowballStemmer -S English"} ds))) - '({:world 1.0, :this 0.0, :test 1.0, :is 0.0, :hello 1.0, :dog 1.0, :cat 1.0, :a 0.0, :class "no"} - {:world 1.0, :this 1.0, :test 1.0, :is 2.0, :hello 0.0, :dog 0.0, :cat 0.0, :a 2.0, :class "yes"}))))) + '({:world 1.0, :this 0.0, :test 1.0, :is 0.0, :hello 1.0, + :dog 1.0, :cat 1.0, :a 0.0, :class :no} + {:world 1.0, :this 1.0, :test 1.0, :is 2.0, :hello 0.0, + :dog 0.0, :cat 0.0, :a 2.0, :class :yes}))))) (deftest make-apply-filter-add-attribute (let [ds (make-dataset :test [:a :b {:c [:g :m]}] @@ -256,9 +258,9 @@ {:process inc-nums :determine-dataset-format rename-attributes} ds)] (is (= (map instance-to-map (dataset-seq res)) - [{:foo 2.0 :bar 3.0 :c "g"} - {:foo 3.0 :bar 5.0 :c "m"} - {:foo 5.0 :bar 9.0 :c "g"}])))) + [{:foo 2.0 :bar 3.0 :c :g} + {:foo 3.0 :bar 5.0 :c :m} + {:foo 5.0 :bar 9.0 :c :g}])))) (deftest make-apply-filter-clj-batch