Data Preparation for ML and AI

A Spark job merges labeled events with customer risk-score history containing multiple timestamped versions per customer. Each event must receive the most recent score available at its event time; which merge rule prevents future information from entering training data?

Show the answer

Correct answerB. Join by customer and select the latest score at or before the event

AWhy not this: The nearest timestamp can fall after the event, making that score unavailable at prediction time.

BWhy this is right: Restricting timestamps to the event time or earlier and selecting the latest preserves historical availability.

CWhy not this: The latest score overall may have been created after the event and leak future information.

DWhy not this: Averaging all versions incorporates future scores and does not return the applicable historical version.

A point-in-time join selects the latest score whose timestamp does not exceed the event timestamp. Selecting the nearest score can use a future version and introduce data leakage.