Skip to content
ML to LLMs
Cheat sheets

Model selection

What to try first for each kind of problem, what to try next, and the questions to ask before trusting any result.

Start simple, then earn complexity

Always fit a baseline first (predict the mean, the majority class, or a one-feature rule). A complex model only earns its place if it beats the baseline on a validation set that looks like production.

SituationStart withThen considerLessons
Continuous tabular targetLinear / ridge regressionRandom forest, gradient boostingLinear regression, Ensembles
Binary or multiclass tabularLogistic regressionXGBoost, LightGBM, CatBoostLogistic regression
Very small labeled datasetLogistic regression, Naive Bayes, KNNSVM, regularized linear modelsNaive Bayes
Sparse text with labelsTF-IDF + linear modelFine-tuned transformer encoderText to vectors
No labels, want groupsK-meansDBSCAN, hierarchical, Gaussian mixtureK-means
Rare events, few labelsIsolation-style anomaly scoring, thresholdsSemi-supervised, density modelsClustering
High-dimensional visualizationPCAUMAP / t-SNE (exploration only)PCA
Image classificationPretrained CNN or vision transformerFine-tuning, data augmentationCNNs
Sequences / time seriesLagged features + gradient boostingRNN/LSTM, temporal transformersRNNs
Text generationPretrained decoder LLM + promptingRAG, LoRA / PEFT, fine-tuningAdapting LLMs
Q&A over private or fresh knowledgeRetrieval + grounded generationHybrid search, rerankingRAG
Strict low latencySimple model or small encoderDistillation, quantization, cachingReliability and cost
Engineering note

For structured (tabular) data, gradient-boosted trees are usually the strongest baseline. For raw images, audio, and language, deep learning has the better inductive bias.

Choosing by constraint

If you need...PreferAvoid
Explanations stakeholders can readLinear / logistic regression, shallow treesDeep ensembles without explanation tooling
Calibrated probabilitiesLogistic regression, calibrated boostingRaw SVM scores, uncalibrated trees
Robustness to unscaled featuresTrees and tree ensemblesKNN, SVM, neural nets, K-means without scaling
Training on tiny dataStrong priors: Naive Bayes, regularized linearLarge neural networks from scratch
Fast inference on CPULinear models, small trees, distilled modelsKNN over large datasets, large transformers
Frequently changing factsRAG (change the context)Fine-tuning (changes weights, slow to update)
A new output format or stylePrompting, then fine-tuning / LoRARAG alone

How to study any model

  1. State the task and output type.
  2. Draw its input-to-output computation.
  3. Write its objective or loss.
  4. List assumptions and required preprocessing.
  5. Identify the key hyperparameters.
  6. Choose suitable evaluation metrics.
  7. Describe failure modes.
  8. Implement a baseline.
  9. Do error analysis and compare against a simpler model.

Questions to ask before trusting a result

  • Was the test set truly unseen and representative of production?
  • Could any feature leak the target or future information?
  • Is the metric aligned with the business cost of errors and with class imbalance?
  • How does the model perform across meaningful slices (segments, regions, time)?
  • Is it calibrated? Does confidence match observed accuracy?
  • What happens under missing values, drift, adversarial inputs, and outages?
  • Can the pipeline be reproduced from the data version, code version, configuration, and random seed?

See every model side by side in the model cards.