August 2019
Intermediate to advanced
342 pages
9h 35m
English
In the following code, we see an example of feature engineering using the MinMaxScaler class of scikit-learn, aimed at scaling features to lie between a given range of values (minimum and maximum), such as 0 and 1:
from sklearn import preprocessing import numpy as np raw_data = np.array([ [ 2., -3., 4.], [ 5., 0., 1.], [ 4., 0., -2.]]) min_max_scaler = preprocessing.MinMaxScaler() scaled_data = min_max_scaler.fit_transform(raw_data)
Read now
Unlock full access