the fit_transform() method to learn the minimum and maximum value from the dataset and transform the dataset with those values. We can also use fit() and transform() methods separately.
The output of the program after the min-max scaling will be:
survived pclass sex age ... deck embark_town alive alone 0 0 3 male 0.271174 ... NaN Southampton no False 1 1 1 female 0.472229 ... C Cherbourg yes False 2 1 3 female 0.321438 ... NaN Southampton yes True 3 1 1 female 0.434531 ... C Southampton yes False 4 0 3 male 0.434531 ... NaN Southampton no True [5 rows x 15 columns]
As we can see, the new values in the age column are values within the range 0 to 1.








































0 Comments