In Google Advanced Data Analytics, which approach best prevents leakage when creating features from time-series data with rolling windows?
Answer
Calculate rolling features strictly from past timestamps only and align them to the prediction horizon
Explanation
Rolling features should be computed using only information available at or before the prediction time and aligned to the target horizon. This avoids inadvertently encoding future information into predictors.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
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 →
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 →
When interpreting SHAP values for a tree-based model on grouped categorical variables (e.g., region encoded with target encoding), which interpretation is most reliable?
View question →