35 lines
423 B
JavaScript
35 lines
423 B
JavaScript
|
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'}))
|