Capstone Project · Lesson 81

Define the Unit and Target

The unit defines what one prediction row represents; the target defines the outcome and prediction horizon.

ConceptWorked examplePracticeKnowledge check
Textbook walkthrough

Define the Unit and Target

The unit defines what one prediction row represents; the target defines the outcome and prediction horizon. Together they determine which features are legally available and how observations must be split.

Learning goal: explain why Define the Unit and Target behaves this way, apply it to a small example, and verify the result independently. Begin by being able to justify this first step: Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.”

Deeper walkthrough

Read Define the Unit and Target as a mechanism, not a recipe

Treat this as a sequence of observable decisions rather than one opaque command. Stage 1: Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.” Stage 2: Keep the stage inside the same data/validation definitions used by the rest of the project. Stage 3: Save the evidence produced by this stage so the next stage can be audited.

Mechanism

Follow the transformation

Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.”

Keep the stage inside the same data/validation definitions used by the rest of the project.

Save the evidence produced by this stage so the next stage can be audited.

Evidence

Know what would convince you

  • Confirm fitted transformations/models saw only training data.
  • Retain fold/test predictions so metrics can be recomputed independently.
Useful distinctionTraining evidence: Information allowed to influence fitted state.
How it works

Trace the mechanism step by step

  1. Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.”
  2. Keep the stage inside the same data/validation definitions used by the rest of the project.
  3. Save the evidence produced by this stage so the next stage can be audited.
Worked demonstration

Define the Unit and Target evidence

Define the Unit and Target evidence
Evidence: every feature can be justified as available at the declared prediction time.
Expected / illustrative result
The worked evidence makes the output of this project stage concrete and auditable.
Interpret the result.

For Define the Unit and Target, trace the specific input through the mechanism above and independently verify one returned value, state change or side effect.

Distinctions & related ideas

Place the concept correctly

Training evidenceInformation allowed to influence fitted state.
Held-out evidenceIndependent observations used to estimate generalisation.
InterpretationWhat the result supports, with assumptions and limitations.
Use deliberately

When it is appropriate

Use Define the Unit and Target when it answers a defined question in Capstone Project and its inputs/assumptions match the current data or program state.

Boundary conditions

When to stop or reconsider

Reconsider Define the Unit and Target when the required information is unavailable, the operation would violate a validation/data boundary, or a simpler operation answers the question more transparently.

Common mistakes

Failure modes to recognise

  • Learning preprocessing/feature/model choices from held-out test information.
  • Comparing models under different splits or preprocessing and attributing the difference to the algorithm.
  • Turning an association or model explanation into an unsupported causal claim.
Verification

How to check the result

  • Confirm fitted transformations/models saw only training data.
  • Retain fold/test predictions so metrics can be recomputed independently.
  • Inspect errors/subgroups and compare with a baseline before generalising the conclusion.
Hands-on practice

Demonstrate understanding

Try this:

Construct a tiny example of Define the Unit and Target. First write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.” Then keep the stage inside the same data/validation definitions used by the rest of the project. Predict the result before execution and explain one boundary or failure case.

List the stage inputs and expected artifact, rerun it from a clean state, and compare against a concrete acceptance check.
Knowledge check

Check reasoning, not memorisation

Which approach best demonstrates understanding of Define the Unit and Target?

Quick reference

Remember the logic

Step 1Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.”
Step 2Keep the stage inside the same data/validation definitions used by the rest of the project.
Step 3Save the evidence produced by this stage so the next stage can be audited.
Lesson summary

What to remember

  • The unit defines what one prediction row represents; the target defines the outcome and prediction horizon. Together they determine which features are legally available and how observations must be split.
  • Write a timestamped prediction statement: “for each [unit] at [prediction time], predict [target] over [horizon] using only information available by then.”
  • Learning preprocessing/feature/model choices from held-out test information.
  • Confirm fitted transformations/models saw only training data.