Passage: In a retail dataset, customers are observed over months after first purchase. A common approach is to label each customer as “churned” if they have no purchases in the next 60 days, then train a model using features derived from their past behavior. However, some team members accidentally compute summary statistics (like average order value) using transactions that occur after the 60-day prediction window. They notice performance increases but suspect it may not generalize. They also vary class balance by oversampling churn cases. Your task is to design feature engineering and evaluation so that future information cannot influence training, and so that apparent gains reflect real predictive signal rather than artifacts. A robust workflow must use time-aware splits and define features aligned to the prediction horizon.

Answer

Time-aware splits and restrict feature computation to events occurring strictly before the prediction horizon

Explanation

If features include transactions after the prediction window, the model indirectly sees the outcome, causing leakage and inflated performance. Time-aware splitting plus horizon-aligned feature computation prevents this.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error

Related questions

You suspect a seasonal effect in demand but also want robustness to outliers. Which combination is most appropriate?

View question →

A causal estimate shows a significant average treatment effect, but units are heterogeneous. Which method best targets conditional effects under strong assumptions about overlap and ignorability?

View question →

In Google Advanced Data Analytics, which approach best prevents leakage when creating features from time-series data with rolling windows?

View question →

You must choose a probability threshold after training to minimize business losses where false negatives are twice as costly as false positives. What is the most defensible strategy?

View question →

You have two candidate pipelines: (A) global scaling before fitting, (B) scaling inside cross-validation folds. Which choice best avoids information leakage?

View question →

Passage: In a retail dataset, customers are observed over months after first purchase. A common approach is to label each customer as “churned” if they have no purchases in the next 60 days, then train a model using features derived from their past behavior. However, some team members accidentally compute summary statistics (like average order value) using transactions that occur after the 60-day prediction window. They notice performance increases but suspect it may not generalize. They also vary class balance by oversampling churn cases. Your task is to design feature engineering and evaluation so that future information cannot influence training, and so that apparent gains reflect real predictive signal rather than artifacts. A robust workflow must use time-aware splits and define features aligned to the prediction horizon.

View question →

QuestionBack to list