1. Learn
  2. /
  3. Courses
  4. /
  5. Practicing Machine Learning Interview Questions in Python

Exercise

Simple imputation

As you saw in the last exercise, deleting data can reduce your dataset by too much. In an interview context, this can lead to biased results of your machine learning model.

A more dynamic way of handling missing values is by imputing them. There are a variety of ways of doing this in python, but in this exercise you will be using the SimpleImputer() function from the sklearn.impute module on loan_data.

You will then use pandas and numpy to convert the imputed dataset into a DataFrame.

Note that 2 steps are now added to the pipeline, Instantiate and Fit: Machine learning pipeline

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Subset loan_data's numeric columns and assign them to numeric_cols.