2021-07-29 20:53:31 -04:00
|
|
|
import { Build, Learn, Label } from "./nn.ts";
|
2021-07-31 10:05:55 -04:00
|
|
|
import { default as Clean } from "./iris.js";
|
2021-07-29 20:53:31 -04:00
|
|
|
|
2021-07-31 10:05:55 -04:00
|
|
|
const [ inputs, labels ] = Clean();
|
2021-07-29 20:53:31 -04:00
|
|
|
|
2021-07-31 10:05:55 -04:00
|
|
|
|
|
|
|
const layers = Build(4, 100, 3);
|
|
|
|
const errors = Learn(inputs, layers, labels, 400, 0.1);
|
2021-07-29 20:53:31 -04:00
|
|
|
const output = Label(inputs, layers);
|
|
|
|
|
2021-07-31 10:05:55 -04:00
|
|
|
let Two = inCloud =>
|
|
|
|
{
|
|
|
|
inCloud.forEach(row=>
|
|
|
|
{
|
|
|
|
row.forEach((cell, i)=>
|
|
|
|
{
|
|
|
|
row[i] = (Math.round(cell * 100) / 100).toFixed(2);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return inCloud;
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(Two(output));
|