]> gitweb.factorcode.org Git - factor.git/commitdiff
machine-learning.one-hot: Use the example from my blog post as a unit test.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 26 Oct 2012 01:15:56 +0000 (18:15 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 26 Oct 2012 01:16:22 +0000 (18:16 -0700)
extra/machine-learning/one-hot/one-hot-tests.factor

index e8c09c40063af6dcf811d8e7cd132cbc82b6fcf3..0343683060416a994eb3b639285493bd591dbc45 100644 (file)
@@ -4,10 +4,16 @@ USING: tools.test machine-learning.one-hot ;
 IN: machine-learning.one-hot.tests
 
 CONSTANT: test-data {
-    { "male" "female" }
-    { "from Europe" "from US" "from Asia" }
-    { "uses Firefox" "uses Chrome" "uses Safari" "uses Internet Explorer" }
+    { "hot" "cold" }
+    { "cloudy" "raining" "snowing" "sunny" }
+    { "light" "heavy" }
+    { "bright-colored" "dark-colored" "neutral" }
+    { "quickly" "slowly" }
+    { "well" "sick" "tired" }
 }
 
-{ { 1 0 0 1 0 0 0 0 1 } }
-[ { 0 1 3 } test-data one-hot ] unit-test
+{ { 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 } }
+[ { 0 3 0 2 1 0 } test-data one-hot ] unit-test
+
+{ { 0 1 0 0 1 0 0 1 0 1 0 1 0 0 1 0 } }
+[ { 1 2 1 1 0 1 } test-data one-hot ] unit-test