How can you use linear regression to predict outcomes?
Instruction: Explain how linear regression can be employed to make predictions based on data.
Updated
Official answer
A linear regression predicts a numeric outcome using an intercept plus a weighted sum of features. For a fitted illustrative equation predicted minutes = 5 + 2 × tasks, an input of 3 tasks gives a prediction of 11 minutes.
Define the prediction time and outcome first, and use only features available at that time. Split the data to match deployment, fit preprocessing and coefficients on training data, then compare held-out errors with a simple baseline. Inspect errors across the relevant input range and groups, rather than relying only on training fit.
The fitted equation describes a conditional prediction. It does not prove that changing a feature will cause the predicted change in the outcome. Avoid extrapolating beyond the data without justification.
A prediction interval for a new observation accounts for outcome variation as well as coefficient uncertainty; a confidence interval for the conditional mean answers a different question. Classical interval formulas require assumptions about the errors and model. Consider transformations or another model if residual behavior or outcome constraints make the linear specification unsuitable.