MCPcopy Create free account
hub / github.com/BrainJS/brain.js / mapStringClassesToNumber

Function mapStringClassesToNumber

test/applications/iris.js:18–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18function mapStringClassesToNumber() {
19 let names = new Set();
20
21 trainingSet.forEach(row => {
22 names.add(row.output[0]);
23 });
24
25 names = [...names];
26
27 trainingSet = trainingSet.map(row=>{
28 let index = names.indexOf(row.output[0]);
29 row.output = [0,0,0];
30 row.output[index] = 1;
31 return row;
32 });
33}
34
35dressData();
36mapStringClassesToNumber();

Callers 1

iris.jsFile · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected