5 Steps for Building Machine Learning Models for Business
A five-step workflow for building ML models in a business context: confirm ML is warranted (defer it for brand-new products and beat a heuristic baseline first), start with simple models and basic features or off-the-shelf pretrained components, and pick a metric tied to business impact before optimizing. The advice also covers sanity-checking outputs via confusion matrices and residuals, since 98% accuracy on rare-event fraud data can mean a useless model. Model iteration should run through staging flows or A/B tests with fair comparisons and attention to run-to-run variance, and teams should watch prediction stability for individual users across retrains.
Related posts
- Shopify's Playbook for Scaling Machine Learning
Shopify Engineering easyNoviceShopify's approach to scaling machine learning grew out of its first ML product, an order fraud detector that replaced a rule-based system with a high false-positive rate. Teams should pick a problem users care about, confirm the data is trustworthy and accessible, account for downstream dependencies such as fulfillment, and optimize for product outcomes rather than raw model scores. Shopify shipped a simple logistic regression model, built in Python, serialized to PMML, scheduled with Airflow and served in real time from Rails. To scale to hundreds of models, Shopify relies on input/output reconciliation, shadow backtesting, drift monitoring, platform-enforced best practices and automated model operations.
- Meta’s approach to machine learning prediction robustness
Meta Engineering easyNoviceMeta keeps its ads recommendation models reliable with a prediction robustness framework built from three parts: prevention guardrails, root-cause understanding and intrinsic model hardening. The framework covers models, features, training data, calibration and interpretability. Snapshot Validator evaluates every new model snapshot against holdout data before it serves traffic, which cut snapshot corruption by 74% across more than 90% of ads ranking models. Feature and label anomaly detection automatically blocks bad data, and the Hawkeye debugging toolkit with model graph tracing halved time to root-cause. The account stays high-level, naming techniques such as gradient clipping, robust quantization and training-serving consistency without implementation detail.
- Recommend API
Slack Engineering mediumAdeptSlack built a unified Recommend API so product teams can bootstrap new ML recommenders from reusable components (fetchers, filters, feature augmentation via a Feature Store, model scoring and rerankers) instead of building bespoke systems. Server-side feature logs and client-side interaction logs are joined in Airflow to produce training data, and models such as logistic regression and XGBoost are trained as Kubernetes Jobs and monitored with Prometheus, online CTR/DCG and feature-drift metrics. Hand-tuned heuristic models solve cold start until enough data exists, and privacy is preserved by using de-identified usage metadata and only cosine similarity from an external embedding model. A/B tests showed CTR gains such as +38.86% for Composer DMs and +123.57% for Slackbot leave suggestions after moving from hand-tuned to learned models.
- 10 Lessons Learned From Online Experiments
Shopify Engineering mediumAdeptTen practical lessons from a year of online A/B experiments on Shopify's multi-currency, geolocation and translation features. Randomization units should be independent (user rather than session, to avoid carryover), and simulations are a fast way to check statistical worries such as false-positive inflation when randomization and analysis units differ. A/A tests with redirects surfaced sample ratio mismatch caused by bots and client-side pageview logging, and in another experiment SRM traced to cookie-based qualification logic flipped the result from negative to positive. Other lessons: understand your data pipeline and log generously, peek at results (without stopping early) to catch outliers like a single high-volume store, and slice results by segment because the overall number is only an average.
- Rocket Money x Hugging Face: Scaling Volatile ML Models in Production
Hugging Face easyNoviceRocket Money replaced a regex-and-decision-table merchant detector with a BERT-family transformer classifier spanning 4000+ classes, served through Hugging Face's hosted Inference API rather than an in-house MLOps stack. They picked it over AWS SageMaker and a hand-rolled host after a three-month evaluation with gradual traffic ramps and worst-case load tests. An A/B split of new users showed better paid retention, and the rollout reached 100% over two months. A pre-inference cache cut costs, hitting about 85% hit rate in production against a theoretical 93%, as volume grew past a billion transactions per month. The team hit an outage when expanding classes and a stale-model caching bug on the vendor side, and so far has found LLMs slower and costlier than specialized classifiers.