A Column Can Be Present and Still Be Unavailable
The parcel table contains duration_hours, late and final_status. They are
useful for describing what happened. If your prediction is made at dispatch,
those outcomes are not observations you can read then. A model that uses them
can appear successful while answering a different question.
A prediction contract states the observation unit, prediction moment, target, label horizon and intended evaluation population. A feature is an input allowed by that contract; a target is what you want to predict. Leakage occurs when information outside the intended prediction/evaluation boundary influences the procedure. Availability at prediction time is the first boundary to check; later lessons add split and fitted-state boundaries.

Prediction-time availability and label availability answer different questions.
Read the available inputs above the boundary as information usable at elapsed
hour 0, dispatch. Outcomes below it can describe the parcel only later. The
actual arrival time varies; it is not fixed at 8 hours. The separate +8 hour rule
is the common conservative horizon for the binary label in this exercise.
The figure is a scenario timeline, not an event log recovered from dispatch_hour.
State the Task Before Selecting Columns
For this fictional task, one row is one independent parcel. At dispatch,
predict whether arrival duration will exceed 8 hours. A duration of exactly 8 hours
is not late. The model's binary target is late=1 if the duration is greater
than 8, otherwise 0. Predicting duration_hours instead would be a regression
task with a different output; it does not make duration an available input for
this dispatch-time classification task.
Use dispatch+8 hours as a conservative common label-availability horizon. An early arrival could establish “not late” earlier. A real nonarrival check at the deadline could establish “late” without waiting for eventual arrival. The supplied table has complete offline labels and no implementation of that event log, so this is a declared scenario rule, not proof of a real recording system. Actual duration/final status become known at arrival, which can be before or after the deadline but is always after this prediction moment.
The intended evaluation population is new independent fictional parcels from
the same generation law. This does not promise performance on real delivery
traffic, repeated-unit histories or a changed process. Shared values of service
do not by themselves make two rows repeated observations of the same parcel.
Audit Origin and Meaning, Not Just Data Type
The scenario says distance_km is a planned route estimate available at dispatch.
A missing estimate stays missing; you cannot substitute the generator's hidden
complete distance or an eventual GPS distance. That would change the input's
origin. A field called “distance” can mean either of those things in another
system, so its name and numeric type are insufficient evidence.
weight_kg, current dispatch load, assigned service and the dispatch clock hour
have similar explicit origins in the scenario. Missing measurements can still
be eligible fields; later preprocessing teaches how to handle them. Eligibility
is not a claim that every allowed feature will improve a model.
parcel_id is known at dispatch, yet it stays metadata here: it is a unique
synthetic row label without intended reusable predictive meaning. Preserve it
for tracing and future partition checks. Do not delete IDs from the source
just because they are excluded from the feature list. Identifiers in other
prediction contracts need their own reasoning; “all IDs are always forbidden”
is not the lesson.
For this target, duration_hours is a later alternate target, late is the
target itself, and final_status reveals later outcome information. All three
must stay out of the predictor inventory. A different split or preprocessing
pipeline cannot make an unavailable outcome observable at dispatch.
dispatch_hour is only an integer clock hour 0–23. It has no calendar date and
cannot establish chronological order or a label-availability timestamp.
Chronological exercises later supply actual timestamps and their own contract.
Written Exercise: Produce an Availability Table
You have inspected the original seed 17 parcel schema in the prerequisite lesson. This task produces documents rather than fitting a model. The full scenario and starter files are supplied below; no new script, package install, network call or data download is required. You can complete the reasoning in a text editor without running the generator again.
From Bash, create the owned document folder:
practice_root="$HOME/feature-evaluation-practice"
mkdir -p "$practice_root/define-prediction-contract"
cd "$practice_root/define-prediction-contract"
pwd
Read the path and preserve existing work before saving files on a return visit.
Save the following complete scenario as scenario.txt:
Fictional parcel task, using the teaching generator with n=600 and seed=17.
One row represents one independent parcel. Predict at dispatch whether its
arrival duration will exceed 8 hours. Arrival at exactly 8 hours is not late.
Use dispatch+8 hours as the conservative common label-availability horizon.
At dispatch, parcel_id and service are assigned; dispatch_hour is the clock
hour; distance_km is a planned route estimate, weight_kg is a measured weight,
and load_at_dispatch is the current dispatch-load fraction. Distance and weight
may be missing. The generator's underlying complete values are not returned
as replacement inputs. No arrival/outcome information is available at dispatch.
duration_hours and final_status describe actual arrival, at a variable later
time. late is the binary target. A real-time nonarrival check can determine
late at the 8-hour deadline; this table has no event-log implementation.
The intended evaluation population is new independent fictional parcels under
the same generation law. dispatch_hour has no calendar date or ordering proof.
Save this complete starting table as availability.csv:
field,role,available_at_dispatch,reason
parcel_id,,,
distance_km,,,
weight_kg,,,
dispatch_hour,,,
load_at_dispatch,,,
service,,,
duration_hours,,,
late,,,
final_status,,,
CSV means comma-separated values: the header names the four columns, and each
following line describes one field. Empty cells are intentionally your task.
Use role labels feature, identifier, target, alternate_target or
post_outcome; use yes/no for dispatch-time availability. In reason, state
how the value arises and why that permits or excludes it. Avoid commas inside
these short reasons, or quote such a CSV cell so it remains one value.
Next save the complete document template as contract.md and replace each
REPLACE instruction with your statement:
# My prediction contract
- Prediction unit: REPLACE with what one observation represents.
- Prediction moment: REPLACE with when inputs are read and a prediction issued.
- Target and boundary: REPLACE with the quantity/class rule and its units.
- Common label horizon: REPLACE with when this exercise treats the label as available.
- Intended population: REPLACE with which future observations the estimate concerns.
- Allowed feature names: REPLACE with the complete eligible inventory from my CSV.
- Excluded fields and reasons: REPLACE with identifiers/targets/later information.
- Evidence limitation: REPLACE with what this synthetic audit does not establish.
List the five eligible input names as an explicit inventory, separately from the three outcome fields and row ID. This inventory says what is allowed; a later model can use fewer eligible inputs for a stated reason. Write the exact 8-hour boundary, common horizon and population, not “predict deliveries” or “use the numeric columns.”
Before checking the reference, verify that your CSV has all nine original fields exactly once, each has a role/availability/reason, and the contract agrees with that table. A successful CSV parse would not establish semantic availability; read your reasons against the supplied scenario. There is no automatic grading or real-system timestamp validation in this written task.
Independent Check: A Backfilled Aggregate
A new proposed feature, today_route_mean_duration, is computed after the day
ends using actual arrivals from the whole day. A job stores it on every parcel
row with the row's original dispatch timestamp. Can you use it for that same
row's dispatch-time prediction? Explain both the value's input origins and what
the stored timestamp does or does not establish.
Then consider a changed definition: use only completed past parcels whose outcomes were already available before the current dispatch. What additional evidence would you need before accepting that version? Attempt before opening hints and the reference documents.
Answer and Reasoning
Hint 1: Ask when the information needed to compute the value actually existed. Hint 2: A backfilled timestamp can describe an earlier event without making later input records available at that event. Hint 3: Distinguish a current row's outcome, other future outcomes, and truly available past outcomes; then inspect how the feature was built.
The whole-day aggregate is ineligible: later arrivals influenced its value. Copying an earlier dispatch timestamp onto the record does not undo that information dependency. A previous-only aggregate could be eligible if its contributing labels were actually available then and its computation obeyed the relevant unit/time/training boundaries. Verify input event/availability times and reconstruction rules; the new name or timestamp is not enough. Later lessons teach those group/time and fitted-state checks explicitly.
One complete reference availability table is:
field,role,available_at_dispatch,reason
parcel_id,identifier,yes,Assigned row metadata; unique synthetic IDs have no intended reusable predictive meaning.
distance_km,feature,yes,Planned route estimate at dispatch; can be missing.
weight_kg,feature,yes,Weight measured before dispatch; can be missing.
dispatch_hour,feature,yes,Dispatch clock hour known then; no calendar date.
load_at_dispatch,feature,yes,Current dispatch-load fraction observed at prediction.
service,feature,yes,Service choice assigned before dispatch.
duration_hours,alternate_target,no,Elapsed arrival duration is a later outcome; directly determines late.
late,target,no,Binary target from duration>8 hours; not an input at dispatch.
final_status,post_outcome,no,Arrival status is obtained after dispatch and exposes the target.
The corresponding complete contract.md is:
# My prediction contract
- Prediction unit: One independent fictional parcel, one row.
- Prediction moment: Dispatch, before any arrival information.
- Target and boundary: late=1 when duration_hours>8 hours, else 0; exactly 8 is not late.
- Common label horizon: Dispatch+8 hours, a conservative shared availability rule for this binary task.
- Intended population: New independent fictional parcels from the same teaching law.
- Allowed feature names: distance_km, weight_kg, dispatch_hour, load_at_dispatch, service.
- Excluded fields and reasons: parcel_id stays metadata; duration_hours is a later alternate target; late is the target; final_status exposes later arrival information.
- Evidence limitation: A supplied-scenario audit does not verify real ingestion/recording times, chronological event logs, real-system fitness or a deployed model.
The important distinction is that ID availability is yes, but its role is
metadata rather than a feature in this scenario. The eligible measurement
fields may be missing. The later target fields are excluded because of their
meaning and timing, not because a model API rejects their types. For example,
final_status would expose the generated class directly; a strong score with
that input would not validate a dispatch-time prediction.
Different wording is valid if it preserves the same unit/time/target rule, explicit field origins, horizon and population. Restricting a later model to fewer eligible inputs can also be valid; quietly adding a later outcome cannot.
Resume, Reset and Carry the Contract Forward
Keep your completed availability.csv, contract.md, the supplied scenario,
previous task files and shared environment. There is no runtime result or
background service to destroy. To try again, preserve your audit and save a new
named copy of the starter template; do not overwrite wanted work or delete the
shared practice root. No generated table or bytecode cache is created by this
text-only task.
In the next lesson, the prediction unit and intended population guide how rows are separated for fitting, development and final evaluation. The availability audit remains necessary even when every row identifier is disjoint. Later learned transformations need their own fitting boundary too.