I do not know why I am getting this error. All prior exercises were passed.
{moderator edit - solution code removed}
I do not know why I am getting this error. All prior exercises were passed.
{moderator edit - solution code removed}
There are several issues with your code. Maybe the highest level issue is that we aren’t supposed to post solution code in a public way. But the immediate cause of your error is that you have passed the wrong arguments to the predict
function here. Your predict
function is probably correct if it passed the earlier tests, but a perfectly correct function can still throw errors if you pass it incorrect arguments. Take another look at the definition of the predict
function and compare that to the arguments you are passing. Do you see the difference?
Once you fix that, I predict (pun intended) that you will then get the wrong answers from your model
function. The reason is that you are not passing the number of iterations and learning rate when you call the optimize
function from model
. So what does that mean? What values will actually be used for those parameters? What happens if they don’t match the actual values being requested by the test case?