ML
    beginner

    Feature Scaling

    algorithms.live

    Gradient Descent: Unscaled vs. Scaled Loss Surface

    5:1

    Feature 2 is 5× larger than Feature 1

    Test which scaler resists one extreme point

    Progress0/60
    StandardScaler
    x' = (x − μ) / σ
    Best for: SVM, KNN, neural networks, PCA — general default
    StandardScaler()
    🌳 Tree Models Exception
    Decision Trees, Random Forest, and XGBoost use feature splits — not distances or gradients — so scaling has zero effect on their predictions.
    ⚠ Unscaled — Elongated Contours
    w₁w₂optimal
    0
    steps
    3.96
    dist to opt
    ✓ Scaled (StandardScaler) — Circular Contours
    w₁w₂optimal
    0
    steps
    3.96
    dist to opt

    Scaler Cheatsheet — click to select

    Does this model care about scale?

    Sort

    Sort each algorithm by whether feature scaling changes its result.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Needs scaling

    Drop items here

    Indifferent to scale

    Drop items here
    6 pieces left to place

    Test your knowledge

    21 questions
    Question 1 of 21
    Score: 0

    Why is feature scaling important for KNN?

    Interview Questions

    Google
    Amazon
    Microsoft
    LinkedIn
    Workday
    ADP
    Uber
    DoorDash
    Instacart
    OpenAI
    NVIDIA
    Intel

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required