Message Boards Message Boards

0
|
764 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Error using Predict: "The data being evaluated is not formatted correctly"

Posted 1 month ago

I have the new user of Wolfram, now I am trying to type the code by using NeuralNetwork, the coding to be like this.

index = {103.244, 145.125, 156.575, 179.2, 225.758, 315.217, 235.025,
248.392, 272.283, 265.067, 259.2, 265.517, 259.2, 254.6, 303.833, 353.425, 366.775, 339.092};

time = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18};

trainData = Thread[time→index] ;

p=Predict[trainData, Method→"NeuralNetwork"]

p[{19 , 20, 21}]

However, the system error of "Predict: The data being evaluated is not formatted correctly"

May I ask why the format is not correct? And how can I solve the problem? Thank you very much!

Error Page

POSTED BY: N KF
6 Replies

Should work now.

POSTED BY: Mariusz Iwaniuk

It looks like p wants a single number as input.

POSTED BY: Daniel Lichtblau
Posted 1 month ago

Thanks, but I have tried to take out the

Predict[trainData, Method→"NeuralNetwork"]

itself to run, then get the same result

POSTED BY: N KF

Ah. My mistake, I misread where the error message was located.

POSTED BY: Daniel Lichtblau
Posted 1 month ago

Hi N KF

Take a look at

index // Counts // ReverseSort

The value 259.2 appears twice. That is the problem, two different time values cannot have the same index value.

POSTED BY: Rohit Namjoshi
Posted 1 month ago

Hi Mariusz,

I was also wrong. The problem is the use of \[RightArrow] rather than ->. Nice catch!

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract