Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
parent
79c2af1c13
commit
4bb33be0ff
18
test/test-dti2.js
Normal file
18
test/test-dti2.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
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 model = ml.learn({
|
||||
algorithm:ml.ML.DTI,
|
||||
x:x,
|
||||
y:y,
|
||||
eps:0.2
|
||||
});
|
||||
print(toJSON(model).length+' Bytes')
|
||||
print(toJSON(model))
|
||||
var test_data =[[0, 1.2, 0],
|
||||
[2.1, 2, 3],
|
||||
[2.1,1.1,2.0]];
|
||||
|
||||
print(ml.print(model))
|
||||
print(ml.classify(model,test_data))
|
||||
print(ml.classify(model,[1,2,3]))
|
Loading…
Reference in New Issue
Block a user