Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
parent
da412a3a40
commit
a98e8e98ba
34
test/test-ml-data.js
Normal file
34
test/test-ml-data.js
Normal file
|
@ -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'}))
|
Loading…
Reference in New Issue
Block a user