From f05054a131d6d4a169f9832b345929d6da32465a Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:15:51 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-rf1.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/test-rf1.js diff --git a/test/test-rf1.js b/test/test-rf1.js new file mode 100644 index 0000000..7ad4ca1 --- /dev/null +++ b/test/test-rf1.js @@ -0,0 +1,17 @@ +var x = [[0, 0, 0], [0, 1, 1], [1, 1, 0], [2, 2, 2], [1, 2, 2], [2, 1, 2]]; +// var y = ['A', 'A', 'B', 'B', 'C', 'C']; +var y = [1, 1, 2, 2, 3, 3]; +print(x) +print(y) +var model = ml.learn({ + algorithm:ml.ML.RF, + x:x, + y:y, +}); + +var test_data =[[0, 1.2, 0], + [2.1, 2, 3], + [2.1,1.1,2.0]]; + +// print(inspect(model,_,10)) +print(ml.classify(model,test_data))