compare_train_test
Detect train/test distribution shifts by checking column and dtype mismatches, unseen categories, PSI/KS, adversarial-validation AUC, temporal ordering, and unseen key overlap.
Instructions
Check whether the test set looks like the training set: column and dtype mismatches, unseen categories, PSI and KS per feature, an adversarial-validation AUC (0.5 = indistinguishable), whether the test rows come after the training period, and how many test rows belong to keys never seen in train.
Args: train_path: training table. test_path: test table (no target column needed). target: target column in the training table, excluded from the comparison. id_col: ID column, excluded from the comparison. time_col: time column to check (default: date columns are found automatically). group_col: key column to check, such as customer_id (default: found automatically). max_rows: sample size per table for the heavier checks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_col | No | ||
| target | No | ||
| max_rows | No | ||
| time_col | No | ||
| group_col | No | ||
| test_path | Yes | ||
| train_path | Yes |