Search for question
Question

Logistic Regression

3. Consider again the problem from Questions 1 and 2 in the first assignment where we want to predict the gender of a

person from a set of input parameters, namely height, weight, and age. Assume the same datasets you generated for

the first assignment. Use learning rate=0.01. Try different values for number of iterations.

a. Implement logistic regression to classify this data (use the individual data elements, i.e. height, weight, and age,

as features). Your implementation should take different data sets as input for learning.

b.

Plot the resulting separating surface together with the data. To do this plotting you need to project the data and

function into one or more 2D space. The best visual results will be if projection is done along the separating

hyperplane (i.e. into a space described by the normal of the hyperplane and one of the dimension within the

hyperplane)

c. Evaluate the performance of your logistic regression classifier in the same way as for Project 1 using leave-one-

out validation and compare the results with the ones for KNN and Naïve Bayes Discuss what differences exist

and why one method might outperform the others for this problem.

d. Repeat the evaluation and comparison from part c) with the age feature removed. Again, discuss

what differences exist and why one method might outperform the others in this case.