Got stuck in mini batch

https://drive.google.com/file/d/1DVZBfjVqOOsodiD5jteoaSuqdXW3Oev3/view?usp=sharing

Here is the link of my ipynb file. I cant figure out what leads error_list to have a plot like this. Need help asap.

Hey @Joy-Gupta-2763139277246091, i have seen your error list values, they are decreasing, so everything seems fine. You may have one doubt why values of Errors are so high, so what i did, i printed the values of Y and i found that these values, are themselves very big. So you can apply normalization technique on Y as well. Otherwise you need to increase number of iterations to a very larger value, to complete the whole training.

Hope this resolved your doubt. :blush:

Look at the return statement. Is it correct. Or there should be a - sign as well. If so why ?

Hey @Joy-Gupta-2763139277246091, it should be positive only. No negative sign is required to be added.

then the graph of error_list is increasing i.e. errro should be minimized but here it is increasing.
https://drive.google.com/file/d/1DVZBfjVqOOsodiD5jteoaSuqdXW3Oev3/view?usp=sharing
Prateek bhaiya too have the same code but in his case the error_list was fine as it should be but here it is just opposite. This is what I’m asking

Hey @Joy-Gupta-2763139277246091, i have made some changes, plz do check that. Hopefully this time it will run fine.

I just calculated error using data[:,:-1] as X and data[:,-1] as Y. Let me know if doubt still persists.

Yeah now it is working fine but, why so?


See both values are same so what makes it to have such errors in the error_list?

Hey @Joy-Gupta-2763139277246091, the error is due to the shape mismatch of Y parameter,

Try to print shapes in your error function.

print(Y.shape,Y_predict.shape)
print(((Y - Y_predict)**2).shape) 

And try to find the difference and witness it yourself and then try to explore the reason.

If you are still unable to get, do let me know.

print(Y.shape,Y_predict.shape)
print(((Y - Y_predict)**2).shape)
Output of both the lines is same. I am unable to get it. Kindly help me out.

Hey @Joy-Gupta-2763139277246091, yes the output will be same for new code, but when you pass X and Y then shape of Y will be (1000,1) and not (1000,). So this will create a problem in subtract function, similar to the condition shown in below figure,

So you can pass, either X and Y[:,0] to calculate the error value or you can pass data[:,:-1] as X and data[:,-1] as Y

hope this resolved your doubt. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.