Skip to content

Commit e61339a

Browse files
t111joeyklee
authored andcommitted
When processing raw data, if the task is classification and the outputs are not strings, convert them into strings. (#645)
1 parent 02aaa15 commit e61339a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/NeuralNetwork/NeuralNetworkData.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ class NeuralNetworkData {
135135

136136
if (outputLabels.includes(prop)) {
137137
output.ys[prop] = item[prop]
138+
// convert ys into strings, if the task is classification
139+
if(this.config.architecture.task === "classification" && typeof output.ys[prop] !== "string"){
140+
output.ys[prop] += "";
141+
}
138142
}
139143
})
140144

0 commit comments

Comments
 (0)