Question: LR Logistic Regression Consider the objective function in logistic regression problem ()= i=1m(yilog(Txi)+(1yi)log(1(Txi))) where (z)=(1+ez)1 is the logistic function. The given hwX.txt and hwY.txt contain
LR
Logistic Regression Consider the objective function in logistic regression problem \()= i=1m(yilog(Txi)+(1yi)log(1(Txi))) where (z)=(1+ez)1 is the logistic function. The given hwX.txt and hwY.txt contain theinputs xiR2 and outputs yi {0,1} respectively for a binary classification problem, with one training example per row. 1. (30 points) Implement the gradient descent method for optimizing l(), and apply it to fit a logistic regression model to the data. Initialize gradient descent method with =0 (the vector of all zeros). What are the coefficients resulting from your fit? (Remember to include the intercept term.) 2. (40 points) Implement Newton's method to maximize ((), and compare the overall running time and number of iterations needed to converge to the same precision. 3. (10 points) Plot the training data (your axes should correspond to the two coordinates of the inputs, and you should use a different symbol for each point plotted to indicate whether that example had label 1 or 0 ). 4. (20 points) Also plot on the same figure the decision boundary fit by logistic regression. (i.e., this should be a straight line showing the boundary separating the region where (Tx)>0.5 from where (Tx)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
