Define the prediction task first
Supervised learning uses pairs of input x and target y to learn a prediction rule for future inputs. To predict delivery time, features might include distance and parcel load, while the target is the observed duration. A feature known only after delivery creates a shortcut unavailable when the real prediction is made. Fix the prediction time, unit of observation and target definition before choosing a model. A carefully optimized algorithm can still solve the wrong task when the target or available-input contract changes between training and deployment.
Separate a model family from fitted parameters
For a linear rule f(x)=wx+b, the function family is a modeling assumption and w and b are fitted parameters. The approximation says that each additional unit of distance changes predicted duration by a constant amount. Real traffic and regional differences may violate that assumption and appear in residuals. A more flexible model can fit more patterns, including accidental training variation. Distinguish fitted parameters from structural choices and tuning settings selected outside the fit. This distinction helps explain what information was learned from data and what was imposed by the modeler.
Compute squared error by hand
For targets two and four with predictions one and five, residuals are minus one and plus one. Mean squared error is one, because the squared residuals sum to two across two observations. Adding signed errors instead would misleadingly give zero. Squaring penalizes large deviations strongly but also increases sensitivity to outliers. Classification often uses a loss based on predicted class probabilities instead. Choose a loss matching the output interpretation, and separately state the operational objective. Lower training loss need not imply lower business cost when false positives, latency or asymmetric consequences matter.
Do not evaluate only the training minimum
Fitting minimizes an objective on training examples, whereas evaluation asks about unseen inputs. Fit preprocessing on the training portion, choose tuning settings with validation data and keep the final test isolated from those choices. For changing delivery conditions, a chronological split may better imitate future use than a random split. Inspect residuals by region and severe underpredictions as well as an overall average. Changes in collection methods or workloads can alter performance. A trained model is a rule fitted under particular data conditions, not a guarantee that future inputs preserve those conditions.