
过滤绝不意味着删除
Filtered should never mean deleted
我们运了个过滤器 把GPS读数丢掉 几个月后有人问它是否有效,我无法回答。 证据不见了 这个问题改变了我如何构建任何拒绝数据的东西。 显而易见的版本, 以及它腐烂的原因 Milage的跟踪取决于值得信赖的距离, 而GPS 总是躺着。 因此,我们的第一个清理版本 做了每个人的第一个版本做的: 干净的数据从另一端出来。 感觉很负责 这也是一个陷阱,因为这摧毁了唯一能够告诉你拒绝是否正确的记录。 六个月后,有人问了一个合理的问题:过滤器是否正确? 我无法说出我们有多少次的读数, 是什么旅程, 或其中的任何一次是真正的驱动 通过隧道,而不是...
We shipped a filter that threw away bad GPS readings. Months later somebody asked whether it was working, and I could not answer. The evidence was gone. That question changed how I build anything that rejects data. The obvious version, and why it rots Mileage tracking depends on trustworthy distance, and GPS lies constantly. So the first version of our cleanup did what everyone's first version does: Clean data comes out the other end. It feels responsible. It is also a trap, because that destroys the only record that could ever tell you whether the rejection was correct. Six months in, someone asked the reasonable question: is the filter right? I could not say how many readings we had dropped, on which journeys, or whether any of them had been a genuine drive through a tunnel rather than a glitch. We had built a thing that made a judgement call thousands of times a day and kept no record of any of it. Persist, then classify The rebuild flipped the default. Rejection stopped being a and became a label. Only two cases are still deleted, because they cannot physically be real: That is the entire delete list. Everything else is persisted and sorted into named accumulators: Five numbers instead of one. The UI shows . The rest live beside it. And the row itself keeps its provenance: accuracy, provider, bearing, altitude, the gyroscope and accelerometer snapshot, battery level, device model, plus and . A filtered reading is still sitting there, labelled with exactly why it did not count. What that bought Disputes became answerable. This is mileage that turns into an expense claim. When a driver says the distance is wrong, we pull the journey and show what was removed and why. Before, the honest answer was "the algorithm decided", which is not an answer. Thresholds became tunable. We could replay real journeys and ask how much distance we were classifying as abnormal. Twice the data said our threshold was too aggressive on genuine motorway driving, and we moved it. That correction is impossible if the rejected steps are gone. Ratios became alarms. Because we keep both numbers, we can assert on their relationship: and warn when abnormal exceeds half a journey, or when GPS distance and the vehicle odometer diverge by more than 30 percent. If most of a real trip is landing in the abnormal bucket, the threshold is wrong, not the driver. The general rule This is not a GPS lesson. Any system that rejects data has the same shape: fraud scoring, metrics pipelines, log sampling, feature stores, anything with a validation step. The moment you drop a record, you have made an irreversible claim about it and destroyed the ability to check. Keeping it is usually cheap. A boolean column and a second accumulator is nothing next to permanently losing the answer to "is this working?" So: filtered should never mean deleted. Filtered means "not counted, and here is the reason, written down, next to the thing itself." If your pipeline drops rows, find out where they go. "Nowhere" is an answer, just not a good one. 🌀 Iteration 7 of **The Loopdown. field notes from an engineer who writes. Series: **Sensors Who Lie* · Featuring: The Concussed Witness* ← Previously in this series: Teaching a phone to disbelieve its own GPS 📚 The full series: Sensors Who Lie Follow the loop → LinkedIn · dev.to · GitHub