StudyHub

ML/DL · Hub

ML algorithms

Fourteen classic machine-learning algorithms: linear and logistic regression, KNN, Naive Bayes, trees and their ensembles (random forest, AdaBoost, gradient boosting), SVMs, four clustering methods (k-means, hierarchical, GMM, DBSCAN) and PCA for dimensionality reduction.

Why it matters: knowing what each algorithm assumes, what it costs and where it shines lets you pick a strong model in minutes instead of trying everything.

5 random questions mixed from all fourteen algorithms.

Quick comparison

AlgorithmTaskKey ideaMain hyperparameters
Linear regressionRegressionLeast-squares lineRegularization λ
Logistic regressionClassificationSigmoid of a linear scoreRegularization λ, threshold
KNNBothVote of nearest points$k$, distance
Naive BayesClassificationBayes' rule, independent featuresSmoothing
Decision treeBothPurest splitsMax depth, min samples per leaf
Random forestBothAverage of de-correlated treesNumber of trees, features per split
AdaBoostClassificationRe-weight mistakesRounds, learner depth
Gradient boosting / XGBoostBothTrees fit residualsRounds, learning rate, depth, λ
SVMClassificationMaximum marginC, kernel, gamma
k-meansClusteringNearest centroid$k$
HierarchicalClusteringMerge closest clustersLinkage, cut height
GMMClustering / densitySoft Gaussian components (EM)$K$, covariance type
DBSCANClusteringDense regions + noiseε, minPts
PCADimensionality reductionDirections of max varianceNumber of components

The fourteen algorithms

Linear regression

Fit the least-squares line.

best for: linear numeric targets · closed form

Study

Logistic regression

Turn a linear score into a probability.

best for: binary classification with probabilities

Study

KNN

Let the k nearest points vote.

no training · O(nd) per prediction · needs scaling

Study

Naive Bayes

Multiply prior and per-feature likelihoods.

training = counting · great for text

Study

Decision tree

Ask the question with the most information gain.

interpretable · overfits if unpruned

Study

Random forest

Average many de-correlated trees.

strong default · cuts variance

Study

AdaBoost

Weak learners that fix earlier mistakes.

sequential · sensitive to label noise

Study

Gradient boosting / XGBoost

Each tree fits the remaining error.

top accuracy on tabular data · tune carefully

Study

SVM

Widest street between the classes.

max margin · kernels · scale features

Study

k-means

Assign to nearest centroid, move centroids.

O(nkd) per iteration · choose k

Study

Hierarchical clustering

Merge the closest clusters into a dendrogram.

no k upfront · O(n²) memory

Study

Gaussian mixture model

Soft clusters fitted with EM.

probabilities · elliptical clusters

Study

DBSCAN

Clusters are dense regions; the rest is noise.

any shape · finds outliers

Study

PCA

Keep the directions with the most variance.

eigenvalues 4, 2, 1, 0.5 → 80% in 2

Study

Which one to pick?

flowchart TD
  A{"Do you have labels?"} -->|"no"| U{"Goal?"}
  U -->|"fewer features"| PCA["PCA"]
  U -->|"groups, k known, round"| KM["k-means"]
  U -->|"groups of any shape + outliers"| DB["DBSCAN"]
  U -->|"soft, overlapping groups"| GMM["GMM"]
  U -->|"structure at every scale"| HC["Hierarchical"]
  A -->|"yes"| T{"Number or category?"}
  T -->|number| R{"Linear enough?"}
  R -->|yes| LR["Linear regression"]
  R -->|no| GB["Gradient boosting / random forest"]
  T -->|category| C{"What matters most?"}
  C -->|"probabilities, interpretability"| LOG["Logistic regression"]
  C -->|"text, many sparse features"| NB["Naive Bayes"]
  C -->|"top accuracy on tables"| GB2["Gradient boosting / XGBoost"]
  C -->|"small data, clear margin"| SVM["SVM"]
  C -->|"readable rules"| DT["Decision tree"]
      

Key points

External resources

Videos

Review schedule

Come back after 3, 7, 14, then 30 days. Spacing beats cramming.

Feynman prompt

Explain this topic in your own words, as if teaching a beginner.

Explain it in your own words first, then record a 2–3 minute video on your phone.

25:00

Ready to record? Open your phone camera now and record a 2–3 minute explanation.

My notes

Saved only in this browser (localStorage). Nothing is uploaded.