Test 11: Matrix Over Years
Purpose
Analyze how model features change over time, comparing samples from the most recent and least recent prediction dates. This helps detect temporal biases, shifts, or time-sensitive patterns in the data and model.
Required Inputs
From configs/env.sh:
WORK_DIR: Output directory for resultsMODEL_PATH: Path to the modelREPOSITORY_PATH: Path to the data repositoryTEST_SAMPLES: Path to the test samples
How to Run
From your TestKit folder, execute:
What This Test Does
- Compares feature matrices from the most recent and least recent prediction dates
- Builds a propensity model to differentiate between samples from different years. Uses TestModelExternal tool for more details.
- Highlights features that change over time and may introduce bias
Output Location
$WORK_DIR/compare_years/Global.html: Most important features in the propensity model (differences between years)features_diff/: Graphs comparing each important feature (least recent vs. most recent)single_features/: But Why analysis for each important feature in the propensity modelcompare_rep.txt: Text file comparing average values of each featuretest_propensity.bootstrap.pivot_txt: Propensity model performance metrics
How to Interpret Results
- Review the most important features that differ between years
- Inspect feature comparison graphs for trends, shifts, or anomalies
- Use findings to identify and address potential temporal biases in your model