A project report shows a validation error of zero and concludes that its model will predict setup times reliably on new machines. Before believing it, a reader should ask how a perfect score came about and whether the evidence could support that claim at all. This lesson audits such a flawed study, then designs, runs and reports a corrected study of setup durations on machines the model has never seen. The aim is a final claim that says what was observed, on which data, against which comparator and where the evidence stops.
Key terms
Study protocol
Definition A study protocol is the written plan of a machine learning study, fixed before the final comparison. It states one bounded question and the decision it serves, the prediction time and the inputs available then, the target and its units, the population and setting the claim is about, the independent unit, the data sources with their permissions and intended use, and the split by unit into training, validation and final data. It also states the baseline and the small set of candidate models with their settings, the fitting objective, the selection metric and its tie rule, whether the selected model is refitted before the final evaluation, the final metric and how cases are weighted in it, the uncertainty method, the planned stress checks and what the report will contain. A change made after the final data are opened is recorded as a deviation, and its results are exploratory.
In plain words The protocol commits to the question and the rules of evidence before the answer is known, so the result cannot quietly bend toward whatever looked best. It also keeps the study bounded. A capstone study answers one well-defined question along one application route whose prerequisites it has covered, such as tabular regression, images or forecasting, rather than trying every method in the course.
Example The corrected study predicts the setup duration of a batch, in minutes, before setup begins, from the declared batch size, for new machines from a simulated population. Each machine contributes four setups, and 36 training, 12 validation and 16 final machines give 144, 48 and 64 rows. The baseline is the training median duration, about 29.27 minutes. The candidates are ridge-penalized polynomial regressions in batch size of degree 1 and 2 with and of degree 9 with , each minimizing the mean squared training error plus times the sum of squared slopes, with an unpenalized intercept and with every standardization fitted on training rows only. Selection uses the validation mean over machines of each machine’s mean absolute error (MAE), and the selected fit is frozen as trained on the 36 training machines. The data are simulated, so no personal or confidential records are involved. A real study would record permissions, licenses, purpose, retention and access, and predictive convenience alone would not justify collecting data about individual workers or using a model to assess them.
Post-outcome information
Definition Post-outcome information is any value that becomes known only once the outcome has occurred, such as the outcome itself, completion times, quantities computed from the outcome and records updated because of it. More generally, nothing recorded after the prediction time can be an input. Using such a value as an input is target leakage. The model then relies on information that will not exist when predictions are needed, and its evaluation scores measure that reliance rather than prediction. A field that becomes known after the prediction time may define the target or support an audit, but it is never an input.
In plain words If the answer, or something computed from it, sits among the inputs, a model will find it and score superbly. The score is correct arithmetic about a question nobody needs answered.
Example The flawed study has three setup events with durations 14, 18 and 24 minutes, and its inputs include the recorded duration. Fitting by least squares to the three training rows gives and , because that line fits every row with zero error and, with three distinct durations, the fit is unique. The validation predictions copy the observed durations, so the MAE is zero apart from floating-point rounding, about minutes. The corrected protocol keeps only batch size, which is known before setup, and excludes recorded duration, completion timestamps and any other post-outcome field. Machine identifiers keep each machine’s rows together and serve to audit the split, but they are never inputs, since a new machine’s identifier carries nothing the model could have learned.
Independent unit of analysis
Definition The independent unit of analysis is the unit drawn independently from the population a claim is about, such as a machine, a patient or a store, when each unit can contribute several correlated rows. All rows of a unit go into the same split, the metric weights units as the protocol declares, and uncertainty is estimated by resampling whole units together with their rows. With units, unit having rows, the equal-unit MAE is
It equals the pooled MAE over all rows when every is the same, but not in general. Resampling rows as if they were independent ignores the dependence within units and tends to understate the uncertainty when errors within a unit are positively correlated.
In plain words Four setups on one machine share that machine’s quirks, so together they are closer to one piece of evidence about a new machine than to four. The duplicated events of the flawed study are the extreme case, where the same event sits in both training and validation and a supposedly new case is not new at all.
Example The simulation draws batch sizes uniformly between 1 and 8 size units and generates
with a machine offset shared by all rows of machine and independent noise . The models never see the offsets or these coefficients. The final cohort therefore holds 16 independent machines, not 64 independent rows. The selected model’s final equal-machine MAE is 2.12 minutes. Resampling the 16 machines 2000 times with their rows gives an approximate 95 percent percentile interval from 1.48 to 2.77 minutes, while resampling the 64 rows as if independent gives a narrower 1.80 to 2.45 minutes. In the flawed study each of the three events was copied into two rows, one in training and one in validation, so the two splits contained exactly the same events.
Failed alternative
Definition A failed alternative is a candidate or design choice, declared in the protocol, that did not meet the selection criterion or a planned check and is reported with its result rather than dropped. Its failure is a statement about this comparison, with these data and this metric, and not a general verdict on the method. Reporting it shows that the search was bounded and lets a reader judge the selection, since the best of several validation scores tends to be optimistic for the winner.
In plain words A study that shows only its winner hides how many tries it took to win. Keeping the losing candidates in the record lets a reader weigh both the improvement and the selection behind it.
Example The validation equal-machine MAEs were 13.45 minutes for the median baseline, 3.00 for the linear model, 1.68 for the quadratic model and 1.80 for the degree-9 model. The quadratic model was selected, and the squared term is a justified improvement over the linear model under the declared rule. The degree-9 model is the failed alternative, since its extra flexibility left the validation error about 0.12 minutes worse than the quadratic one. A gap of that size on 12 validation machines does not show that quadratic models are better in general or that extra polynomial terms always hurt, and the report keeps the degree-9 result with that caveat. Once the quadratic fit is frozen, its validation score has done its job of selection and is not the estimate used to defend the final model.
Reproducibility versus validity
Definition A study is reproducible when another person, using the recorded data, code, software versions, random seeds and settings, obtains the same numbers. It is valid when those numbers answer the question the study claims to answer. That requires inputs available at the prediction time, splits by the independent unit, a metric that matches the decision, final data untouched by development, uncertainty computed over the right unit and a population like the one the claim is about. Reproducibility makes a study checkable but does not make it valid, and a fixed seed makes one run repeatable, not its result general. A critical review is a reader’s systematic check of both. It asks whether each input was available in time, whether units leaked across splits, whether the metric matched the objective, whether the final data influenced any choice, whether the uncertainty resampled the right unit and whether the claim stays within the evidence.
In plain words Reproduction asks whether the numbers come out the same, and validity asks whether those numbers answer the question. A study can reproduce perfectly and still be wrong every time it is run. Sharing the data, code and records turns a disagreement into specific questions about assumptions, which a reviewer can then test.
Example The flawed study is fully reproducible, since rerunning it returns zero validation error every time, yet its claim of reliable performance on new machines fails both the timing check and the independence check. The corrected study lets a reviewer rerun every number. On the 16 final machines the selected quadratic model has equal-machine MAE 2.12 minutes against 13.47 for the training-median baseline, an observed improvement of 11.35 minutes with whole-machine bootstrap interval from 9.31 to 13.59 minutes, computed from each machine’s paired baseline and model errors. For the first final machine the four residuals, prediction minus observation, are about , , and minutes, so its MAE is minutes, and the mean of the 16 machine values is the reported 2.12. The root mean squared error is 2.52 minutes and the signed mean error is minutes, an average overprediction that the MAE alone cannot show.
Stated limitation
Definition A stated limitation is a specific boundary on a study’s claim. It names a population, a condition or a change that the evidence does not cover, with supporting evidence where possible, for example the result of a stress test under a declared change. Unlike a generic disclaimer, it can be checked by a reader and addressed by a later study. The final claim then says what was observed, on which data, against which comparator, with what uncertainty and where it stops.
In plain words Every study has limits, and the useful ones are written so that someone could test them. Showing a failure under a named change says more than a sentence that results may vary.
Example A declared stress scenario leaves every final input unchanged and adds 5 minutes to every observed duration, standing for an extra setup step that was absent during development. The predictions do not change, so every residual falls by exactly 5 minutes, and the signed mean error moves from to minutes while the equal-machine MAE rises from 2.12 to 3.92 minutes. A monitor that watches only the inputs would see nothing, which is why delayed checks of the outcomes matter. The concise claim reads as follows. On 16 new simulated machines, a quadratic model chosen on validation data reduced the average machine absolute error from 13.47 to 2.12 minutes relative to a constant training-median baseline, the result depends on the simulated process and the fitted pipeline, and a 5-minute shift in setup times made the error worse. Real use would need real data with permission for that use, evaluation on the intended machines and a plan for changed outcomes, and this study supports no scheduling decision and no assessment of workers.
Check yourself
- A final cohort has machine P with one setup, whose absolute error is 1 minute, and machine Q with two setups, whose absolute errors are 3 and 3 minutes. Compute the equal-machine MAE and the pooled MAE over the three rows. Which one estimates the expected MAE of a new machine drawn at random?
Show the answer
Machine P has MAE 1 and machine Q has MAE , so the equal-machine MAE is minutes. The pooled MAE is minutes.
The equal-machine MAE gives each machine weight and estimates the average error for a machine drawn at random. The pooled MAE gives Q twice the weight of P because Q has twice as many setups, so it estimates the average error for a setup drawn at random. Both are legitimate for different questions, and the protocol has to choose before the results are seen. They always agree when every machine has the same number of rows. With unequal numbers they agree only when the errors happen to balance, for example when every machine has the same MAE.
- Training machine A has batch sizes 1 and 2 with durations 3 and 5 minutes, and training machine B has the same sizes with durations 5 and 7. Fit a least-squares line to the four training rows and find the training-median baseline. Validation machine C has sizes 1 and 3 with durations 4 and 8, and machine D has the same sizes with durations 6 and 10. Which model does the equal-machine MAE select?
Show the answer
The mean size is 1.5 and the mean duration is 5. The centered sizes are , , and , and the centered durations are , , and , so
The slope is and the intercept is , so the line is . The training durations 3, 5, 5 and 7 have median 5.
The line predicts 4 and 8 at sizes 1 and 3. Machine C has errors 0 and 0, so its MAE is 0, and machine D has errors and , so its MAE is 2. The line’s equal-machine MAE is . The baseline predicts 5 everywhere, with MAE for C and for D, and an equal-machine MAE of 2.5. The line is selected. The machine labels only group the rows and are not inputs, and size 3 lies outside the training sizes, so the validation comparison already relies on extrapolating the line.
- After selection, final machine E has sizes 2 and 4 with durations 5 and 9, and final machine F has the same sizes with durations 9 and 13. Find the equal-machine MAE of the selected line and of the baseline. A teammate then bootstraps the four final rows as independent cases to get an interval for the improvement. What is wrong with that, and what claim can the study make?
Show the answer
The line predicts 6 and 10 on both machines. On E the residuals are and , so its MAE is 1, and on F they are and , so its MAE is 3. The line’s equal-machine MAE is 2 minutes. The baseline’s absolute errors are 0 and 4 on E and 4 and 8 on F, so its machine MAEs are 2 and 6 and its equal-machine MAE is 4 minutes. The observed improvement is 2 minutes.
The four rows come from only two independent machines, and the rows of each machine share whatever makes that machine fast or slow, so a row bootstrap pretends to have four independent cases. Resampling whole machines uses the machine improvements 1 and 3 minutes, and its only possible means are 1, 2 and 3 minutes, with probabilities , and , which shows how little two machines can say. The study can report that, on two new constructed machines, the line reduced the equal-machine MAE from 4 to 2 minutes compared with the training median. The constant baseline is the unsuccessful alternative, the size relationship is the justified improvement, and the unresolved limitation is the tiny number of machines together with unobserved machine-to-machine variation and the extrapolation to size 4.