The loop
Read the context → pick the data, the model and the rule → study the validation evidence → adjust → deploy → compare validation with production → read why they differ.
All challenges and every certification for $9 a month. And learn to build, buy and guide AI agents for supply chain: https://www.skool.com/supplychain
You build a machine-learning system for a real supply chain decision: a camera that spots defective parts, a demand forecast, or an alert rule for failing pumps. You design it on the data you can see and test it there. Then you deploy, and it runs on data it has never seen. A model that only looked good in testing fails in production.
These steps work on every Model Studio contract, whichever of the three types it is.
Two short contracts at Kettle & Co come first. The camera intro offers only the threshold (no review band yet); the forecast intro offers three features, two models and two tests.
Each contract is one model for one decision. You can change the design as often as you like; you deploy once.
Read the context → pick the data, the model and the rule → study the validation evidence → adjust → deploy → compare validation with production → read why they differ.
Training data that represents production, decision thresholds set by the cost of each kind of mistake, human review for the uncertain middle, leakage (features you won't have at forecast time), validation that mimics real use, overfitting on small data, and maintenance rules that generalise to new machines.
The data you design on is not the data you are scored on. Production adds the night shift, the next season or a new pump. Choices that flatter the validation (day-only images, leaking features, a random split, a raw threshold) all fall apart when you deploy.
The engine runs three kinds of contract. The eyebrow on the context card tells you which one you are in, and the hint next to the deploy button says what production means.
A camera scores every machined part from 0 to 1 for how likely it is defective. You choose the training data, who makes the final call and the threshold. Production is every shift on the line, including the night shift. The top bar shows Defects caught, Good parts rejected, Defects shipped / week, Quality cost / week. Next to the deploy button: "Validate on the labelled images, then deploy on every shift."
The key idea: Weigh the two mistakes: a shipped defect costs far more than a scrapped good part. Send the uncertain middle to people.
Two years of weekly sales with promotions, prices, temperatures and shipments. You choose the features, the model and the validation design. Production is the next season, forecast weeks ahead for real. The top bar shows Accuracy (validation), Bias, Planner accuracy today, Features. Next to the deploy button: "Deploy when the validation is good and honest: the model then forecasts the season for real."
The key idea: For every feature ask: would I know this on the day I place the order? If not, leave it out.
Daily vibration readings from a fleet of pumps, with past failures marked. You choose the maintenance policy, the alert rule and how many spare parts to keep. Production is the next period, when a new, different machine joins the line. The top bar shows Unplanned failures, Failures prevented, Unneeded jobs, Maintenance cost. Next to the deploy button: "Deploy the rule and the policy on every pump, including the new one."
The key idea: Tune the rule so it works on every pump, including the one you have no history for.
The layout is the same for all three types: design on the left, evidence on the right, the result below once you deploy.
Every contract type follows this chain.
Card 2 in a vision contract. The model gives each part a score from 0 to 1; higher means more likely defective. A new run starts with the camera deciding alone, a threshold of 0.50 and a band of 0.40 to 0.60.
One slider, Scrap at or above. Every disc that scores at or above it is scrapped, every other disc ships. No labour cost, but one line has to serve both mistakes.
When to pick it: Only when defects and good parts get clearly different scores. Where they overlap, a high threshold ships defects and a low one scraps good parts by the thousand.
Two sliders. Below Send to an inspector from the disc ships; from Scrap from upwards it is scrapped; in between an inspector checks it. Inspectors catch most of the defects they see and wrongly reject very few good discs.
When to pick it: Usually the best answer. Set the low end below the lowest defect scores you can see, and the high end above the highest good scores. Only a small share of discs falls in between, so the review bill stays small.
The camera only highlights suspect areas; a person still decides on every disc, at the manual inspection cost per disc. With the highlights they catch about 98% of defects.
When to pick it: Safe, and it beats manual inspection on shipped defects, but the labour cost stays. It rarely captures much of the possible saving.
Card 1 in a vision contract. These are the sets in the brake disc contract; the label on the right shows the cost, or "Ready" if it is free. What the model learns from decides what it can see.
Free and ready now, from a pilot on day shifts. It has never seen the night shift's lighting.
What happens: A trap. It looks fine on daylight images and misses defects at night, where a large share of discs is made. Its data score is low.
Collected and labelled by trained inspectors on every shift, with deliberately more examples of the rare cracks.
What happens: The most expensive set and the one that represents production. Its cost is spread over a year, so it is small per week. It earns the full data score.
A lot of data, quickly, but a spot check found about 8% of labels wrong.
What happens: More data doesn't fix wrong labels: the model learns the mistakes and its scores for good and bad discs overlap more.
The intro's free set, from a pilot camera that only ran on day shifts.
What happens: The same trap as on the brake discs: under the night shift's lights it misreads reflections.
The intro's paid set, collected and labelled on both shifts.
What happens: It represents the line, so one threshold separates dented plates from good ones.
The validation set is a sample of labelled images, about half of them defective so that rare defects get tested. The cost per week uses the line's real, much lower defect rate.
The Projected cost per week card adds these lines. Your rates come from the validation images; volume and defect rate come from the line.
| Line on the card | How it is worked out | How to lower it |
|---|---|---|
| Defects shipped | Defects a week that pass as good × cost of a shipped defect | Catch more: a lower threshold, a review band or better training data. |
| Good discs scrapped | Good discs a week scored as defective × cost of a scrapped disc | Scrap less: a higher scrap threshold, with the doubtful ones going to review. |
| Discs checked by people | Discs sent to an inspector × review cost per disc (or the manual cost per disc when inspectors check every disc) | Narrow the review band to the scores where defects and good discs really overlap. |
| Camera system | A fixed weekly cost | Fixed. |
| Training data, spread over a year | The set's price ÷ 52 | Usually small. Don't save here. |
| Manual inspection today | Shipped defects at the inspectors' catch rate + every disc at the manual cost | The number to beat. |
Card 1 in a forecast contract. Each feature describes the week being forecast. The "When the forecast is made" card shows the rule: at the moment you order you know demand up to that week, the promotion and price plan, the calendar and the long-range weather forecast. Features only feed Linear regression and Gradient-boosted trees; the other models ignore them.
Demand 52 weeks earlier. It carries the season.
Keep it or not: Keep it. It needs a year of history, so the model then trains on the second year only.
Demand in the last week you know when you order, four weeks before the forecast week.
Keep it or not: Keep it. It tells the model whether this year runs above or below last year.
Whether the week has a promotion. Promotions are planned months ahead.
Keep it or not: Keep it. Promotions are the biggest driver after the season.
Set together with the promotion plan, so it moves with the promotion.
Keep it or not: Honest, but it mostly repeats the promotion. Adding it changes little.
The weather service's long-range forecast for the week. Less exact than the real temperature, but you have it in time.
Keep it or not: Keep it. It is the honest way to use the weather.
Measured during the week being forecast. You only know it after the goods have sold.
Keep it or not: Leakage. In validation it looks like a gift; in production only the long-range forecast exists, so the model loses its best input. Any leaking feature caps your score.
From the warehouse system. It is almost the same number as demand, measured in the same week.
Keep it or not: The worst leak: it predicts demand almost perfectly in validation because it nearly is demand. Four weeks ahead you only know an old value.
Known from the calendar.
Keep it or not: Honest and cheap to include.
Card 2 in a forecast contract. The orange line on the history chart is what the chosen model predicts for each week.
Next year's week equals last year's week. The benchmark every model must beat.
When to pick it: Fine as a yardstick, but it ignores this year's level and every promotion, so it often falls below the planners in production.
The average of the last four known weeks.
When to pick it: It always lags behind a season that is rising or falling. Weak for a seasonal product.
A weighted sum of the features you tick. Easy to explain.
When to pick it: A solid, honest choice with the right features. It can't learn that a promotion matters more in hot weeks.
Many small decision rules added together. Finds patterns such as a promotion in a hot week, and can overfit small data.
When to pick it: Give it the full set of honest features. With three features or fewer on two years of weekly data, it tends to learn noise.
Card 3 in a forecast contract: how you test the model before trusting it. Production refits the model on all the history and forecasts the next weeks with only what is known in time.
One week in five is held out, scattered across the two years, and every feature uses its real value.
How far to trust it: Flatters the model. It learns from the weeks either side of each test week, and leaking features look perfect. Shown as blue dots on the chart.
Train on the past, test on the most recent 13 weeks. Features still use their real values.
How far to trust it: Better, but a leaking feature still looks great here, because the real temperature or shipments are in the data.
Test on the last 13 weeks using only what would have been known four weeks ahead.
How far to trust it: The honest test. Its accuracy is close to what production will show, which is what the validation part of the score rewards.
Accuracy is 100% minus WMAPE: the sum of absolute weekly errors divided by the sum of actual demand. Bias is total forecast minus total actual, as a share of actual; plus means the model forecasts too much.
Card 1 in a maintenance contract. By default a breakdown costs €18,000, a planned bearing change €2,500 and a spare on the shelf €40 a day; the context card gives the contract's own figures.
Your alert rule runs every day on every pump. After an alert a technician changes the bearing a few days later.
When to pick it: The policy the sensors were fitted for. It prevents bearing failures and leaves healthy pumps alone, if the rule is good.
Every pump gets a new bearing every N days, whatever the sensors say. The slider runs from 10 to 120 days.
When to pick it: Replaces bearings that are fine and still misses failures that come early. Costly on both counts.
Repair what breaks. Nothing is planned.
When to pick it: The baseline you must beat. Every breakdown stops a line. Set spares to 0 if you pick it, or you pay to store parts you never use.
Card 2 with the condition-based policy. Pick a signal, then set Alert when the signal reaches and For this many days in a row (1 to 5, 2 by default). No rule can alert on a pump until it has 14 days of readings.
The sensor value in mm/s. One threshold for every pump.
When to pick it: Tuned on the old pumps, it fires constantly on a bigger pump that simply vibrates more when healthy.
Percent above the pump's own median in its first 14 days.
When to pick it: Generalises: every pump, old or new, is compared with its own healthy level.
The average of the last three days against a week earlier, in mm/s.
When to pick it: Also pump-independent, because it looks at change, not level. Noisier, so require two or three days in a row.
A failing bearing announces itself: in the weeks before it fails, vibration climbs steadily to about 2.1 times the pump's normal level. Electrical faults give no warning at all.
The history is replayed with your current rule and policy, so the backtest updates as you move the sliders.
Everything is done with the mouse. There are no keyboard shortcuts.
The score out of 100 is worked out on production only, with fixed weights per contract type. The projected score you see before deploying is 80% of the saving or accuracy on the visible data, so it never goes above 80.
| Part | Weight | What counts |
|---|---|---|
| Quality cost saved | 50% | Vision quality control. On the line, (manual inspection cost − your weekly cost) as a share of (manual cost − the best setup's cost). The best setup is found by trying every training set, threshold and band. |
| Defects kept away from customers | 30% | Vision quality control. Defects shipped per week on the line against manual inspection: 100 if you ship half as many or fewer, 50 for the same number, 0 at one and a half times as many. |
| Representative training data | 20% | Vision quality control. The data score of the training set you chose: how well it represents every shift and defect. |
| Forecast accuracy in production | 45% | Demand forecasting. Production accuracy against the best honest model on this data: 6 points off for every percentage point short. |
| Validation that predicted production | 20% | Demand forecasting. How well validation predicted production: 6 points off for every point validation was more optimistic, beyond a 3-point allowance. |
| Only features known at forecast time | 20% | Demand forecasting. 100 if every feature is known at forecast time, 0 if any is not. |
| No systematic bias | 15% | Demand forecasting. Production bias in either direction: 8 points off per percentage point. |
| Maintenance cost against breakdowns | 50% | Predictive maintenance. On the next period, (run-to-failure cost − your cost) as a share of (run-to-failure cost − the best policy's cost). |
| Breakdowns prevented | 30% | Predictive maintenance. The share of failures your policy prevented, plus 20 points, up to 100. So 80% prevented already scores full marks. |
| Few unneeded maintenance jobs | 20% | Predictive maintenance. The share of bearing changes that were really needed, plus 20 points, up to 100. No planned changes at all scores 100, except fixed interval, which scores 0. |