Skip to content
C.W.K.
Stream
Lesson 02 of 10 · published

Rules, Heuristics, Statistics, and ML

~28 min · framing, rules, statistics

Level 0Scout
0 XP0/48 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Similar tools, different responsibilities

Rules encode known conditions. Heuristics provide useful shortcuts when perfection is unnecessary. Statistics estimates relationships and uncertainty under modeling assumptions. Machine learning fits patterns that predict outcomes for new cases. They overlap, but differ in what is known at the start and how failure is diagnosed.

ToolBest fitRisk
RuleStable known logic, audit requiredBrittle on rare exceptions
HeuristicFast approximation, low stakesSilent bias accumulates
StatisticsInference and uncertaintyWrong causal story
MLPrediction from labeled examplesLeakage and drift

The simplest tool is the baseline

Pick the smallest mechanism that absorbs the meaningful variation. If a stable, inspectable rule works, replacing it with a model only adds cost. If stakeholders cannot define the target consistently, a model will hide that disagreement behind a number rather than resolve it. Require evidence that the baseline misses something valuable before adding ML.

They coexist in real systems

A fraud system might block confirmed schemes with rules, pause high-velocity accounts with a heuristic, monitor normal ranges statistically, and assign long-tail cases to a learned model. The important design question is which layer owns which cases and what takes over when that layer fails.

Tool choice is component design

Do not force policy, uncertainty estimation, pattern recognition, and fallback behavior into one opaque component. Give rules responsibility for explicit policy, statistics responsibility for uncertainty, and models responsibility for repeatable predictive variation. Clear boundaries make replacement, validation, and incident diagnosis easier than a fashionable all-purpose model.

Code

Decision boundary: when does ML earn its keep?·python
def choose_tool(problem):
    if problem.rule_is_stable and problem.exceptions_are_rare:
        return "rule"
    if problem.needs_uncertainty and problem.sample_size_is_small:
        return "statistics"
    if problem.labels_exist and problem.mistakes_are_measurable:
        return "ml"
    return "clarify_problem_before_modeling"
Rule + ML hybrid: rule wins, ML covers the long tail·python
def predict(row, rule_fn, model):
    rule_decision = rule_fn(row)
    if rule_decision is not None:
        return rule_decision  # auditable path
    return model.predict_proba([row.features])[0, 1] >= 0.42

External links

Exercise

Take one automation idea from your backlog. Write a one-paragraph case for solving it as a rule, as statistics, and as ML. Pick the winner and justify why the other two are worse for this specific decision.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.