MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

End-to-End Machine Learning

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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()
Edit dan Jalankan Kode