Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

About 10 Introduction to TensorFlow.js, in the Danfo.js book#536

Unanswered
Azem-henri asked this question inGeneral
Discussion options

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

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
1 participant
@Azem-henri

[8]ページ先頭

©2009-2025 Movatter.jp