A churn model is trained on customer records that show each customer’s current region. The records show that region even for churn events that happened before the customer moved.
A slowly changing dimension (SCD) is a data warehouse table of attributes that stay mostly stable but can change over time, such as a customer’s region or plan, together with a rule for whether a change overwrites the old value or keeps it as history.
Slowly changing dimensions matter for AI because a model that learns from past events needs the attribute values that were true at the time. In CUBIG’s Ready for Raw Data check, reproducibility means a team can rebuild the conditions of a comparison. Rebuilding training data for a past date likewise needs the history an SCD keeps. In the churn example, the training rows show a region the customer had not moved to yet.
Wikipedia’s Slowly changing dimension entry describes “a dimension that stores data which, while generally stable, may change over time”. The same entry says “Type 1 overwrites the old value, so no history is kept” and “Type 2 adds a new row for each change”. The Kimball Group’s Type 2 guidance adds that type 2 rows should have at least three extra columns: a row effective date or date/time stamp, an expiration date and a current row indicator.
What are the common types of slowly changing dimensions?
- Type 1 overwrites the old value and keeps no history.
- Type 2 adds a new row when an attribute changes, with effective and expiration dates that mark when each row was true.
- Other types exist for other needs, such as keeping a limited history in separate columns.
The data engineer decides whether a task needs current values only or the history of changes. That decision sets what the AI team can rebuild later.
How is a slowly changing dimension different from a snapshot table?
A snapshot table stores a full copy of the data at regular intervals, such as every month-end. A slowly changing dimension that adds a row per change stores a new row only when an attribute changes, with dates that mark when each row was true. A snapshot shows the state on its capture dates; the row-per-change dimension shows the state on any date between changes.
Why do slowly changing dimensions matter for AI training data?
The SCD type decides whether training data can reflect the past. A Type 1 overwrite can put later information into earlier examples, a form of target leakage. Type 2 history lets the data engineer rebuild point-in-time training rows, so each example uses the attribute values from the date of its event.
Syntitan is CUBIG’s AI-ready data platform. Syntitan’s Ready for Raw Data check reviews a dataset’s condition across six axes: usability, integrity, context, consistency, reproducibility and traceability. Syntitan keeps the original dataset intact, starts each Use Case Project from a copy and records preparation and verification results as Versions, so a team can tell which version of the data each preparation and verification result belongs to.
Related entries: target leakage, data versioning and data lineage.