March 2019
Intermediate to advanced
642 pages
22h 54m
English
Let's see how to scale data in Python:
>> data_scaler = preprocessing.MinMaxScaler(feature_range=(0, 1))
>> data_scaled = data_scaler.fit_transform(data)
A NumPy array of a specific shape is returned. To understand how this function has transformed data, we display the minimum and maximum of each column in the array.
>> print("Min: ",data.min(axis=0))>> print("Max: ",data.max(axis=0))
The following results are returned:
Min: [ 0. -1.5 -1.9 -5.4]Max: [3. 4. 2. 2.1]
Read now
Unlock full access