I am facing a error in the last block of code. Please tell why it is showing the error. Here is the link to the code - https://drive.google.com/drive/folders/1EVNFeA5WrdG7OV5_Qa0Bh1T9NDNsc6xN?usp=sharing
Doubt in chemical classifier challenge
hey @abhaygarg2001 ,
as you are passing a dataframe in your grad_descent function ,
hence when it passes the values to calculate error ,in below code
hx=hypothesis(x[i],w,b)
for i =0 , it finds a column as to be 0 , which is not there ,so to correct it you just need to convert this x[i] to x.iloc[i]
new code:
hx=hypothesis(x.iloc[i],w,b)
after this the same error will also be generated in get_grads function , so to correct that just apply the same code above. It will work fine.
I hope your doubt is now resolved .
Thank You.
and Happy Coding .