CommencerCommencer gratuitement

Normalization and Standardization

Feature scaling helps ensure that no feature dominates others during modeling. Normalization and Standardization are widely used feature scaling techniques. Normalization typically scales features in the range [0, 1] ensuring they have roughly the same scale. Standardization transforms the data to have zero mean and unit variance, maintaining more information about outliers and not bounding the range. matplotlib.pyplot has been imported as plt, MinMaxScaler and StandardScaler have been imported, and the split heart disease data features have been imported as X_train and X_test.

Cet exercice fait partie du cours

End-to-End Machine Learning

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Show the initial distribution of 'age'
age = ____
plt.figure(figsize=(10,5))
plt.hist(____, bins=30, alpha=0.5, label='Original')
plt.legend(prop={'size': 16})
plt.title('Histogram with Original Age'); 
plt.xlabel('Age'); plt.ylabel('Count');
plt.show()
Modifier et exécuter le code