Tue 27 Aug 00:14:56 CEST 2024

This commit is contained in:
sbosse 2024-08-27 00:15:32 +02:00
parent da412a3a40
commit a98e8e98ba

34
test/test-ml-data.js Normal file
View 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'}))