I tried everything still getting this error
Here is my code
ValueError: Error when checking target: expected dense_10 to have 2 dimensions, but got array with shape (1, 1257, 1)
hey @Shubham-Dogra-657103664634145 ,
before you correct the above error, you need to work a lot beforehand first on the data.
This is a time series prediction problem , so you need to first create a proper input set to make your model LSTM work upon.
you need to predict the value of stock on next day depending upon the values of previous n days , for example let say 10 days.
so if you are having a dataframe of 21 records , after proprocessing you input looks like:
input values from 1 -10 , target is 11
input values from 2-11 , target is 12
input values from 3 -12 , target is 13
input values from 4-13, target is 14
input values from 5 -14 , target is 15
input values from 6-15 , target is 16…and so on.
After this your LSTM can understand the values from and find a pattern , with the help of which it will be to predict the future.
See this is really a big thing to understand. So , just google about it a little ,i hope you will understand it.
Try to implement you model in such a way, if there is a problem we will help you out of it.
Thank You.