X_train not defined error in last lab of course

Problem with Lab Test of logistic compute_cost().pdf (114.1 KB)

Hi Larry, seems like you didn’t run the lab from the beginning, please do so.

Raymond

Thank Raymond. Any comments when it is best to reset or reset and clear all output? Thanks.

Hi Raymond,

BTW I got an error that baffles me when I tried to vectorize the logistic cost function more than shown in a practice. Thank you of any advice you might have.

Hi Larry, every time you run a cell, the output of that cell is first cleared, so if you are rerunning all the cells from the start, the action of running will clear all output anyway, so there is no difference in between the two in this case.

Only when you want to preserve the output of a cell, you will use reset and then avoid rerunning that particular cell.

Hello Larry, that’s because in the previous line, your brackets are not balanced - some brackets are not closed.

Btw, I removed your attachment because we don’t encourage learners to share their assignment work publicly.

Raymond

Thank you for your help Raymond.

Hi Raymond,

I am confused by what appear to be inconsistent statement is the test results of the logistic cost function. First “Cost of test” supposedly testing the cost function 0.219
Asset error says the result should be ~ 2.155 and expected output cost of test is 0.218

Thank you for any clarity you can give me on this.

Larry

Hey Larry,

The expected output of 0.218 is compared with your 0.219.

As for the AssertionError, it’s actually referring to a different test case, and for that test case, the expected cost is 2.155 whereas your compute_cost gave 2.759.

Raymond

Hello,

I hope you are doing well. I have the same issue means same error X is undefined even I run from the start the problem didnt fix. could you please help me? Im new to this website and python programing.
Ragards,
Mariyeh

Hello @Mariyeh,

Welcome to our community!

This is how we do this: please start from here, choose the right category of course and week, then open a new topic, describe your problem, tell us the exercise number, and lastly copy-and-paste the error message and attach a screenshot of the error message. They are crucial information for us. However, don’t share your code publicly, and when needed we will ask you to send it via a Direct Message.

Cheers,
Raymond

Hi Raymond,

I finished the first 2 courses pretty quickly planning to finish the 3rd course before I would have to pay another $50 to finish the sequence

I am trying to keep expenses down. Unfortunately the 3rd course starts after I would be charged for another month.

Really this is stuff I can get done in 2 week not 2 months. Is there any way I not be charged for the extra month or get a refund to my card once I pay for the 2nd month? Thank you for any asset you can give me on this Raymond,

Larry

Hi @LarryK,

I have no information about this too, but since the subscription is managed by Coursera, I am afraid you will need to discuss about this with coursera. This page talks about how you can contact them.

Raymond

OK. I’ll give it a try. Thanks.

1 Like

Did the error/s below ever get resolved? I do not see or understand the solution. Please guide me to see the solution

The expected output of 0.218 is compared with your 0.219.

As for the AssertionError, it’s actually referring to a different test case, and for that test case, the expected cost is 2.155 whereas your compute_cost gave 2.759.

Looks like the learner had resolved the issue himself.

@Teofilo_Percy_Landa, if you can’t resolve an error of the assignment in course 1 week 3, it would be great if you can open a new thread in the category for course 1 week 3, and state the exericse number together with a screenshot or a text-copy of the error message. Thank you.

I am closing this thread.

Raymond