← Lesson
BitWithBite
AI & Machine Learning · Quick Reference

lesson-1.2 Cheat Sheet

AI & Machine Learning
In one line: Many algorithms — SVMs, k-NN, anything trained with gradient descent, PCA — are sensitive to feature magnitude. A feature ranging 0–1,000,000 will dominate a feature ranging 0–1...

Key Ideas

1Why scale at all?. Many algorithms — SVMs, k-NN, anything trained with gradient descent, PCA — are sensitive to feature magnitude. A feature ranging 0–1,000,000 will dominate a feature r...

Code Examples

from sklearn.preprocessing import StandardScaler, OneHotEncoder scaler = StandardScaler() X_train_scaled = scaler.fit_transform(X_train) # fit + transform on train X_test_scaled = scaler.transform(X_test) # transform ONLY on test encoder ...