← Machine Learning for EveryoneToolsInVisionLearning Center
Rules and Explanations · Lesson 61

Learn If-Then Rules

Operations staff write a rule for rainy long routes.

Read the full lesson and open its transcript below. A narrated video will be added after production.

Lesson overview

What you will learn

Operations staff write a rule for rainy long routes.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

A dispatcher suggests, 'If it is raining and the route is long, send a warning.' That sentence is a rule, but we still need to define long, decide when rain information is available, and say what happens when only one condition is true.

02

The useful idea

Write the conditions and action precisely enough that two people classify the same trip the same way. Test on past trips not used to invent the rule. A readable rule is easier to review, but clarity doesn't make it accurate.

03

Work through the example

Show the rule to operations staff with one matching and one nonmatching example. Ask whether the recommended action fits the workflow and how they want borderline cases handled. An if-then rule can be easy to explain: if a route and weather condition are present, issue a warning. Check how many held-out trips actually satisfy the rule and how often it is right there. A rule that describes one historic exception may sound persuasive but have little coverage. Ask a dispatcher whether its conditions are known before departure and whether the warning would change an action. Keep the exact wording and version so future decisions can be audited. Now check the idea on a concrete example: Check whether the rule's conditions and prediction are understandable to a reviewer. A possible trap is worth naming: Readable rules can still be wrong or unfair. The answer follows from that evidence: An if-then rule links conditions to a proposed outcome or action. Show the rainy-long-route rule to a dispatcher alongside a matching delivery and a near miss. Can they tell why one triggers and the other does not? A readable rule supports review only when its feature definitions and prediction time are clear.

04

Limits and next step

Next, we'll measure how many trips the rule covers and how often its warnings are right.

Worked example

Check whether the rule's conditions and prediction are understandable to a reviewer.

Knowledge check

Quick check: test your understanding

Try it yourself: Consider this case: Check whether the rule's conditions and prediction are understandable to a reviewer. Explain how you would check the result. In your answer, address this limitation: Readable rules can still be wrong or unfair.

Check the reasoning

An if-then rule links conditions to a proposed outcome or action. Readable rules can still be wrong or unfair.

What is the main idea behind learn if-then rules?

An if-then rule links conditions to a proposed outcome or action.

How is it used in the example?

Check whether the rule's conditions and prediction are understandable to a reviewer.

What limitation should be checked?

Readable rules can still be wrong or unfair.

Further reading

Machine Learning — Tom M. Mitchell.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 61 transcript298 words · Narration ready for the upcoming videoOpen transcript

A dispatcher suggests, 'If it is raining and the route is long, send a warning.' That sentence is a rule, but we still need to define long, decide when rain information is available, and say what happens when only one condition is true.

Write the conditions and action precisely enough that two people classify the same trip the same way. Test on past trips not used to invent the rule. A readable rule is easier to review, but clarity doesn't make it accurate.

Show the rule to operations staff with one matching and one nonmatching example. Ask whether the recommended action fits the workflow and how they want borderline cases handled. An if-then rule can be easy to explain: if a route and weather condition are present, issue a warning. Check how many held-out trips actually satisfy the rule and how often it is right there. A rule that describes one historic exception may sound persuasive but have little coverage. Ask a dispatcher whether its conditions are known before departure and whether the warning would change an action. Keep the exact wording and version so future decisions can be audited. Now check the idea on a concrete example: Check whether the rule's conditions and prediction are understandable to a reviewer. A possible trap is worth naming: Readable rules can still be wrong or unfair. The answer follows from that evidence: An if-then rule links conditions to a proposed outcome or action. Show the rainy-long-route rule to a dispatcher alongside a matching delivery and a near miss. Can they tell why one triggers and the other does not? A readable rule supports review only when its feature definitions and prediction time are clear.

Next, we'll measure how many trips the rule covers and how often its warnings are right.