Machine learning
Build models that hold up outside the notebook — from the first baseline to live monitoring.
A working checklist from framing to monitoring
What you'll take away
Frame the problem and choose a metric that matters
Avoid leakage and evaluate your model honestly
Ship, monitor and know exactly when to retrain
29 entries · click a command to copy
Frame the problem
Write down exactly what the model predicts and at what time.
Beat a simple rule or majority-class predictor before adding complexity.
Ensure no information from the future enters training features.
Choose one primary metric tied to the business decision.
Prepare data
Keep a final test set untouched until the model is chosen.
Estimate stability by rotating which fold is held out.
One-hot or target-encode categorical features inside the pipeline to avoid leakage.
Standardise or normalise when distance or gradients matter.
Impute within each fold, not on the full dataset.
Model families
Fast, interpretable baselines for numeric and linear-ish problems.
Rule-like models that handle non-linear thresholds and mixed features.
Bagged trees that reduce variance and resist overfitting.
Sequentially corrects errors; strong on tabular data.
Effective in high-dimensional spaces with clear margins.
Partition unlabelled data into K clusters by distance.
Useful for unstructured data (text, images, audio) or very large datasets.
Evaluate honestly
Precision measures false positives; recall measures missed positives; F1 balances them.
Ranking quality; PR-AUC is more informative on imbalanced data.
MAE is robust to outliers; RMSE penalises large errors more.
See exactly which classes are confused.
Check whether predicted probabilities match observed frequencies.
Imbalance and tuning
Penalise mistakes on the rare class more heavily.
Rebalance training data — never resample the test set.
Move the decision threshold to match the cost of each error type.
Systematic hyperparameter exploration with cross-validation.
Ship and monitor
Reproducibility requires all three, not just the weights.
Run the model alongside the old process before it makes live decisions.
Watch feature and prediction distributions for change.
Retrain on a schedule or when performance drops below a threshold.
This sheet was curated from reference material in the Skyware AI technical library (DS/ML cheat sheets (Avi Chawla)). Command syntax is factual; explanations, grouping and examples were written by our engineering team. Always verify syntax against your tool or database version.
More cheat sheets
Git commands
A practical Git reference grouped by task: setup, inspecting changes, commits, branches, remotes and undoing mistakes.
OpenSQL data cleaning
A task-oriented SQL reference for string cleanup, NULL handling, type conversion, dates, aggregation and deduplication.
OpenPandas essentials
The core Pandas operations you reach for daily, organised by task with short, copyable examples.
Open