Is an extreme value an error or real data?
Decide what each extreme value is by looking at its other columns: impossible, explainable or pending, and write it down before you touch it.
Free course. Your Maestro, an AI, .
You have a list of suspects: three trips of more than 1,300 minutes, six of less than a minute, a 96-minute ride and three records with birth year 1900. An extreme value is a value far from the rest. That doesn't make it an error. There are real extremes (a bulk order, a long ride) and errors that don't even look extreme.
The answer is almost never in the column where you spotted the extreme. It's in the other columns of the same row: what time it started, how far apart its stations are, which station it left from, what type of user it was. A row is a whole case; you read the whole case.
Start with the easiest suspect. Place a bet before you read on.
Check yourself: Trip 40478 lasts 96.4 minutes, five times the median. It started on Saturday, March 14 at 11:07 a.m. at Parque Alameda, ended at the same station and was taken by an occasional user. What is most likely?
For each suspect, ask: what do its other columns say, and what can't they tell us? The answers fall into three families: probable error, plausible data, or pending. For the day-long trips, the stations are less than a kilometer apart in a straight line; we don't know how far the bikes traveled. The duration and closure times make a recording problem worth investigating, but do not make the trip physically impossible. A long ride can return close to its start. Classify provisionally and note what needs confirmation.
A value far from the rest
What do its other columns say?
Path 1 of 3: suggest an error
Probable error
Compare figures with and without it; confirm
Continues at: Write it in your log
Path 2 of 3: are compatible
Plausible data
Keep it provisionally
Continues at: Write it in your log
Path 3 of 3: they aren't enough
Pending
You ask whoever knows the data
Continues at: Write it in your log
Write it in your log
Three trips of more than 1,300 minutes
Worked example · 5 steps
Three trips last between 1,317 and 1,453 minutes: almost a whole day. Are they errors or real trips?
Work out the next step yourself, then open it to compare.
Try it: the trips under a minute
Now the other extreme. Run the code and read the other columns of the trips under a minute. Before you decide, ask yourself what would have to happen for a trip to last 20 seconds.
Your turn
Run the code and look at the other columns of the trips under a minute. Then change the filter to < 5 and compare the extra trips that show up.
Data: viajes-rueda, 311 rows
| Row | Remove | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ||||||||||
| 2 | ||||||||||
| 3 | ||||||||||
| 4 | ||||||||||
| 5 | ||||||||||
| 6 | ||||||||||
| 7 | ||||||||||
| 8 | ||||||||||
| 9 | ||||||||||
| 10 | ||||||||||
| 11 | ||||||||||
| 12 | ||||||||||
| 13 | ||||||||||
| 14 | ||||||||||
| 15 | ||||||||||
| 16 | ||||||||||
| 17 | ||||||||||
| 18 | ||||||||||
| 19 | ||||||||||
| 20 |
Enter saves; Esc undoes; empty is a missing value
Tab indents; Esc then Tab leaves
The six records under a minute start and end at the same station. They are compatible with failed starts, but confirm whether they count as trips under the operational definition. With < 5, two more appear, lasting 4.4 and 4.9 minutes between stations half a kilometer apart: plausible short trips. The cutoff changes what you count.
Here is the provisional list:
| Suspect | Observed evidence | Hypothesis | Next step |
|---|---|---|---|
| 3 records over 1,300 min | Stations under 1 km apart; closures next day near 8:40 p.m. | Duration-recording problem | Compare summaries with and without them; confirm with operations |
| 6 records under 1 min | Same station, distance between stations 0 | Failed starts | Confirm whether they count as trips and state the criterion |
| Trip 40478, 96.4 min | Saturday 11:07 a.m., occasional, round trip | Plausible long ride | Keep provisionally |
| 3 records with year 1900 | Subscriber label and suspicious year | Filler value | Confirm before treating it as an age |
None of this changes the table yet. Removing, correcting or flagging rows is cleaning, covered in another free Maestro course. If you are unsure about a case, tell your Maestro along with the other columns of the row. To practice your judgment, ask for a new case.
Check yourself: At a pharmacy, the median sale is $180 and there's one for $48,000. Its other columns: 40 boxes of the same medication, a customer registered as a clinic, a Tuesday at 10:00 a.m. What is most likely?