Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
parent
f616fbd0bb
commit
f05054a131
17
test/test-rf1.js
Normal file
17
test/test-rf1.js
Normal file
|
@ -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))
|
Loading…
Reference in New Issue
Block a user