About 10 Introduction to TensorFlow.js, in the Danfo.js book #536
Unanswered
Azem-henri
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Thanks for the API, i am enjoying it. So i have a bug about the practical example entitle: Building a simple regression model with TensorFlow.js. I applied it to new example and i use the same data preprocessing file. The problem is: when i used the full dataset with
let scaler = new dfd.MinMaxScaler()
scaler.fit(Xtrain)
Xtrain = scaler.transform(Xtrain)
i get the good result as in the example and when i want to use it during the prediction to predict one line only, from the raw data not like in the book by passing through the preprocessing method i am always get this result
[ [
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN
] ]
and i canot send this to my model to predict, so i try it by the way and get the following result: The probability of winning is: [ [ NaN ].
When i comment the line "Xtrain = scaler.transform(Xtrain)" i get different results as:
[ [
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, 49, 0, 41, 10, 0, 0, 0, 1, 0, 0,
0, 1, 1, 0, 0, 0
] ]
The probability of winning is:
[ [ -1.6790392398834229 ] ]
I just want to use the raw data.csv with one example to make prediction.
can you help me please to fix that bug, Thanks in advance
Sincerely
Beta Was this translation helpful? Give feedback.
All reactions