Objective
The goal of this homework is to give you exposure to the practice of training and testing machine-learning models. In particular, you need to build a logistic regression classifier. The performance of those classifiers should be measured by accuracy. The task is to classify patients into high medical spending and low medical spending. The primary goal of the assignment is for you to learn to experiment with feature engineering, and to review some concepts weve covered in class.
Data
The data (a1_data.csv) for this assignment was prepared for you. The data preprocessing steps explained in the linear algorithms notebook (week 4), including combining CHBMIX42 and BMINDX53, removing outliers, and creating dummy variables, were applied. You should use this file as a data source.
What to do
This is a fairly open-ended assignment, but I would recommend applying three different feature engineering methods. The first two of them are introduced in the section about common mistakes in linear regression.
Linearity
Although linear regression and logistic regression assume a linear relationship between dependent and independent variables, the actual data distribution might not follow linearity. If this is the case, you may apply polynomial terms. Please see p.10 in the week 4 slides.
- Multicollinearity
Although linear regression and logistic regression assume no or little multicollinearity between independent variables, it might not be true in your data. If you find multicollinearity between independent variables, then you can multiply them. Please see p.11 to p.13 in the week 4 slides.
- Noisy feature
- In most cases, having more independent variables (i.e., features) helps to build a better model. However, if there is only a random pattern between an independent variable and a dependent variable, then it might be better to drop the independent variable.
https://drive.google.com/file/d/1cvim3wi-n9Bqq300e…https://drive.google.com/file/d/1Ptp_2fp56wftubSP6…