DataCareerHub
Explore learning
Lesson 1 of 3 · 55 min

Prediction versus explanation

Learn the reasoning. Try the task. Compare your answer.

Prepared for DataCareerHub · Curriculum version 2026-10-15.1

By the end of this lesson

  • Apply prediction versus explanation to the fictional case.
  • Record the rule, evidence and validation result.
  • Explain a limitation and a defensible next step.

Fictional learning case · Local practice files · No personal data.

Understand the method

Prediction versus explanation

A prediction estimates an unknown outcome from information available at a defined moment. Explanation asks why something happens; causal explanation asks what would change under an intervention. A model that predicts well does not automatically answer a causal question. Correlation may reflect confounding, selection or a measurement process. Begin with the decision and prediction time rather than an algorithm.

Work through the case

Cedar Parcel Lab asks whether a parcel will take more than 24 hours after dispatch. The prediction is made at dispatch using distance_km, load_ratio and zone. actual_hours and delivered_at become known later. They define or describe the outcome, so including them as predictors would let the model use future information. All parcels here are generated fictional examples, not evidence about a real carrier.

A method you can reproduce

Write a prediction contract: unit is one parcel, prediction time is dispatch, target late is actual_hours > 24, horizon is delivery, and intended action is a review alert. State which features exist at dispatch. Separately write a causal question, such as whether adding a vehicle would reduce delays. That question needs an intervention design or defensible causal assumptions, not just this prediction experiment.

Check your reasoning

Feature importance or a regression coefficient does not establish that changing that feature changes the outcome. A zone association might reflect route mix or omitted operational constraints. Do not turn a prediction score into an explanation of responsibility.

Further reading: NumPy least squares, Preventing leakage, Cross-validation. These official references support the methods; the case and exercises are authored for DataCareerHub.

Your turn

Practical exercise

Complete prediction_contract_template.txt. Mark each source field as identifier, available feature, target, timing metadata or prohibited future information. Write one predictive and one causal question.

Write your answer in learner_worksheet.txt and retain the evidence file. Attempt this before opening the solution.

Open the worked solution

parcel_id identifies a record; dispatch_date controls temporal splitting. distance_km, load_ratio and zone are permitted predictors. actual_hours and late are targets; delivered_at and post_delivery_rating are later information and excluded. A prediction estimates delay risk; a vehicle-allocation effect cannot be established from this synthetic observational exercise.

Independent extension: change one relevant input in a separate copy. Predict the result first, rerun the checks and explain any difference. Keep the supplied source unchanged.

Check your understanding

One more question.

Can a good predictor prove a causal effect?

Practice feedback only. This check is not a graded assessment and is not saved.

How these learning materials are prepared and maintained · Report a correction: support@datacareerhub.io

Read and practice without an account. Sign in with an existing account to save lesson completion.

Next lesson →

This is a fictional learning case. Results do not establish real-world performance or causal effects. Portfolio practice is not a claim of client work or an accredited qualification. Explore practical lessons, worked examples and projects. Follow a published path, practise the method and build work you can explain.