From cc6e11718659909be963d82bf7e58eff3c95b6b6 Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:14:58 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-dti1.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/test-dti1.js diff --git a/test/test-dti1.js b/test/test-dti1.js new file mode 100644 index 0000000..15819a5 --- /dev/null +++ b/test/test-dti1.js @@ -0,0 +1,16 @@ +var x = [[0, 0, 0], [0, 1, 1], [1, 1, 0], [2, 2, 2], [1, 2, 2], [2, 1, 2]]; +var y = [0, 0.2, 0.4, 1, 1.2, 1.4]; + +var model = ml.learn({ + algorithm:ml.ML.DTI, + x:x, + y:y, + eps:0.2 +}); +print(toJSON(model).length+' Bytes') + +var test_data =[[0, 1.2, 0], + [2.1, 2, 3]]; + +print(ml.print(model)) +print(ml.classify(model,test_data))