Min-Max scaling, Z-score standardization, One-Hot Encoding, and Euclidean distance.
Feature scaling (Min-Max Normalization and Z-score Standardization) is essential in Machine Learning to ensure all features contribute equally to gradient descent.
Standardization is putting apples, elephants, and rocket ships on the exact same zero-centered scale (mean 0, variance 1) so algorithms can compare them fairly.
Z-score formula: $Z = \frac{X - \mu}{\sigma}$. Min-Max formula: $X_{norm} = \frac{X - X_{min}}{X_{max} - X_{min}}$.
X_norm = (X - X.min(axis=0)) / (X.max(axis=0) - X.min(axis=0))mean = X.mean() # Computes 1 global mean across all different feature columns!mean = X.mean(axis=0) # Computes separate mean per feature columnFeature scaling must always use `axis=0` to scale each column feature independently.
Solve the objective below using NumPy vectorized syntax
Given `p1 = np.array([0, 0])` and `p2 = np.array([3, 4])`, compute Euclidean distance `np.linalg.norm(p1 - p2)` and print.
5.0