Machine Learning
Models that learn from examples — how the common families work, and when a simpler one would have been better.
22 articles, newest first.
- DBSCAN, and when density beats centroids k-means needs k and assumes round clusters of similar size. Density-based clustering needs neither, and it can say that a point belongs to nothing at all.
- Partial dependence plots and what they quietly assume PDPs average over the rest of the data, which means they can describe combinations that never occur. ICE curves, correlated features, and how to read both without overclaiming.
- Feature importance is not explanation Impurity importance, permutation importance, and SHAP each answer a narrower question than people think — and none of them answers "what causes what".
- Class imbalance: move the threshold before you reach for SMOTE Imbalanced classes are usually a thresholding and metrics problem, not a data problem. What actually helps, what mostly does not, how to pick a threshold from the cost of each mistake, and in which order to try things.
- TF-IDF still works, and it should be your first NLP model Before reaching for a transformer: a TF-IDF plus linear classifier baseline trains in seconds, explains itself, and is embarrassingly hard to beat on many text tasks.
- Always build the dumb baseline first Majority class, yesterday-equals-today, one rule of thumb: an hour spent on a deliberately dumb baseline is the best ROI in a data project.
- Your model says 90%. Should anyone believe it? Probability calibration: why good classifiers output bad probabilities, how to see it with a reliability curve, and when Platt scaling or isotonic regression fixes it.
- Reading SHAP values correctly SHAP explains one prediction against a baseline, not the world. What the numbers mean, what the plots hide, and the readings that get a model into trouble.
- Encoding categorical variables without shooting yourself One-hot, ordinal, target encoding, and the high-cardinality problem — which encoding to use when, and the leakage trap inside target encoding.
- Gradient boosting is still the default for tabular data Why LightGBM/XGBoost keep beating neural networks on tables, the five hyperparameters that matter, and the standard mistakes — including early stopping done wrong.
- Cross-validation without fooling yourself K-fold is the easy part. Grouped data, temporal data, and the quiet ways a validation scheme overstates how good your model really is.
- Accuracy is almost never the metric you want On imbalanced problems, a model that does nothing scores 99%. Precision, recall, PR curves, and how to pick a metric that matches the cost of being wrong.
- Data leakage is why your model looks too good If your validation score seems miraculous, the most likely explanation is that the answer leaked into the features. The common leaks, two worked through end to end, and how to audit for them.
- Start with the simplest model that could possibly work Linear regression is not beneath you. Reaching for deep learning first is usually a mistake — here is the discipline that replaces it, and when to escalate.
- Reinforcement learning, and what AlphaGo taught Learning from consequences instead of answers: agent, reward, and the credit assignment problem — plus an honest account of why reinforcement learning is rare in normal data work.
- Gradient boosting, built one mistake at a time How boosting works from scratch: fit a model, fit the next one to what the first got wrong, then repeat. Why that is not bagging, and what the learning rate really buys.
- Overfitting and the bias-variance tradeoff What overfitting really is, what bias and variance each mean in concrete terms, how the tradeoff shows up in model choice, and where the classic curve stops holding.
- K-means clustering, and what it is really doing The assign-and-update loop from scratch, what k-means actually minimises, why it only finds round clusters of similar size, and how to choose k without fooling yourself.
- PCA explained from first principles What a principal component actually is, why scaling comes first, how to read a scree plot, and the two things people wrongly expect PCA to do for them.
- Logistic regression from first principles Why a straight line cannot predict probabilities, what the log-odds link fixes, how to read a coefficient as an odds ratio, and why the loss is cross-entropy.
- Decision trees and random forests, from the split up How a tree decides which question to ask, why a single deep tree memorises its training data, and why averaging hundreds of decorrelated trees fixes it.
- Automation and jobs: picking the right unit of analysis Why "will automation take my job" is the wrong question, what a task-level view shows that a job-level view hides, and how to reason about it without hype or doom.