Question: c ) Now let's use the function you implemented in part ( b ) . Use the two following statements: w h a t 1

c) Now let's use the function you implemented in part (b). Use the two following statements:
what1,loglosses1=logreggradientdescent (Xtrain, ytrain, learningrate=0.01,naxiters=50e)
what2,loglosses2=logreggradientdescent(xtrain, ytrain, learningrate=0.001,max??iters=5ee)
Make note of the arguments. After running these two statements, use matplotlib or seaborn to plot the learning curves of iteration loglosses_1 and loglosses_2. Make two separate plot figures.
Show your code snippet for this part, and the two figures. What is the issue with the first figure, and briefly explain why this issue occurred?
d) Now let us inspect label predictions. Using w_hat_2 from part (c), do the following:
Predict the probabilities on X_train
Force a label prediction with threshold of 0.5. Then use ConfusionMatrixDisplay.from_predictions to plot the confusion matrix.
Now try another label threshold of 0.1. Then plot the confusion matrix.
Show code snippet for this part, and show the two confusion matrix plots.
Give a brief explanation why a threshold of 0.5 is giving bad TP performance, and how we can fix this?
For reference here are my confusion matrix plots.
c ) Now let's use the function you implemented in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!