Need help with this code

Hello Team
I wanted to know what does ,,hist mean in the below -

,,hist = run_gradient_descent(X_train, y_train, 10, alpha = 1e-7)

Look forward thank you

Please share a screenshot if it is from a code cell which is not graded.

hist usually is plot histogram

Two questions-1) what do we have two dashes before hist what does that mean 2) In the second graph on the right why does it show w only and not other variable where in the code have we specified that ?

Hello @Jasmine7,

If you check out the scipt file, there you will find the definition for run_gradient_descent(...) which returns a tuple of 3 variables. _ is the variable name usually used to “receive variable” that we do not need in the rest of the code. So, the two _ means that we didn’t need the first two returning variables.

hist, by its name, should mean something’s history, and here I suppose it was the history of cost values, but you can verify it by inspecting the result of print(hist).

As for the graph, it’s just an example and it suffices to demo what the lab wanted to show. We could have chosen either of w1, w2, w3, or b. However, we couldn’t display all of them at the same time because there will be too many dimensions to show in one graph.


1 Like

Thanks so much.

1 Like

You are welcome, @Jasmine7!