RE: Programming Assignment Logistic Regression with a Neural Network Mindset

Hi

I get the correct result for each of teh helper function(“all tests passed”) but when I run the model function I get the wrong cost value. I cant see what I have done wrong. Below is my code: Exercise 1

{moderator edit - solution code removed}

Hi @Paddy ,

I hope you’re doing well! I noticed that you shared your code for one of the assignments in the forum, and I wanted to gently remind you that sharing such code isn’t allowed, as it can affect the learning experience for others.

That being said, I completely understand that sometimes assignments can be tricky! Instead of posting the full code, I encourage you to share the specific challenges you’re facing. This way, the community can offer helpful guidance without giving away code.

I’m confident you’ll feel a great sense of accomplishment once you tackle it on your own!

@saou_a

1 Like

Notice that the return value for the cost from the model function is the variable costs. I do not see that variable referenced anywhere in your model function logic, other than in the final code segment they gave you to define the dictionary which is the actual return value of the function. That is not the variable that is used to hold the appropriate return value from the optimize function, for example. Programming is a game of details: a single incorrect or missing character can change everything.

As Kader has mentioned, please note that we’re not supposed to share solution code in a public way. Of course it was useful for debugging in this case, but in other cases in which the mentors cannot help without seeing the actual code, there are private ways to do that.

Also notice that you filed this question under the general AI Projects - AI Discussions category. You just happened to get lucky that we can recognize which actual assignment you are talking about from the content of your message, but in general you’ll have better luck by creating your questions in the relevant specific categories for the course in question. I will move it for you by using the little “edit pencil” on the title.

BIG thank you

1 Like