diff --git a/test/test-ml-data.js b/test/test-ml-data.js new file mode 100644 index 0000000..e50c6df --- /dev/null +++ b/test/test-ml-data.js @@ -0,0 +1,34 @@ +var data1 = [ + [0,0,0], + [0,1,1], + [1,0,1], + [1,1,0] +] + +print(ml.preprocess(data1,'io',{target:2})) + +var data2 = { + x: [ + [0,0], + [0,1], + [1,0], + [1,1] + ], + y: [ + 0, + 1, + 1, + 0 + ] +} + +print(ml.preprocess(data2,'io',{})) + +var data3 = [ + { a:0, b:0, y: 0 }, + { a:0, b:1, y: 1 }, + { a:1, b:0, y: 1 }, + { a:1, b:1, y: 0 }, +] + +print(ml.preprocess(data3,'io',{features:['a','b'],target:'y'}))