Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Classical Machine Learning

Overview

Classical ML algorithms are the workhorses of industry. While deep learning gets headlines, classical ML models are used extensively in production systems due to their interpretability, efficiency, and strong performance on structured/tabular data.

graph TD
    A[Classical ML] --> B[Supervised Learning]
    A --> C[Unsupervised Learning]
    
    B --> D[Regression]
    B --> E[Classification]
    
    D --> F[Linear Regression]
    D --> G[Decision Trees]
    D --> H[Random Forest]
    D --> I[XGBoost]
    
    E --> J[Logistic Regression]
    E --> K[SVM]
    E --> L[Naive Bayes]
    E --> M[KNN]
    
    C --> N[Clustering]
    C --> O[Dimensionality Reduction]
    
    N --> P[K-Means]
    O --> Q[PCA]

Why Classical ML Still Matters

AdvantageDeep Learning
Interpretable (trees, linear models)Often black-box
Fast training and inferenceExpensive compute
Works on small datasetsNeeds lots of data
No GPU requiredGPU essential for large models
Strong on tabular dataStrong on images, text, audio
Well-understood theoryActive research area

Models in This Section

ModelTypeKey IdeaInterview Frequency
Linear RegressionRegressionLinear relationship⭐⭐⭐⭐⭐
Logistic RegressionClassificationSigmoid + cross-entropy⭐⭐⭐⭐⭐
Decision TreesBothRecursive partitioning⭐⭐⭐⭐
Random ForestBothBagging of trees⭐⭐⭐⭐
Gradient BoostingBothSequential error correction⭐⭐⭐⭐
XGBoostBothRegularized boosting⭐⭐⭐⭐⭐
LightGBMBothHistogram-based boosting⭐⭐⭐⭐
CatBoostBothOrdered boosting⭐⭐⭐
SVMBothMaximum margin⭐⭐⭐⭐
KNNBothInstance-based⭐⭐⭐
Naive BayesClassificationBayes + independence⭐⭐⭐
K-MeansClusteringCentroid-based⭐⭐⭐
PCADim. ReductionVariance maximization⭐⭐⭐⭐
EnsembleMeta-methodCombine models⭐⭐⭐⭐

When to Use What

graph TD
    A[Start] --> B{Data type?}
    B -->|Tabular| C{Interpretability needed?}
    B -->|Images/Text/Audio| D[Use Deep Learning]
    
    C -->|Yes| E{Linear relationship?}
    C -->|No| F[XGBoost/LightGBM]
    
    E -->|Yes| G[Linear/Logistic Regression]
    E -->|No| H[Decision Trees]
    
    I{Small dataset?} --> J[Linear Models, SVM]
    K{Large dataset?} --> L[Gradient Boosting, Random Forest]

The Ensemble Hierarchy

graph LR
    A[Single Decision Tree] --> B[High Variance]
    B --> C[Random Forest: Bagging reduces variance]
    B --> D[Gradient Boosting: Sequential reduces bias]
    C --> E[XGBoost: Regularized boosting]
    D --> E
    E --> F[LightGBM: Faster, histogram-based]
    E --> G[CatBoost: Better categorical handling]

Each subsequent model builds on the ideas of the previous, adding improvements for speed, accuracy, or handling specific data types.

Cross-References