July 2017
Intermediate to advanced
382 pages
9h 13m
English
Another common need in feature engineering is the handling of missing data. For example, we might have a dataset that looks like this:
In [11]: from numpy import nan... X = np.array([[ nan, 0, 3 ],... [ 2, 9, -8 ],... [ 1, nan, 1 ],... [ 5, 2, 4 ],... [ 7, 6, -3 ]])
Most machine learning algorithms cannot handle the Not a Number (NAN) values (nan in Python). Instead, we first have to replace all the nan values with some appropriate fill values. This is known as imputation of missing values.
Three different strategies to impute missing values are offered by scikit-learn:
Read now
Unlock full access