3 Questions about Linear Regression and Classification

First one: what is the programming command to get those arrows?

Second one: why is there a ‘minus 0.5’ in calculating w? I don’t see this in algorithm lectures.

Third one: why do we need log(logistic cost) image? Does the logistic cost image alone not enough?

Hi, @Hongbo_Wei

First Question:
this uses matplotlib commands apparently it uses something called quivers which is usually used for demonstration of the gradient directions and magnitude. You can read more about matplotlib quivers

Second Question:
The use of np.random.rand function returns an array of values between [0, 1]. I think that he just wants to have also values that are negative so he just adds -0.5 so the values can be between [-.5, 1].

Third Question:
This is just rescaling Z-Axis to have a log so the small values can be seen more easily.

for the first question you can always download the Lab Files from Lab Files → Download all Files where you can find the utils files that is used to create all this fancy plots you are seeing. there learn how it can be made.

Best Regards,
Moaz El-Essawey

1 Like

Thanks, that’s exactly what I seek for.

i need more help about this topic

i dont familliar with this i want to learn

@melanie_dedoroy , we’re happy to answer specific questions.

For general information, please watch the video lectures.

Hello, I’m pretty sure that there is an extra close parenthesis ‘)’ in line of model.compile.

This is in ‘Advanced Learning Algorithms’, week 2, Multiclass classification, Improved implementation of softmax.

Hi, I encountered a code problem in the Softmax lab where the plot is not showing. Shall I open another topic or can I ask u here?

Hi, @Hongbo_Wei the notebook uses custom widgets that are built into the utils files that come with the notebook.

I had this issue before but, when I restarted the notebook and did not use any of the magic commands like %matplotlib inline or %matplotlib notebook everything worked fine.

try doing so, and see if it works for you.

Cheers, although I tried yours, it didn’t work for me.
After I update ‘jupyter’ notebook and install ‘matplot’ library using pip, it works.

If you have an issue in Course 2 Week 2, it would be great if you can post it in the forum for that area.

This thread originated with a question on Course 1 Week 1.

Just a tip for the future, thanks!

(Update: I’ve created a support ticket to fix this typo)