September 2019
Intermediate to advanced
420 pages
10h 29m
English
Another common requirement 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 of the nan values with some appropriate fill values. This is known as the imputation of missing values.
Three different strategies to impute missing values are offered by scikit-learn:
Read now
Unlock full access