Lab · Data & robots
Data & Robots Lab
Seven small stations about how data turns into decisions and how robots move. They all run on one invented business: Cô Lan's bánh mì cart.
Kit
Start anywhere. Each station has a short challenge, and I tick it off when you crack it.

0 of 7 challenges done
Cô Lan's notebook
Thirty days at a bánh mì cart in Saigon. The numbers are made up, but shaped like a real cart: weekends are busy, rain keeps people home, very hot mornings cost a few sales, and the price went from 20,000 đ to 25,000 đ on day 15.
Show all 30 days
| Day | Weekday | Weather | °C | Price (k đ) | Sold |
|---|---|---|---|---|---|
| 1 | Mon | Sunny | 30 | 20 | 120 |
| 2 | Tue | Sunny | 35 | 20 | 92 |
| 3 | Wed | Cloudy | 30 | 20 | 115 |
| 4 | Thu | Sunny | 32 | 20 | 110 |
| 5 | Fri | Rain | 27 | 20 | 104 |
| 6 | Sat | Sunny | 31 | 20 | 137 |
| 7 | Sun | Sunny | 34 | 20 | 116 |
| 8 | Mon | Cloudy | 29 | 20 | 117 |
| 9 | Tue | Cloudy | 29 | 20 | 114 |
| 10 | Wed | Sunny | 31 | 20 | 121 |
| 11 | Thu | Rain | 26 | 20 | 101 |
| 12 | Fri | Sunny | 31 | 20 | 120 |
| 13 | Sat | Sunny | 31 | 20 | 138 |
| 14 | Sun | Sunny | 33 | 20 | 125 |
| 15 | Mon | Sunny | 30 | 25 | 120 |
| 16 | Tue | Cloudy | 30 | 25 | 107 |
| 17 | Wed | Rain | 27 | 25 | 91 |
| 18 | Thu | Sunny | 33 | 25 | 103 |
| 19 | Fri | Sunny | 34 | 25 | 93 |
| 20 | Sat | Cloudy | 29 | 25 | 131 |
| 21 | Sun | Sunny | 32 | 25 | 115 |
| 22 | Mon | Sunny | 30 | 25 | 119 |
| 23 | Tue | Rain | 27 | 25 | 83 |
| 24 | Wed | Sunny | 32 | 25 | 106 |
| 25 | Thu | Cloudy | 30 | 25 | 113 |
| 26 | Fri | Rain | 27 | 25 | 93 |
| 27 | Sat | Sunny | 31 | 25 | 128 |
| 28 | Sun | Sunny | 35 | 25 | 100 |
| 29 | Mon | Cloudy | 29 | 25 | 111 |
| 30 | Tue | Sunny | 32 | 25 | 95 |
Station 1: Pick the right chart
Kit
A chart answers one question, so I always ask what the question is before I draw. Change over time wants a line. Comparing a few groups wants bars. Parts of one whole can be a pie, as long as there are only a few parts. Two measured numbers that might move together want a scatter plot.
Challenge · Not yet
Choose the best chart for all four questions.
Question 1 of 4
0 of 4 right so far
How did daily sales change over the month?
Station 2: Precision and recall
Kit
Cô Lan's oven camera gives every loaf a burnt score. I have to pick a line, and every loaf above it goes in the bin. Put the line low and I catch all the burnt ones but bin good bread too. Put it high and nothing good is wasted, but burnt loaves get sold. Precision asks: of the loaves I binned, how many were really burnt? Recall asks: of the burnt loaves, how many did I catch?
Challenge · Not yet
Catch at least 10 of the 12 burnt loaves and throw away no more than 3 good ones.
| Binned | Sold | |
|---|---|---|
| Really burnt | 12 caught | 0 missed |
| Really fine | 12 wasted | 16 fine |
Caught 12 of 12 burnt loaves, wasted 12 good ones.
Station 3: Overfitting
Kit
Here is one busy morning at the cart, sales counted every 10 minutes. I learn a curve from the solid dots, then check it on the hollow dots I never saw. A bendier curve (a higher degree) always fits the solid dots better. Past a point it starts copying the noise, and the error on the hidden dots shoots up: it has overfitted.
Challenge · Not yet
Find the degree with the lowest test error.
Train error
28.67
Test error
23.08
Error at every degree
Station 4: PID control
Kit
My delivery drone has to hover at 10 metres. P pushes harder the further off I am, but on its own it overshoots and swings. D watches how fast I am moving and brakes, which calms the swing. With only P and D, gravity still holds me a little low, so I keeps a running total of that leftover error and pushes it away.
Challenge · Not yet
Reach 10 m with under 10% overshoot and stay within half a metre from 6 seconds on.
Overshoot
91%
Settles at
never
Off by at the end
9.02 m
Station 5: Kalman filter (the EKF idea)
Kit
A scooter's GPS jumps around by several metres. I also know roughly how fast it is going and which way. A Kalman filter blends the two: guess where the scooter should be, look at the GPS, and move part of the way toward it. How far depends on which one I trust more. Robots and phones use the extended version, the EKF, when the motion curves; the loop is the same.
Challenge · Not yet
Make the filtered path less than half as far off as the raw GPS.
GPS off by
11.2 m
Filtered off by
6.8 m
Station 6: A* path finding
Kit
My robot needs a way from the cart to a customer. Dijkstra searches in rings around the start: it never misses, but it checks a lot. Greedy rushes at whatever looks closest to the goal and walls can fool it. A* adds the distance already walked to a guess of what is left, so it heads for the goal and still finds a shortest path.
Challenge · Not yet
Draw walls so greedy's path ends up longer than A*'s.
Tap or drag across cells to add or remove walls. With a keyboard: arrow keys move, Space toggles a wall.
| Cells checked | Path length | |
|---|---|---|
| A* | 57 | 20 |
| Dijkstra | 151 | 20 |
| Greedy | 29 | 20 |
Station 7: Gradient descent
Kit
Training a model means walking downhill on its error. I feel the slope where I stand and take a step down. The learning rate is the size of that step. Too small and I am still walking at dinner time. Too big and I jump right over the valley, each jump wilder than the one before.
Challenge · Not yet
Reach the bottom of the valley in 8 steps or fewer.
Too small: crawling
Steps
0
Error
20.75