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.

Kit, the ManuAI fox, pointing

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
Daily sales at Cô Lan's cart (invented data)
DayWeekdayWeather°CPrice (k đ)Sold
1MonSunny3020120
2TueSunny352092
3WedCloudy3020115
4ThuSunny3220110
5FriRain2720104
6SatSunny3120137
7SunSunny3420116
8MonCloudy2920117
9TueCloudy2920114
10WedSunny3120121
11ThuRain2620101
12FriSunny3120120
13SatSunny3120138
14SunSunny3320125
15MonSunny3025120
16TueCloudy3025107
17WedRain272591
18ThuSunny3325103
19FriSunny342593
20SatCloudy2925131
21SunSunny3225115
22MonSunny3025119
23TueRain272583
24WedSunny3225106
25ThuCloudy3025113
26FriRain272593
27SatSunny3125128
28SunSunny3525100
29MonCloudy2925111
30TueSunny322595

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?

Which chart answers it best?
Which chart answers it best?

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.

Really burntReally fine0255075100
BinnedSold
Really burnt12 caught0 missed
Really fine12 wasted16 fine
Precision50%
Recall100%

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.

010206:007:008:009:0010:00Time of morning
Learned fromHidden test

Train error

28.67

Test error

23.08

Error at every degree

123456789101112
Train errorTest error

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.

05101520036912SecondsTarget 10 m

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.

Where it really wentGPS dotsFiltered

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.

CartCustomer

Tap or drag across cells to add or remove walls. With a keyboard: arrow keys move, Space toggles a wall.

Cells checkedPath length
A*5720
Dijkstra15120
Greedy2920

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.

Model setting

Too small: crawling

Steps

0

Error

20.75