Data Science
Study notes for applied machine learning, written for interviews: every page ends in scenario questions answered out loud, and every number comes from one of two running examples. The pages are for reading, not running. Read Section 1 before Section 2; look terms up in the Glossary.
Question stars: β recall a fact Β· β β apply it to the running example Β· β β β diagnose a failure or design a trade-off.
Running examplesβ
- Machine failure β 10,000 machines, 3% fail in any 30-day window. Used by the ML Project Lifecycle and Classification.
- Bike-rental demand β hourly rentals from weather and time. Used by Regression.
Section 1: ML Project Lifecycleβ
1.1 Frame the problem β ML Project Lifecycleβ
- The decision, the label and the snapshot date β The snapshot date
- Rule baseline vs model β Is ML needed?
1.2 Explore β Exploratory Data Analysisβ
- Label audit β Start with the target
- Leak scan β Relationships and the leak scan
- Deliverable β Decision log
1.3 Preprocess β Data Preprocessingβ
- Leakage β The leakage bug that scores 0.99
- Missing values, outliers, scaling, encoding β Missing values Β· Outliers Β· Encoding
- One fitted object β The pipeline pattern
1.4 Features β Feature Engineering & Selectionβ
- Windows and ratios β Creating features
- Deletion β Selecting features
- SHAP β Explaining the model
1.5 Train and evaluate β Model Training & Evaluationβ
- Baselines β Baseline first
- Time-based splits β Choosing the validation split
- Sign-off β Evaluate and sign off
1.6 Production β Inference & Productionβ
- Batch vs online β Batch vs online inference
- Skew and drift β Training/serving skew Β· Monitoring and drift
- Impact β Delayed labels and proving impact
Section 2: Modelsβ
2.1 Shared concepts β Supervised Learningβ
- Splits and cross-validation β Cross-validation
- Biasβvariance β Biasβvariance trade-off
- Ensembles β Bagging vs boosting
2.2 Regression β Regressionβ
- Metrics β Evaluation metrics
- Penalties β Ridge Β· Lasso Β· ElasticNet
2.3 Classification β Classificationβ
- Thresholds β Evaluation metrics
- Imbalance β Handling class imbalance
2.4 Beyond supervised β Model Landscapeβ
- Unsupervised β Clustering Β· Anomaly detection
- Deep learning and RL β Deep learning Β· Reinforcement learning
Serving the model behind an API lives in AI Engineering. This section owns the decisions; that one owns the code.