From a98e8e98ba7b9acd73be302000dbc3ad8e2a020d Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:15:32 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-ml-data.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/test-ml-data.js 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'}))