---
title: "5 Steps for Building Machine Learning Models for Business"
description: "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."
url: "https://swe.quest/articles/5-steps-for-building-machine-learning-models-for-business-9d6ce609a5ab2c3d"
canonical: "https://shopify.engineering/building-business-machine-learning-models"
source: "Shopify Engineering"
published: "2021-08-25"
difficulty: "medium"
kind: "How-to"
reading_minutes: 15
tags: ["machine-learning","ml-platform","evals"]
---

# 5 Steps for Building Machine Learning Models for Business

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2021-08-25, 15 min read, How-to. Original: [https://shopify.engineering/building-business-machine-learning-models](https://shopify.engineering/building-business-machine-learning-models)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)

## Prerequisites

- basic machine learning concepts ([easy posts on Machine learning](https://swe.quest/tags/machine-learning.md?difficulty=easy))
- classification metrics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Shopify, A/B testing, random forest, logistic regression

## Related posts

- [Shopify's Playbook for Scaling Machine Learning](https://swe.quest/articles/shopify-s-playbook-for-scaling-machine-learning-01ef31091481dd96.md): Shopify Engineering · 2022-02-11 · Easy · 12 min read · ML platforms, Machine learning, Threat detection, E-commerce
  Shopify'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.
- [Meta’s approach to machine learning prediction robustness](https://swe.quest/articles/meta-s-approach-to-machine-learning-prediction-robustness-f22ac7dca205dca9.md): Meta Engineering · 2024-07-10 · Easy · 7 min read · ML platforms, Recommendations & ranking, Ads, Observability
  Meta keeps its ads recommendation models reliable with a prediction robustness framework built from three parts: prevention guardrails, root-cause understanding and intrinsic model hardening.
- [Recommend API](https://swe.quest/articles/recommend-api-7ecced73a1a24709.md): Slack Engineering · 2022-09-06 · Medium · 10 min read · Recommendations & ranking, ML platforms, Privacy, System design
  Slack 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.
- [10 Lessons Learned From Online Experiments](https://swe.quest/articles/10-lessons-learned-from-online-experiments-ddcc212d6c480867.md): Shopify Engineering · 2021-06-17 · Medium · 12 min read · Analytics & OLAP, Testing, E-commerce
  Ten practical lessons from a year of online A/B experiments on Shopify's multi-currency, geolocation and translation features.
- [Rocket Money x Hugging Face: Scaling Volatile ML Models in Production​](https://swe.quest/articles/rocket-money-x-hugging-face-scaling-volatile-ml-models-in-production-acc7e904259d3114.md): Hugging Face · 2023-09-19 · Easy · 8 min read · Inference & serving, ML platforms, Machine learning, Caching, Payments & fintech
  Rocket 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
