ML Theory

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:25 AM on 7/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

14 Terms

1
New cards

Bias-variance decomposition

Expected test error = bias² + variance + irreducible noise. High bias = underfit (too simple); high variance = overfit (too sensitive to training set). Always tie to a concrete fix (more capacity ↓bias; regularization/more data ↓variance).

2
New cards

Regularization menu — L1 vs L2 vs dropout vs early-stop

L1 (Lasso): sparse weights → feature selection. L2 (Ridge): smooth shrinkage, small weights. Dropout: randomly zero units → ensemble effect. Early stopping: halt before it overfits. All fight variance.

3
New cards

AdamW vs Adam+L2 (the gotcha)

Adam+L2 couples weight decay INTO the gradient, so the adaptive learning rate scales it unevenly (weak decay on high-gradient params). AdamW DECOUPLES weight decay — applies it directly to weights — which is why AdamW generalizes better. Common follow-up.

4
New cards

Precision vs recall vs F1 — which matters more?

Precision = of predicted-positive, how many right (cost of false positives). Recall = of actual-positive, how many caught (cost of false negatives). F1 = harmonic mean. Answer is scenario-driven: spam→precision, cancer screen→recall.

5
New cards

ROC-AUC vs PR-AUC under class imbalance

The #1 cited gotcha: on rare-positive data ROC-AUC is optimistic because the huge true-negative count inflates it. PR-AUC (precision vs recall) ignores true negatives → far more informative when positives are rare.

6
New cards

Cross-validation types

k-fold (average over k splits) · stratified (preserve class ratios — use for imbalance) · time-series (NO shuffle; train on past, test on future — shuffling leaks the future). Match the split to the data's structure.

7
New cards

Data leakage — the canonical form

Fitting preprocessing (scaler, imputer, encoder, feature selection) on the FULL dataset before the train/test split → test info bleeds into training → inflated scores that collapse in production. Fit only on train, transform test. Drill jointly with cross-validation.

8
New cards

Bagging vs boosting

Bagging (Random Forest): train trees in PARALLEL on bootstrap samples, average → ↓variance. Boosting (GBM/XGBoost): train SEQUENTIALLY, each learner fixes the last's errors → ↓bias. Parallel-independent vs sequential-corrective.

9
New cards

Class imbalance — the menu

Resample (over/under, SMOTE) · class weights in the loss · adjust the decision threshold · pick the right metric (PR-AUC/F1, not accuracy). Choice "depends on cost asymmetry" between FP and FN.

10
New cards

Feature scaling — which models need it?

NEEDED for distance/gradient models (k-NN, k-means, SVM, linear/logistic, neural nets). NOT needed for tree-based models (splits are scale-invariant). Know BOTH directions — the "trees don't need it" half is the tell.

11
New cards

Curse of dimensionality

As dimensions grow, points become nearly equidistant (distance metrics lose meaning), data gets sparse, and you need exponentially more samples. Hits k-NN/clustering hardest → motivates dimensionality reduction.

12
New cards

SGD vs Adam

SGD (+momentum): simple, often better final generalization, needs LR tuning. Adam: per-parameter adaptive LR (fast convergence, robust to LR), sometimes worse generalization. Adam to move fast; SGD to squeeze final quality.

13
New cards

Data drift vs concept drift

Data drift = the input distribution P(X) shifts (new inputs). Concept drift = the relationship P(y|X) shifts (model wrong even on familiar inputs). Monitor input stats + prediction distribution + delayed-label metrics; respond with retrain / rollback. The production tail — my eval-eng turf.

14
New cards