Chapter 1. What data mining is, and how it fails
Data Mining as Observation, draft 0.3, 2026-09-09. Week 1 of ECE 514. No reading is due before this chapter. TSK chapter 1 is due before the second session [1]. Every number below traces to a committed file listed in the last section.
Three engineers, in three different buildings, are about to make the same mistake.
The first has compressed the memory of a language model to the lowest reconstruction error her team has ever recorded, and the model has quietly gotten worse. The second has a new compressor for the vector index behind a legal-search product. It shrinks the index by more than half with almost no change in average vector fidelity, and the product's citation ranking has fallen off a cliff for reasons his dashboards cannot locate. The third works on a microphone array that estimates where a sound came from. Her codec compresses the recordings with beautiful waveform fidelity, and her estimator now points a few degrees wrong, consistently, in a way that averages to nothing and so hides in every summary statistic she trusts.
None of the three has a bug. Each has a compressor that does exactly what it was asked to do, minimize the difference between the input and its reconstruction, and each has a downstream system that does not care about that difference. The model's attention reads a few directions of the compressed memory. The ranking function reads a projection of the embeddings. The estimator reads the angle of the recordings and not their loudness. In every case the compressor spread its error to be small on average, which is to say it put error everywhere, which is to say it put error exactly where the consumer was looking. They optimized a quantity that was never the one that mattered, and they optimized it well.
This book is about the quantity that mattered. The rest of this chapter says what data mining is, states the one idea the book adds to the standard account, and shows that the four ways a data-mining project fails are four ways of losing track of that idea.
1.1 Data mining is a task, and a task names a decision
TSK defines data mining as the process of discovering useful patterns in large data, and organizes it around tasks. Predictive tasks learn a function from known attributes to an attribute of interest. Classification when the target is a category, regression when it is a number. Descriptive tasks summarize the data itself. Association analysis finds attributes that co-occur. Clustering finds groups of rows that resemble each other. Anomaly detection finds rows that resemble nothing. The modern additions, ranking, retrieval, recommendation, and generation, are these four tasks composed and scaled, and chapter 11 treats the ones this course needs.
The session deck adds one word to that definition, and the book is built on it. A task is not a technique. It is a decision. The same business question, which customers will leave, is a classification task if the decision is whom to call, an uplift task if the decision is whom the call will change, and a survival task if the decision is when to call. The label, the metric, and the model all follow from the decision, and a project that cannot name its decision cannot name any of them.
The framing workshop on Wednesday takes three candidate datasets from the class and translates each, live, from question to task to label to decision threshold. Do that translation for your own candidate before you arrive. It is the first exercise at the end of the chapter, and it is the exercise the whole term repeats.
1.2 The one idea this book adds
Every data-mining method produces something that is read by something else. A classifier's scores are read by a threshold and a person. A cluster assignment is read by a marketing rule. A compressed embedding is read by a ranking function. A summary statistic is read by a decision maker. The book calls the thing that reads the consumer, and its single claim is this.
The quality of a representation, a distance, a reduction, an index, or an evaluation is not a property of the object. It is a property of the relation between the object and the consumer that reads it, under a budget. Until the consumer and the budget are named, the question "how good is this" has no answer. Not a hard answer. No answer, the way "how far away is it" has no answer until you say from where.
The book packages the consumer with two more things and calls the package an observer. The three parts are introduced here in words. Section 0.5 of the toolkit gives the arithmetic.
$$O=(C,\ G,\ B). \tag{1.1}$$
That the same read operator is not the same observer, since reversing the sign of every sensitivity reverses every ranking and leaves the operator unchanged, is machine-checked in Lean in appendix C.
- The consumer is the computation that reads the representation. A classifier, a ranker, an attention head, an estimator, a decision rule. It is, deliberately, whatever is downstream.
- The output metric is how the consumer's mistakes are scored. Accuracy, precision at a threshold, rank correlation, angular error, dollars lost. It is where "what counts as a mistake" is written down, and section 8.2 shows what happens when it is written down wrong. The book writes it as $G$ in the triple. Where the metric has a local quadratic representation at the consumer's output, the same letter names that local geometry in equation 0.11. A dataset-level loss has no such geometry, and for it the read operator is taken on the score with the identity geometry.
- The budget is the resolution the consumer may spend. Bits per row, embedding dimension, folds, seconds, dollars. Every verdict in the book is relative to a budget, and chapter 4 shows a verdict reversing when the budget changes.
An observer, once named, tells you two things. It tells you which directions of the data the consumer can distinguish, which the book calls the read subspace, and which directions it is blind to, which the book calls the nuisance. A consumer that reads a customer's purchase history and ignores their postcode has the postcode in its nuisance. A consumer that reads the angle between two vectors and ignores their lengths has length in its nuisance. Section 0.5 shows that both of those facts are computable from the consumer alone, by perturbing its input and watching its output, and section 0.6 shows that collapsing the nuisance to a point is what the word quotient means.
Here is the consumer table the observation program uses, restated in this course's vocabulary. Each row is a reader the book will meet, what it reads, and what it discards.
| consumer | reads | discards | where it appears |
|---|---|---|---|
| a linear classifier | the projection onto its weight direction | everything orthogonal to it | chapter 6 |
| a cosine ranker | the angle between vectors | their lengths | chapters 3 and 11 |
| a geodesic-distance ranker on a graph | the angular coordinate of the spectral embedding | the radius, which is local density | chapters 3 and 9 |
| a softmax attention head | a few query-weighted directions of each key | the across-token mean | chapters 4 and 11 |
| a cross-validation harness | whatever moves its reported score | whatever does not | chapter 8 |
| a cache reader | the entries in its footprint | the rest of the cache | chapter 13 |
That negating a consumer keeps its read operator and reverses every comparison, and that two cost matrices give the same two classifiers opposite verdicts, are machine-checked in Lean in appendix C.
Two consumers with the same read operator on the same workload share the same local read geometry, and every allocation and distortion the book computes from that geometry is the same for both. They are not thereby the same observer. The consumer $x$ and the consumer $-x$ have the same read operator, workload, output metric, and budget and reverse every ranking, which is why the consumer stays a part of the triple. Nor is the same read subspace alone enough for the geometry. The identity and the diagonal that weights one direction a hundred times the other share a read subspace and a nuisance, and they allocate differently. What a language model's attention and a seismometer array turn out to share is a read geometry, and chapter 4 shows the same phenomenon in both.
1.3 The four failure modes are four missing elements
The session deck names four ways a data-mining project fails [11]. The label is bad. The evaluation lies. The model does not survive deployment. There was no decision. The standard account treats these as four separate hazards with four separate checklists. The book's account is that they are one hazard. Each is an element of the observer left unnamed.
No decision is the case with no consumer at all. A model was built because the data was available, and nothing reads its output. The observation program records this as a precondition rather than a result. Every claim in the book requires a working consumer, and with no consumer there is nothing to be right or wrong about. A project with no decision cannot fail, which is the same as saying it cannot succeed, and the field guide's decision test at the end of this chapter exists to catch it in week one rather than week fifteen.
A bad label is a wrong output metric. The label is where "what counts as a mistake" is written down, and a label that records who was contacted rather than who would have responded, or who was diagnosed rather than who was ill, scores the consumer's mistakes against the wrong target. The model can be optimal for the label and useless for the decision. Chapter 8 shows a metric that read lossless while the consumer read ruined, and the label is the same failure one step earlier.
A lying evaluation is the case where the evaluation harness is itself a consumer, with its own read subspace, and that subspace includes a direction the deployed consumer will never see. The harness reads the test fold's labels through a feature selected on all rows. It reads next month's data through a timestamp. It reads the same customer on both sides of a split. Chapter 8 is entirely about this failure, and its rule is that a number reported by a harness is a number about the harness until the harness's read subspace has been named.
The deployment mismatch is the case where the consumer that was evaluated is not the consumer that was deployed. The model was scored by accuracy and deployed behind a threshold that reads only its top decile. It was scored on a corpus and deployed on a workload whose queries visit different regions. It was evaluated at one budget and served at another. Or it was evaluated at one time and served later, when the world had moved, which chapter 13 calls the certificate that ages. In every case the read subspace changed between evaluation and deployment and nobody measured the change.
The book's claim is not that naming the observer prevents these failures. It is that naming the observer is what makes them visible, and that a project which writes down its consumer, its output metric, and its budget in week one has written down the three things every later chapter checks.
1.4 Reconstruction error is one reader's distortion
The three engineers shared a yardstick, and the yardstick deserves a fair hearing before the book spends twelve chapters arguing against trusting it.
Reconstruction error, the mean squared difference between a thing and its approximation, has three virtues and they are real. It is cheap. You compute it from the input and the output with no knowledge of what happens downstream. It is universal. It gives every compressor, every reduction, every imputation a single comparable score, so methods can be ranked without knowing what anyone will do with the result. And it is theoretically blessed. It is the distortion for which the classical theory of compression has its cleanest closed forms. A generation of engineering was built on it and the buildings are standing.
The three virtues are one vice wearing three coats. Reconstruction error is cheap, universal, and blessed because it names no consumer. It scores the object against its approximation and asks nothing about who reads the result. That is exactly what makes it portable, and exactly what makes it wrong when portability is a lie, when the thing downstream does not read every direction equally.
The precise relationship is one line, and section 0.5 has the arithmetic. The distortion a consumer feels is the error's variance weighted by how much the consumer reads each direction. Total reconstruction error is that quantity for the consumer that reads every direction equally, the identity reader. The two coincide for every error in exactly that one case, and a particular error can make them coincide by accident, which is why the equivalence is quantified over all admissible errors. Reconstruction error is not universal. It is the identity reader's distortion, one member of a family with one member per observer. It became the default because the tools were built for it, and a tool built for one reader makes everything look like that reader.
$$d_O=\operatorname{tr}(P_C\,M_\delta),\qquad \big(d_O=\operatorname{tr}M_\delta\ \text{ for every admissible } M_\delta\big)\ \Longleftrightarrow\ P_C=I. \tag{1.2}$$
When the consumer genuinely reads every direction equally, reconstruction error is not an approximation to the right answer. It is the right answer, and the book has no quarrel with it. The quarrel begins the moment the consumer cares about some directions more than others, which is to say a classifier, a ranker, an attention head, an estimator, a decision rule. Which is to say almost always.
The number the book is named after. The observation program's founding measurement is a compressed attention memory [12, 13] that read cosine similarity 0.995 against the original, all but perfect by the reconstruction yardstick, while the language model's perplexity rose to the order of ten thousand, which section 0.11 explains means the model was broken. Nothing was wrong with either measurement. They measured different things, and only one of them was the thing that shipped. A second measurement made the point in its purest form. A recalibration step improved reconstruction on every window and made the consumer worse on every window. The two numbers disagreed in sign.
Chapter 4 shows that this disagreement is not a curiosity. At matched budget, a code that preserves what the consumer reads beats a reconstruction-optimal code on the consumer's task while reconstructing the data worse. The program sealed that prediction in twelve domains and three branches of physics [13] and it held in at least five independent domains and all three physics. The code that is worse by the universal yardstick is better by the only yardstick that ships.
1.5 What the book claims, and what it does not
A textbook that adds an idea owes the reader the idea's boundaries, and this one carries them from the first chapter.
The claim. Nearness, reduction, compression, evaluation, and freshness are consumer-relative. Each chapter states that claim for one week of the course, cites the sealed measurement that earned it, and prints the failure that bounds it at the same size as the result.
The three claims the book leans on most, with their counts. Every number in this table is repeated in chapters 4 and 11 with its source row, and the class column is chapter 8's.
| Claim | Where measured | Count | Class |
|---|---|---|---|
| The flip. At matched bits the code that reconstructs worse serves the consumer better. | transformer attention keys, twelve heads | 12 of 12, 2.53 times, anti arm 21 times worse | demonstrated |
| softmax attention and embedding retrieval, at identical reconstruction error | 12 of 12 both ways | replicated | |
| acoustic, 8-microphone array with camera-tracked truth | 148 of 201 flips, 201 of 201 reconstruction trades, anti arm worst 152 of 201 | predicted | |
| seismic, 13-element array on real earthquakes | 13 of 17, 17 of 17, 13 of 17 | predicted | |
| sperm-whale clan classifier, 8718 codas | held-out AUROC 0.934 against 0.883, 300 of 300 | predicted | |
| in all, twelve domains and three physics, electromagnetic, acoustic, and elastic | flip in at least five independent domains | demonstrated | |
| The flip's boundary. It cannot appear when the read operator is aligned with the signal's energy, and the alignment is measurable before compressing. | gradient compression against a curvature consumer on a trained model | anti arm worst 300 of 300, flip 27 percent, at alignment one | refuted as a flip, kept as the boundary |
| the alignment law across the twelve domains | retrospective fit decreasing, one prospective point sealed | exploratory | |
| The budget cliff. A probe confined to fewer directions than the dimension cannot resolve the read operator, and full dimension does. | planted read subspace, ranks one to sixteen | 0.646 against 0.366 at half dimension, never 0.90 below full dimension | proved for confined probes, then measured |
| 124 attention and recurrent-state cells across five model families | read subspace recovered at resolution 1.000 at 1.25 times the dimension | replicated |
The boundaries, stated once. The consumer-relative effect needs a consumer whose read subspace is misaligned with where the data has its variance. When the two coincide the effect cannot appear, and chapter 4 has the measured case where it does not. It needs a working consumer, and a project with no decision has none. It is relative to a budget, and a verdict at one budget does not transfer to another. And it says nothing about correlations that no reading of a shared record could produce. Chapter 3 has the sealed audit in which a hubness mechanism that sounded like the book's own reasoning was tested against a physical bound and did not move it [13].
The evidence discipline. Every number in the book was written down as a prediction before it was measured, or is labelled as not having been. Each chapter's headline carries one of six classes, proved, demonstrated, replicated, predicted, exploratory, or refuted, and chapter 8 explains what each requires. A chapter may not rest its thesis on anything below demonstrated. Every number traces, in the table at the end of each chapter, to a committed file with a line number and, where one exists, a permanent identifier. The program's own rule is that it may not assert what its ledger cannot show, and the book inherits it.
What the book does not do. It does not replace TSK or ESL [1, 2]. The standard content of each week stays in those texts and is cited, not rewritten. The book's own pages are the observer reframing of each week's topic, the instruments the reframing produced, and the failure cases that earned it. A reader who wants the derivation of principal components or the proof that boosting converges goes to the standard text. A reader who wants to know which directions the derivation assumed the consumer reads, and what happened when the assumption was wrong, stays here.
1.6 The pipeline as the course map
The session deck draws the data-mining pipeline end to end as the map of the course. Here is the same map with the book's chapters on it.
| week | pipeline stage | standard text | this book |
|---|---|---|---|
| 1 | frame the decision | TSK 1 | chapter 1, name the observer |
| 2 | collect and clean | TSK 2.1 to 2.3 | chapter 2, what a measurement scale says about the reader |
| 3 | measure similarity | TSK 2.4 | chapter 3, a distance is a choice of what to ignore |
| 4 | reduce and select | TSK Appendix B | chapter 4, reduction is compression with a reader |
| 5 | find patterns | TSK 5 | chapter 5, safe pruning |
| 6 to 7 | classify | TSK 3 and 4, ESL 10 and 15 | chapters 6 and 7, the classifier as an observer |
| 8 | evaluate | ESL 7, TSK 10 | chapter 8, the evaluation is an observer too |
| 9 to 10 | cluster and detect outliers | TSK 7 and 9 | chapters 9 and 10, name the manifold, trust the tail |
| 11 | embed and search | the papers | chapter 11, nearness is a property of the reader |
| 12 | mine text | the papers | chapter 12, a chain of observers |
| 13 | scale and serve | instructor notes | chapter 13, cost and the certificate that ages |
| 14 | deploy and account | TSK 10 | chapter 14, the decision as a spectrum |
Six chapters carry the thesis and the rest carry the course. Chapter 3 shows that the choice between cosine and Euclidean distance is a theorem about who reads the result. Chapter 4 shows that reduction by variance is a bet on the identity reader and measures what the bet costs. Chapter 8 shows that the evaluation harness has a read subspace of its own and collects the failures that taught the program to name it. Chapter 11 shows that recall, compression, and hubness are properties of the query and the reader, not the corpus. Chapter 12 writes a retrieval pipeline as a chain of observers and recovers the reader of a legal corpus without seeing it. Chapter 13 adds a clock. Chapters 5 and 7 are standard content with one sidebar each, and the book says so rather than stretch.
1.7 Choosing a dataset
The field guide in the session deck lists where data lives. General archives, government and credentialed sources, and the domain classics by unit. It also gives a test for choosing well, and the test is the observer triple in disguise.
The decision test. What decision will be made differently because of this analysis, and who makes it. A dataset that passes has a consumer. A dataset that fails is a dataset with no decision, the fourth failure mode, and no amount of modelling will supply one.
Label, rows, provenance, license. Is the target recorded as the decision needs it, or as a proxy. That is the output metric. Are there enough rows for the event the decision cares about to occur enough times to be graded. Chapter 8 calls a run with too few events vacuous and gives the bar. Where did the rows come from, and could the collection process have read the label. That is the lying-evaluation mode one step earlier. May you use it, and may you publish what you find.
The red flags. An over-mined toy is a dataset on which every method has already been tuned, so that a good number says nothing about your method. A leakage red flag is any column that could only be known after the decision, or any identifier that appears more than once.
Bring one candidate on Wednesday. The class will name its decision, its consumer, its metric, and its budget in front of you, and the exercise is harder than it sounds.
1.8 What a project proposal must state
The proposal is due in week four and is one page, decision first. It states the following, and every later homework checks the same list.
- The decision. What will be done differently, by whom, at what threshold.
- The consumer. The computation or the person that reads the model's output, and what directions of the data it reads.
- The output metric. How the consumer's mistakes are scored, and why that scoring matches the decision.
- The budget. Rows, features, bits, seconds, or dollars, whichever binds.
- The feared failure mode. Which of the four, and what in week one already suggests it.
A proposal that names a technique and not a decision will be returned with this list.
Exercises
Warm-up
- State TSK's four canonical tasks and, for each, name a consumer that reads its output.
- Explain the difference between a task and a technique, using the churn example.
- Write the observer triple for a spam filter. Name what its consumer reads and one thing it discards.
- For each of the four failure modes, name the element of the observer that was left unnamed.
- Why does the book say a project with no decision cannot fail?
- State the three virtues of reconstruction error and the one vice they share.
- In what single case is reconstruction error the right distortion, and why is that case rare?
- Two consumers have different internals and the same read operator on the same workload. What do they share, what may still differ between them, and what if they shared only the read subspace?
- Give an example of a deployment mismatch in which the consumer's read subspace changed between evaluation and deployment without any change to the model.
- Which two of the book's fourteen data-mining chapters are labelled standard content with a sidebar, and why does the book say so?
By hand
- A consumer reads only the first of three coordinates. Write its read operator as a three by three matrix, and compute the trace of that operator times a covariance with diagonal (1, 4, 9) and no off-diagonal entries. Compute the identity reader's distortion on the same covariance. State the ratio.
- Two errors have covariance with diagonals (0.3, 1.7) and (1.7, 0.3). A consumer reads the direction at 15 degrees from the first axis. Using section 0.3, compute the consumer's distortion for each and the ratio.
- A churn decision calls the top 5 percent of customers by predicted risk. The model is evaluated by accuracy on all customers, of whom 3 percent churn. Compute the accuracy of a model that predicts no churn for anyone. State which failure mode this evaluation exhibits.
- A dataset has 2000 rows and the event the decision cares about occurs in 0.4 percent of them. Compute the number of events. State whether a bar of recall at least 0.9 can be graded, and why.
- A retrieval index is evaluated on the corpus's own rows as queries and deployed on a workload that visits 2 percent of the corpus 80 percent of the time. Name the failure mode and the element of the observer that changed.
- Classify the following under the four failure modes. A fraud label that records which transactions were investigated. A test set drawn from the same month as the training set for a model deployed next month. A model built on a public dataset because the dataset was available. A feature computed from a field that is filled in after the decision.
Programming
- Take one candidate dataset from the field guide. Write its decision, consumer, output metric, and budget in one paragraph each, then run the decision test. If it fails, choose another dataset and repeat.
- For the dataset that passed, count the rows in which the event the decision cares about occurs. Compare to the bar you would set for a graded evaluation, following section 8.3.
- Build the simplest possible consumer for that dataset, a linear score on standardized features, and estimate its read operator by finite differences at a budget of twice the feature count, following section 0.5. Report which three features it reads most and which three it ignores.
- Find a public notebook that models the same dataset. Audit it against the four failure modes and report which, if any, it exhibits, with the line that exhibits it.
- Compute reconstruction error and the read distortion of exercise 19's consumer for a reduction of the dataset to half its features by variance. Report both, and state whether they agree about how much was lost.
- Write the proposal skeleton of section 1.8 for your dataset. Commit it. The commit hash goes in the week 2 submission and will be compared to the week 4 proposal.
Answers to the warm-up and by-hand problems are collected in the answer key at the end of the book.
Homework 1. Name the consumer
Assigned in week 1, due Sunday of week 2. Ten points. Precedes the week 4 proposal and is graded on completeness, not on being right.
Part A, the dataset (3 points). Programming exercises 17 and 18. The four paragraphs and the event count.
Part B, the reader (4 points). Programming exercise 19. The read operator's three most and three least read features, with the call count stated. A read operator estimated below twice the feature count earns zero for this part, for the reason chapter 11 gives.
Part C, the audit (3 points). Programming exercise 20. The notebook named, the failure modes found, and the lines.
Preregistration. Programming exercise 22. The proposal skeleton committed, with the hash in the submission. The week 4 proposal will be compared against it, and the comparison is not graded on agreement. It is graded on whether the changes are explained.
Sources for every number
Paths are relative to a checkout of the named repository, at the commit and with the access status listed in appendix A, all under github.com/ahb-sjsu unless appendix A says otherwise. Shas, DOIs, and versions are as recorded in the source files on 2026-09-03. A row is reproduced by opening the cited lines at that commit, and where a row names a script the command is the one the repository's README gives for it.
| Section | Claim | Source |
|---|---|---|
| opening | the three engineers, the index shrunk by more than half, the estimator a few degrees wrong | geometric-observation\chapters\ch01_why_observation_needs_a_theory.md:1-25 |
| 1.1 | the four tasks, the churn framing, the framing workshop | TSK chapter 1; instructor working documents, not public [11], ECE_514-01_FA26_session-outlines.md:29-60 |
| 1.2 | the observer triple, read subspace, nuisance, same read operator means same read geometry | geometric-observation\chapters\ch04_the_observer_triple.md:9-60; geometric-observation\OBSERVATION.md:1-10 |
| 1.2 | the consumer table | geometric-observation\OBSERVATION.md:19-29 |
| 1.3 | the four failure modes | ECE_514-01_FA26_session-outlines.md:38 |
| 1.3 | no-consumer is a precondition, coupling is a true null, every verdict budget-relative | geometric-observation\OBSERVATION.md:31-40 |
| 1.4 | three virtues one vice, the identity slice | geometric-observation\chapters\ch02_failure_of_observer_free_measurement.md:1-40 |
| 1.4 | cosine 0.995 and perplexity of order ten thousand, the recalibration negative | geometric-observation\chapters\ch02_failure_of_observer_free_measurement.md:40-60; geometric-observation\chapters\ch16_honest_negatives.md NEG-2 and NEG-4; turboquant-pro\docs\KV_KEYS_FINDING.md:1-49 |
| 1.4 | the flip sealed in twelve domains and three physics, held in at least five domains and all three | geometric-observation\chapters\ch08_value.md:40-70; geometric-observation\claims\LEDGER.md rows GO-2, GO-B-AV163, D3, 038 |
| 1.5 | the summary table of the flip, its boundary, and the budget cliff | chapter 4 sections 4.3 and 4.4 and chapter 11 section 11.7 of this book, and their sources rows |
| 1.5 | the Bell boundary | geometric-observation\OBSERVATION.md:35-40; geometric-observation\claims\LEDGER.md row NEG-15 |
| 1.5 | the six classes and the ledger rule | geometric-observation\PROTOCOL.md:58-75; geometric-observation\OBSERVATION.md:43-45 |
| 1.6 | the course map | ECE_514-01_FA26_session-outlines.md:29-332 |
| 1.7 | the field guide, the decision test, the red flags | ECE_514-01_FA26_session-outlines.md:39-46 |
previous, Chapter 0. The mathematics this book uses ยท next, Chapter 2. Data, measurement, and what an observer can read