-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Is my training data invalid? #827
-
Hey guys.
When I call net.run(data)[0] i'm getting undefined as a result. I'm not sure if it is because my training data is in the wrong format. The format is {input: {} {}, output: 0}.
Here is the training data I am trying to test with: https://pastebin.com/qYsuBqG0 .
Any help would be greatly appreciated!
Thank you1
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments 8 replies
-
The input data isn't shaped correctly. The output should be an object or array:
{input: {}, output: [0]}.
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh i see. This is my new input data: https://pastebin.com/J6Hp7Tas.
I'm now getting Nan instead of undefined. Or when I console log I get {"0":null}. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions
-
So net.run(testData)[0] is always NaN.
Beta Was this translation helpful? Give feedback.
All reactions
-
Your input from that link is as well incorrectly shaped:
let data = [ { input: { BlueTeam: { Aatrox: 0, }, RedTeam: { Aatrox: 1,
Input needs to be either an array or flat object who's properties are decimals or integers. It should be something more like:
let data = [ { input: { BlueTeam_Aatrox: 0, RedTeam_Aatrox: 1, },
Beta Was this translation helpful? Give feedback.
All reactions
-
I see. So would something like { input: [ [0, 0, 0, 1], [0, 1, 1, 0] ], output: [1] } work?
Beta Was this translation helpful? Give feedback.
All reactions
-
I see. So would something like { input: [ [0, 0, 0, 1], [0, 1, 1, 0] ], output: [1] } work?
That is as well an alternate that will work.
Beta Was this translation helpful? Give feedback.
All reactions
-
But a single array full of objects wouldn't work?
Beta Was this translation helpful? Give feedback.
All reactions
-
like { input: [ {a: 0, b: 0, c: 0, d: 1}, {a: 0, b: 1, c: 1, d: 0} ], output: [1] }
Beta Was this translation helpful? Give feedback.
All reactions
-
I see. So would something like { input: [ [0, 0, 0, 1], [0, 1, 1, 0] ], output: [1] } work?
That is as well an alternate that will work.
Hey just wondering if i'm doing this right.
My training data looks like this:
{ input: [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], ],
but once again I am getting NaN as a result :(
Beta Was this translation helpful? Give feedback.
All reactions
-
no.
Beta Was this translation helpful? Give feedback.
All reactions
-
Okay thanks a lot for your help! I understand how inputs need to work now.
Beta Was this translation helpful? Give feedback.
All reactions
-
Is there any issues with having an array of strings input and then a number output? I am getting NaN as a result when I try this.
Beta Was this translation helpful? Give feedback.