Note
Go to the end to download the full example code.
SKD013 - Train-test overlap in time series#
This example demonstrates mitigations when check SKD013 fires on temporal data. The check compares datetime columns in train and test folds and flags overlap when the latest training timestamp is not strictly before the earliest test timestamp.
Mitigations from the Automated checks user guide:
use a time-based splitter such as
TimeSeriesSplitor similar.
We use the employee salaries dataset ordered by hire date and predict whether salary exceeds the median. The goal is to evaluate on future hires only so test scores reflect forward-looking performance.
Load the employee salaries dataset#
Rows are sorted by date_first_hired. We expose hire dates as a pandas
timestamp column because SKD013 requires a datetime dtype. Shuffling
before a hold-out split mixes later hires into training; that is the pattern
SKD013 is designed to catch. Use full
summarize() on the trigger;
fast_mode=True on fix cells.
import pandas as pd
from skrub.datasets import fetch_employee_salaries
dataset = fetch_employee_salaries()
df = dataset.X.copy()
df["current_annual_salary"] = dataset.y
df["timestamp"] = pd.to_datetime(df["date_first_hired"])
df = df.sort_values("timestamp").reset_index(drop=True)
y = (df["current_annual_salary"] > df["current_annual_salary"].median()).astype(int)
X = df.drop(columns=["current_annual_salary"])
TableReport confirms chronological ordering and mixed HR
features.
from skrub import TableReport
TableReport(X)
| gender | department | department_name | division | assignment_category | employee_position_title | date_first_hired | year_first_hired | timestamp | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | F | HHS | Department of Health and Human Services | Area Health Centers | Fulltime-Regular | Community Health Nurse II | 09/30/1965 | 1,965 | 1965-09-30 00:00:00 |
| 1 | F | HHS | Department of Health and Human Services | Child Welfare Services | Fulltime-Regular | Social Worker III | 06/04/1967 | 1,967 | 1967-06-04 00:00:00 |
| 2 | F | HHS | Department of Health and Human Services | Fiscal Team | Fulltime-Regular | Accountant/Auditor I | 08/21/1967 | 1,967 | 1967-08-21 00:00:00 |
| 3 | F | CCL | County Council | Council Central Staff | Fulltime-Regular | Legislative Analyst III | 10/17/1967 | 1,967 | 1967-10-17 00:00:00 |
| 4 | F | CEC | Community Engagement Cluster | Regional Services Centers | Fulltime-Regular | Manager I | 06/21/1968 | 1,968 | 1968-06-21 00:00:00 |
| 9,223 | HHS | Department of Health and Human Services | Emergency Housing Assistance | Fulltime-Regular | Social Worker II | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | |
| 9,224 | REC | Department of Recreation | Neighborhood Senior Centers - Northern | Fulltime-Regular | Recreation Specialist | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | |
| 9,225 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | |
| 9,226 | F | POL | Department of Police | MSB Communications Division | Fulltime-Regular | Public Safety Communications Specialist I | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 |
| 9,227 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 |
gender
ObjectDType- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
Most frequent values
M
F
['M', 'F']
department
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
POL
HHS
FRS
DOT
COR
DLC
DGS
LIB
DPS
SHF
['POL', 'HHS', 'FRS', 'DOT', 'COR', 'DLC', 'DGS', 'LIB', 'DPS', 'SHF']
department_name
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
Department of Police
Department of Health and Human Services
Fire and Rescue Services
Department of Transportation
Correction and Rehabilitation
Department of Liquor Control
Department of General Services
Department of Public Libraries
Department of Permitting Services
Sheriff's Office
['Department of Police', 'Department of Health and Human Services', 'Fire and Rescue Services', 'Department of Transportation', 'Correction and Rehabilitation', 'Department of Liquor Control', 'Department of General Services', 'Department of Public Libraries', 'Department of Permitting Services', "Sheriff's Office"]
division
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
Most frequent values
School Health Services
Transit Silver Spring Ride On
Transit Gaithersburg Ride On
Highway Services
Child Welfare Services
FSB Traffic Division School Safety Section
Income Supports
PSB 3rd District Patrol
PSB 4th District Patrol
List:Transit Nicholson Ride On
['School Health Services', 'Transit Silver Spring Ride On', 'Transit Gaithersburg Ride On', 'Highway Services', 'Child Welfare Services', 'FSB Traffic Division School Safety Section', 'Income Supports', 'PSB 3rd District Patrol', 'PSB 4th District Patrol', 'Transit Nicholson Ride On']
assignment_category
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
Most frequent values
Fulltime-Regular
Parttime-Regular
['Fulltime-Regular', 'Parttime-Regular']
employee_position_title
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
Most frequent values
Bus Operator
Police Officer III
Firefighter/Rescuer III
Manager III
Firefighter/Rescuer II
Master Firefighter/Rescuer
Office Services Coordinator
School Health Room Technician I
Police Officer II
List:Community Health Nurse II
['Bus Operator', 'Police Officer III', 'Firefighter/Rescuer III', 'Manager III', 'Firefighter/Rescuer II', 'Master Firefighter/Rescuer', 'Office Services Coordinator', 'School Health Room Technician I', 'Police Officer II', 'Community Health Nurse II']
date_first_hired
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
Most frequent values
12/12/2016
01/14/2013
02/24/2014
03/10/2014
08/12/2013
09/22/2014
10/06/2014
03/19/2007
07/16/2012
List:07/29/2013
['12/12/2016', '01/14/2013', '02/24/2014', '03/10/2014', '08/12/2013', '09/22/2014', '10/06/2014', '03/19/2007', '07/16/2012', '07/29/2013']
year_first_hired
Int64DType- Null values
- 0 (0.0%)
- Unique values
-
51 (0.6%)
This column has a high cardinality (> 40).
- Mean ± Std
- 2.00e+03 ± 9.33
- Median ± IQR
- 2,005 ± 14
- Min | Max
- 1,965 | 2,016
timestamp
DateTime64DType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
- Min | Max
- 1965-09-30T00:00:00 | 2016-12-27T00:00:00
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
|
Column
|
Column name
|
dtype
|
Is sorted
|
Null values
|
Unique values
|
Mean
|
Std
|
Min
|
Median
|
Max
|
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | gender | ObjectDType | False | 17 (0.2%) | 2 (< 0.1%) | |||||
| 1 | department | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 2 | department_name | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 3 | division | ObjectDType | False | 0 (0.0%) | 694 (7.5%) | |||||
| 4 | assignment_category | ObjectDType | False | 0 (0.0%) | 2 (< 0.1%) | |||||
| 5 | employee_position_title | ObjectDType | False | 0 (0.0%) | 443 (4.8%) | |||||
| 6 | date_first_hired | ObjectDType | False | 0 (0.0%) | 2264 (24.5%) | |||||
| 7 | year_first_hired | Int64DType | True | 0 (0.0%) | 51 (0.6%) | 2.00e+03 | 9.33 | 1,965 | 2,005 | 2,016 |
| 8 | timestamp | DateTime64DType | True | 0 (0.0%) | 2264 (24.5%) | 1965-09-30T00:00:00 | 2016-12-27T00:00:00 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
gender
ObjectDType- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
Most frequent values
M
F
['M', 'F']
department
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
POL
HHS
FRS
DOT
COR
DLC
DGS
LIB
DPS
SHF
['POL', 'HHS', 'FRS', 'DOT', 'COR', 'DLC', 'DGS', 'LIB', 'DPS', 'SHF']
department_name
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
Department of Police
Department of Health and Human Services
Fire and Rescue Services
Department of Transportation
Correction and Rehabilitation
Department of Liquor Control
Department of General Services
Department of Public Libraries
Department of Permitting Services
Sheriff's Office
['Department of Police', 'Department of Health and Human Services', 'Fire and Rescue Services', 'Department of Transportation', 'Correction and Rehabilitation', 'Department of Liquor Control', 'Department of General Services', 'Department of Public Libraries', 'Department of Permitting Services', "Sheriff's Office"]
division
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
Most frequent values
School Health Services
Transit Silver Spring Ride On
Transit Gaithersburg Ride On
Highway Services
Child Welfare Services
FSB Traffic Division School Safety Section
Income Supports
PSB 3rd District Patrol
PSB 4th District Patrol
List:Transit Nicholson Ride On
['School Health Services', 'Transit Silver Spring Ride On', 'Transit Gaithersburg Ride On', 'Highway Services', 'Child Welfare Services', 'FSB Traffic Division School Safety Section', 'Income Supports', 'PSB 3rd District Patrol', 'PSB 4th District Patrol', 'Transit Nicholson Ride On']
assignment_category
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
Most frequent values
Fulltime-Regular
Parttime-Regular
['Fulltime-Regular', 'Parttime-Regular']
employee_position_title
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
Most frequent values
Bus Operator
Police Officer III
Firefighter/Rescuer III
Manager III
Firefighter/Rescuer II
Master Firefighter/Rescuer
Office Services Coordinator
School Health Room Technician I
Police Officer II
List:Community Health Nurse II
['Bus Operator', 'Police Officer III', 'Firefighter/Rescuer III', 'Manager III', 'Firefighter/Rescuer II', 'Master Firefighter/Rescuer', 'Office Services Coordinator', 'School Health Room Technician I', 'Police Officer II', 'Community Health Nurse II']
date_first_hired
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
Most frequent values
12/12/2016
01/14/2013
02/24/2014
03/10/2014
08/12/2013
09/22/2014
10/06/2014
03/19/2007
07/16/2012
List:07/29/2013
['12/12/2016', '01/14/2013', '02/24/2014', '03/10/2014', '08/12/2013', '09/22/2014', '10/06/2014', '03/19/2007', '07/16/2012', '07/29/2013']
year_first_hired
Int64DType- Null values
- 0 (0.0%)
- Unique values
-
51 (0.6%)
This column has a high cardinality (> 40).
- Mean ± Std
- 2.00e+03 ± 9.33
- Median ± IQR
- 2,005 ± 14
- Min | Max
- 1,965 | 2,016
timestamp
DateTime64DType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
- Min | Max
- 1965-09-30T00:00:00 | 2016-12-27T00:00:00
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
| Column 1 | Column 2 | Cramér's V | Pearson's Correlation |
|---|---|---|---|
| department | department_name | 1.00 | |
| year_first_hired | timestamp | 0.950 | |
| division | assignment_category | 0.611 | |
| assignment_category | employee_position_title | 0.518 | |
| department | employee_position_title | 0.419 | |
| department_name | employee_position_title | 0.419 | |
| division | employee_position_title | 0.398 | |
| department_name | assignment_category | 0.376 | |
| department | assignment_category | 0.376 | |
| gender | department | 0.364 | |
| gender | department_name | 0.364 | |
| department_name | division | 0.361 | |
| department | division | 0.361 | |
| gender | employee_position_title | 0.273 | |
| employee_position_title | date_first_hired | 0.254 | |
| gender | assignment_category | 0.246 | |
| gender | division | 0.243 | |
| date_first_hired | timestamp | 0.160 | |
| date_first_hired | year_first_hired | 0.158 | |
| department | date_first_hired | 0.150 | |
| department_name | date_first_hired | 0.150 | |
| employee_position_title | timestamp | 0.149 | |
| employee_position_title | year_first_hired | 0.145 | |
| division | date_first_hired | 0.103 | |
| gender | date_first_hired | 0.102 | |
| department_name | timestamp | 0.100 | |
| department | timestamp | 0.100 | |
| department_name | year_first_hired | 0.0962 | |
| department | year_first_hired | 0.0962 | |
| gender | timestamp | 0.0851 | |
| gender | year_first_hired | 0.0806 | |
| assignment_category | date_first_hired | 0.0801 | |
| division | timestamp | 0.0724 | |
| division | year_first_hired | 0.0720 | |
| assignment_category | timestamp | 0.0593 | |
| assignment_category | year_first_hired | 0.0543 |
Please enable javascript
The skrub table reports need javascript to display correctly. If you are displaying a report in a Jupyter notebook and you see this message, you may need to re-execute the cell or to trust the notebook (button on the top right or "File > Trust notebook").
The binary target marks above-median earners, a classification view of the salary column.
TableReport(y.to_frame(name="high_earner"))
| high_earner | |
|---|---|
| 0 | 1 |
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 9,223 | 0 |
| 9,224 | 0 |
| 9,225 | 0 |
| 9,226 | 0 |
| 9,227 | 0 |
high_earner
Int64DType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
- Mean ± Std
- 0.500 ± 0.500
- Median ± IQR
- 0 ± 1
- Min | Max
- 0 | 1
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
|
Column
|
Column name
|
dtype
|
Is sorted
|
Null values
|
Unique values
|
Mean
|
Std
|
Min
|
Median
|
Max
|
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | high_earner | Int64DType | False | 0 (0.0%) | 2 (< 0.1%) | 0.500 | 0.500 | 0 | 0 | 1 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
high_earner
Int64DType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
- Mean ± Std
- 0.500 ± 0.500
- Median ± IQR
- 0 ± 1
- Min | Max
- 0 | 1
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
Please enable javascript
The skrub table reports need javascript to display correctly. If you are displaying a report in a Jupyter notebook and you see this message, you may need to re-execute the cell or to trust the notebook (button on the top right or "File > Trust notebook").
Trigger SKD013 - shuffled train/test split#
TrainTestSplit with shuffle=True randomizes row order
before cutting folds, so future timestamps land in training. Fit a tabular
classifier and summarize checks.
from skore import TrainTestSplit, evaluate
from skrub import tabular_pipeline
splitter_shuffled = TrainTestSplit(random_state=42, shuffle=True)
report = evaluate(
tabular_pipeline("classifier"),
X=X,
y=y,
pos_label=1,
splitter=splitter_shuffled,
)
report
| Metric | HistGradientBoostingClassifier |
|---|---|
| Accuracy | 0.942579 |
| Precision | 0.945856 |
| Recall | 0.937568 |
| ROC AUC | 0.988270 |
| Log loss | 0.141108 |
| Brier score | 0.043155 |
| Fit time (s) | 2.127929 |
| Predict time (s) | 0.252934 |
- [SKD008] Highly correlated input features. 12 pair(s) of features have a Spearman correlation above 0.9. Highly correlated features can destabilize linear model coefficients and feature-importance estimates, and may cause collinearity-induced numerical issues.Dropping redundant features may also improve model performance.
- [SKD013] Train-test overlap in time series. Datetime column(s) ['timestamp'] contain training timestamps that are after the earliest test timestamp. Future points may be leaking into the training set; consider a time-based split.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD003] Inconsistent performance across splits. Not applicable to estimator reports.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
No checks were muted.
Fast mode is on: expensive checks are skipped unless already cached.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
Pipeline(steps=[('tablevectorizer',
TableVectorizer(low_cardinality=ToCategorical())),
('histgradientboostingclassifier',
HistGradientBoostingClassifier())])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Parameters
Fitted attributes
Parameters
Fitted attributes
['year_first_hired']
Parameters
['date_first_hired', 'timestamp']
Parameters
['gender', 'department', 'department_name', 'assignment_category']
Parameters
['division', 'employee_position_title']
Parameters
73 features
| gender |
| department |
| department_name |
| division_00 |
| division_01 |
| division_02 |
| division_03 |
| division_04 |
| division_05 |
| division_06 |
| division_07 |
| division_08 |
| division_09 |
| division_10 |
| division_11 |
| division_12 |
| division_13 |
| division_14 |
| division_15 |
| division_16 |
| division_17 |
| division_18 |
| division_19 |
| division_20 |
| division_21 |
| division_22 |
| division_23 |
| division_24 |
| division_25 |
| division_26 |
| division_27 |
| division_28 |
| division_29 |
| assignment_category |
| employee_position_title_00 |
| employee_position_title_01 |
| employee_position_title_02 |
| employee_position_title_03 |
| employee_position_title_04 |
| employee_position_title_05 |
| employee_position_title_06 |
| employee_position_title_07 |
| employee_position_title_08 |
| employee_position_title_09 |
| employee_position_title_10 |
| employee_position_title_11 |
| employee_position_title_12 |
| employee_position_title_13 |
| employee_position_title_14 |
| employee_position_title_15 |
| employee_position_title_16 |
| employee_position_title_17 |
| employee_position_title_18 |
| employee_position_title_19 |
| employee_position_title_20 |
| employee_position_title_21 |
| employee_position_title_22 |
| employee_position_title_23 |
| employee_position_title_24 |
| employee_position_title_25 |
| employee_position_title_26 |
| employee_position_title_27 |
| employee_position_title_28 |
| employee_position_title_29 |
| date_first_hired_year |
| date_first_hired_month |
| date_first_hired_day |
| date_first_hired_total_seconds |
| year_first_hired |
| timestamp_year |
| timestamp_month |
| timestamp_day |
| timestamp_total_seconds |
Parameters
Fitted attributes
| gender | department | department_name | division | assignment_category | employee_position_title | date_first_hired | year_first_hired | timestamp | current_annual_salary | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | M | DLC | Department of Liquor Control | Leisure World | Parttime-Regular | Liquor Store Clerk I | 02/17/2008 | 2,008 | 2008-02-17 00:00:00 | 0 |
| 1 | M | POL | Department of Police | MSB Communications Division | Fulltime-Regular | Manager II | 02/01/1993 | 1,993 | 1993-02-01 00:00:00 | 1 |
| 2 | F | HHS | Department of Health and Human Services | School Health Services | Parttime-Regular | Community Health Nurse II | 08/06/2007 | 2,007 | 2007-08-06 00:00:00 | 1 |
| 3 | M | FRS | Fire and Rescue Services | Station 30 | Fulltime-Regular | Firefighter/Rescuer III | 01/30/2006 | 2,006 | 2006-01-30 00:00:00 | 1 |
| 4 | F | DGS | Department of General Services | Building Design and Construction | Fulltime-Regular | Senior Engineer | 05/02/2005 | 2,005 | 2005-05-02 00:00:00 | 1 |
| 9,223 | F | HHS | Department of Health and Human Services | Permanent Supportive Housing | Fulltime-Regular | Social Worker III | 03/07/1994 | 1,994 | 1994-03-07 00:00:00 | 1 |
| 9,224 | M | DLC | Department of Liquor Control | Beer Delivery Operations | Fulltime-Regular | Truck Driver Helper/Warehouse Worker | 04/16/2008 | 2,008 | 2008-04-16 00:00:00 | 0 |
| 9,225 | M | POL | Department of Police | PSB 5th District Patrol | Fulltime-Regular | Police Officer II | 02/24/2014 | 2,014 | 2014-02-24 00:00:00 | 0 |
| 9,226 | M | FRS | Fire and Rescue Services | Station 19 | Fulltime-Regular | Firefighter/Rescuer II | 03/10/2014 | 2,014 | 2014-03-10 00:00:00 | 0 |
| 9,227 | F | DGS | Department of General Services | Building Design and Construction | Fulltime-Regular | Office Services Coordinator | 08/14/2000 | 2,000 | 2000-08-14 00:00:00 | 0 |
gender
ObjectDType- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
department
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
department_name
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
division
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
assignment_category
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
employee_position_title
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
date_first_hired
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
year_first_hired
Int64DType- Null values
- 0 (0.0%)
- Unique values
-
51 (0.6%)
This column has a high cardinality (> 40).
- Mean ± Std
- 2.00e+03 ± 9.33
- Median ± IQR
- 2,005 ± 14
- Min | Max
- 1,965 | 2,016
timestamp
DateTime64DType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
- Min | Max
- 1965-09-30T00:00:00 | 2016-12-27T00:00:00
current_annual_salary
Int64DType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
- Mean ± Std
- 0.500 ± 0.500
- Median ± IQR
- 0 ± 1
- Min | Max
- 0 | 1
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
|
Column
|
Column name
|
dtype
|
Is sorted
|
Null values
|
Unique values
|
Mean
|
Std
|
Min
|
Median
|
Max
|
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | gender | ObjectDType | False | 17 (0.2%) | 2 (< 0.1%) | |||||
| 1 | department | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 2 | department_name | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 3 | division | ObjectDType | False | 0 (0.0%) | 694 (7.5%) | |||||
| 4 | assignment_category | ObjectDType | False | 0 (0.0%) | 2 (< 0.1%) | |||||
| 5 | employee_position_title | ObjectDType | False | 0 (0.0%) | 443 (4.8%) | |||||
| 6 | date_first_hired | ObjectDType | False | 0 (0.0%) | 2264 (24.5%) | |||||
| 7 | year_first_hired | Int64DType | False | 0 (0.0%) | 51 (0.6%) | 2.00e+03 | 9.33 | 1,965 | 2,005 | 2,016 |
| 8 | timestamp | DateTime64DType | False | 0 (0.0%) | 2264 (24.5%) | 1965-09-30T00:00:00 | 2016-12-27T00:00:00 | |||
| 9 | current_annual_salary | Int64DType | False | 0 (0.0%) | 2 (< 0.1%) | 0.500 | 0.500 | 0 | 0 | 1 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
Please enable javascript
The skrub table reports need javascript to display correctly. If you are displaying a report in a Jupyter notebook and you see this message, you may need to re-execute the cell or to trust the notebook (button on the top right or "File > Trust notebook").
SKD013 should list timestamp as overlapping between train and test.
report.checks.summarize()
- [SKD008] Highly correlated input features. 12 pair(s) of features have a Spearman correlation above 0.9. Highly correlated features can destabilize linear model coefficients and feature-importance estimates, and may cause collinearity-induced numerical issues.Dropping redundant features may also improve model performance.
- [SKD013] Train-test overlap in time series. Datetime column(s) ['timestamp'] contain training timestamps that are after the earliest test timestamp. Future points may be leaking into the training set; consider a time-based split.
- [SKD009] Model performance vs. HistGradientBoosting baseline. Your model is on par with or better than a HistGradientBoosting baseline. Baseline performance on the test set, for reference: Accuracy=0.941, Brier score=0.0431, Log loss=0.142, Precision=0.944, ROC AUC=0.988, Recall=0.938.
- [SKD012] Useless features. Feature(s) ['department_name', 'gender', 'timestamp', 'year_first_hired'] have permutation importance overlapping with zero and could likely be dropped without degrading performance. Dropping redundant features may also improve model performance.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD003] Inconsistent performance across splits. Not applicable to estimator reports.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
No checks were skipped in fast mode.
No checks were muted.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
report.metrics.summarize(data_source="both").frame(favorability=True)
| HistGradientBoostingClassifier (train) | HistGradientBoostingClassifier (test) | favorability | |
|---|---|---|---|
| metric | |||
| accuracy | 0.986589 | 0.942579 | (↗︎) |
| precision | 0.989133 | 0.945856 | (↗︎) |
| recall | 0.984054 | 0.937568 | (↗︎) |
| roc_auc | 0.999216 | 0.988270 | (↗︎) |
| log_loss | 0.053973 | 0.141108 | (↘︎) |
| brier_score | 0.012377 | 0.043155 | (↘︎) |
| fit_time | 2.127929 | 2.127929 | (↘︎) |
| predict_time | 0.812125 | 0.252934 | (↘︎) |
Optimistic scores under shuffled splits are a leakage artifact; SKD013 forces you to respect time ordering before trusting metrics.
Chronological hold-out#
shuffle=False keeps the test block as the latest rows in the table. No
training row should carry a timestamp on or after the earliest test hire.
splitter_chrono = TrainTestSplit(random_state=42, shuffle=False)
report_chrono = evaluate(
tabular_pipeline("classifier"),
X=X,
y=y,
pos_label=1,
splitter=splitter_chrono,
)
report_chrono
| Metric | HistGradientBoostingClassifier |
|---|---|
| Accuracy | 0.929577 |
| Precision | 0.805479 |
| Recall | 0.832861 |
| ROC AUC | 0.974609 |
| Log loss | 0.165643 |
| Brier score | 0.051366 |
| Fit time (s) | 2.283330 |
| Predict time (s) | 0.290345 |
- [SKD001] Potential overfitting. Significant train/test gaps were found for 4/6 default predictive metrics.
- [SKD008] Highly correlated input features. 12 pair(s) of features have a Spearman correlation above 0.9. Highly correlated features can destabilize linear model coefficients and feature-importance estimates, and may cause collinearity-induced numerical issues.Dropping redundant features may also improve model performance.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD003] Inconsistent performance across splits. Not applicable to estimator reports.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
No checks were muted.
Fast mode is on: expensive checks are skipped unless already cached.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
Pipeline(steps=[('tablevectorizer',
TableVectorizer(low_cardinality=ToCategorical())),
('histgradientboostingclassifier',
HistGradientBoostingClassifier())])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Parameters
Fitted attributes
Parameters
Fitted attributes
['year_first_hired']
Parameters
['date_first_hired', 'timestamp']
Parameters
['gender', 'department', 'department_name', 'assignment_category']
Parameters
['division', 'employee_position_title']
Parameters
73 features
| gender |
| department |
| department_name |
| division_00 |
| division_01 |
| division_02 |
| division_03 |
| division_04 |
| division_05 |
| division_06 |
| division_07 |
| division_08 |
| division_09 |
| division_10 |
| division_11 |
| division_12 |
| division_13 |
| division_14 |
| division_15 |
| division_16 |
| division_17 |
| division_18 |
| division_19 |
| division_20 |
| division_21 |
| division_22 |
| division_23 |
| division_24 |
| division_25 |
| division_26 |
| division_27 |
| division_28 |
| division_29 |
| assignment_category |
| employee_position_title_00 |
| employee_position_title_01 |
| employee_position_title_02 |
| employee_position_title_03 |
| employee_position_title_04 |
| employee_position_title_05 |
| employee_position_title_06 |
| employee_position_title_07 |
| employee_position_title_08 |
| employee_position_title_09 |
| employee_position_title_10 |
| employee_position_title_11 |
| employee_position_title_12 |
| employee_position_title_13 |
| employee_position_title_14 |
| employee_position_title_15 |
| employee_position_title_16 |
| employee_position_title_17 |
| employee_position_title_18 |
| employee_position_title_19 |
| employee_position_title_20 |
| employee_position_title_21 |
| employee_position_title_22 |
| employee_position_title_23 |
| employee_position_title_24 |
| employee_position_title_25 |
| employee_position_title_26 |
| employee_position_title_27 |
| employee_position_title_28 |
| employee_position_title_29 |
| date_first_hired_year |
| date_first_hired_month |
| date_first_hired_day |
| date_first_hired_total_seconds |
| year_first_hired |
| timestamp_year |
| timestamp_month |
| timestamp_day |
| timestamp_total_seconds |
Parameters
Fitted attributes
| gender | department | department_name | division | assignment_category | employee_position_title | date_first_hired | year_first_hired | timestamp | current_annual_salary | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | F | HHS | Department of Health and Human Services | Area Health Centers | Fulltime-Regular | Community Health Nurse II | 09/30/1965 | 1,965 | 1965-09-30 00:00:00 | 1 |
| 1 | F | HHS | Department of Health and Human Services | Child Welfare Services | Fulltime-Regular | Social Worker III | 06/04/1967 | 1,967 | 1967-06-04 00:00:00 | 1 |
| 2 | F | HHS | Department of Health and Human Services | Fiscal Team | Fulltime-Regular | Accountant/Auditor I | 08/21/1967 | 1,967 | 1967-08-21 00:00:00 | 1 |
| 3 | F | CCL | County Council | Council Central Staff | Fulltime-Regular | Legislative Analyst III | 10/17/1967 | 1,967 | 1967-10-17 00:00:00 | 1 |
| 4 | F | CEC | Community Engagement Cluster | Regional Services Centers | Fulltime-Regular | Manager I | 06/21/1968 | 1,968 | 1968-06-21 00:00:00 | 1 |
| 9,223 | HHS | Department of Health and Human Services | Emergency Housing Assistance | Fulltime-Regular | Social Worker II | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,224 | REC | Department of Recreation | Neighborhood Senior Centers - Northern | Fulltime-Regular | Recreation Specialist | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,225 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,226 | F | POL | Department of Police | MSB Communications Division | Fulltime-Regular | Public Safety Communications Specialist I | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 |
| 9,227 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 |
gender
ObjectDType- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
department
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
department_name
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
division
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
assignment_category
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
employee_position_title
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
date_first_hired
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
year_first_hired
Int64DType- Null values
- 0 (0.0%)
- Unique values
-
51 (0.6%)
This column has a high cardinality (> 40).
- Mean ± Std
- 2.00e+03 ± 9.33
- Median ± IQR
- 2,005 ± 14
- Min | Max
- 1,965 | 2,016
timestamp
DateTime64DType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
- Min | Max
- 1965-09-30T00:00:00 | 2016-12-27T00:00:00
current_annual_salary
Int64DType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
- Mean ± Std
- 0.500 ± 0.500
- Median ± IQR
- 0 ± 1
- Min | Max
- 0 | 1
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
|
Column
|
Column name
|
dtype
|
Is sorted
|
Null values
|
Unique values
|
Mean
|
Std
|
Min
|
Median
|
Max
|
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | gender | ObjectDType | False | 17 (0.2%) | 2 (< 0.1%) | |||||
| 1 | department | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 2 | department_name | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 3 | division | ObjectDType | False | 0 (0.0%) | 694 (7.5%) | |||||
| 4 | assignment_category | ObjectDType | False | 0 (0.0%) | 2 (< 0.1%) | |||||
| 5 | employee_position_title | ObjectDType | False | 0 (0.0%) | 443 (4.8%) | |||||
| 6 | date_first_hired | ObjectDType | False | 0 (0.0%) | 2264 (24.5%) | |||||
| 7 | year_first_hired | Int64DType | True | 0 (0.0%) | 51 (0.6%) | 2.00e+03 | 9.33 | 1,965 | 2,005 | 2,016 |
| 8 | timestamp | DateTime64DType | True | 0 (0.0%) | 2264 (24.5%) | 1965-09-30T00:00:00 | 2016-12-27T00:00:00 | |||
| 9 | current_annual_salary | Int64DType | False | 0 (0.0%) | 2 (< 0.1%) | 0.500 | 0.500 | 0 | 0 | 1 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
Please enable javascript
The skrub table reports need javascript to display correctly. If you are displaying a report in a Jupyter notebook and you see this message, you may need to re-execute the cell or to trust the notebook (button on the top right or "File > Trust notebook").
SKD013 should be absent; test rows are strictly after train rows.
report_chrono.checks.summarize(fast_mode=True)
- [SKD001] Potential overfitting. Significant train/test gaps were found for 4/6 default predictive metrics.
- [SKD008] Highly correlated input features. 12 pair(s) of features have a Spearman correlation above 0.9. Highly correlated features can destabilize linear model coefficients and feature-importance estimates, and may cause collinearity-induced numerical issues.Dropping redundant features may also improve model performance.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD003] Inconsistent performance across splits. Not applicable to estimator reports.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
No checks were muted.
Fast mode is on: expensive checks are skipped unless already cached.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
report_chrono.metrics.summarize(data_source="both").frame(favorability=True)
| HistGradientBoostingClassifier (train) | HistGradientBoostingClassifier (test) | favorability | |
|---|---|---|---|
| metric | |||
| accuracy | 0.987673 | 0.929577 | (↗︎) |
| precision | 0.991280 | 0.805479 | (↗︎) |
| recall | 0.987324 | 0.832861 | (↗︎) |
| roc_auc | 0.999099 | 0.974609 | (↗︎) |
| log_loss | 0.054897 | 0.165643 | (↘︎) |
| brier_score | 0.012701 | 0.051366 | (↘︎) |
| fit_time | 2.283330 | 2.283330 | (↘︎) |
| predict_time | 0.812014 | 0.290345 | (↘︎) |
A simple chronological hold-out is often enough for deployment monitoring when you score on the most recent period.
TimeSeriesSplit for cross-validated evaluation#
TimeSeriesSplit trains on past rows and
tests on the next chunk in each fold. Many employees share the same hire
date, so a default split can still place the same calendar day in train and
test at the fold boundary (SKD013 uses >=). A small gap skips rows
between folds and clears that tie. Early folds are small and unrelated checks
such as SKD008 may warn on encoded features; we ignore SKD008 here to focus
on temporal validity.
from sklearn.model_selection import TimeSeriesSplit
splitter_tscv = TimeSeriesSplit(n_splits=5, gap=50)
report_tscv = evaluate(
tabular_pipeline("classifier"),
X=X,
y=y,
pos_label=1,
splitter=splitter_tscv,
)
report_tscv
| Metric | mean | std |
|---|---|---|
| Accuracy | 0.904551 | 0.048561 |
| Precision | 0.827716 | 0.095307 |
| Recall | 0.917845 | 0.060860 |
| ROC AUC | 0.946625 | 0.032176 |
| Log loss | 0.331034 | 0.175837 |
| Brier score | 0.079583 | 0.042230 |
| Fit time (s) | 1.667619 | 0.445724 |
| Predict time (s) | 0.275924 | 0.066148 |
- [SKD001] Potential overfitting. Significant train/test gaps were found for 4/6 default predictive metrics.
- [SKD008] Highly correlated input features. 12 pair(s) of features have a Spearman correlation above 0.9. Highly correlated features can destabilize linear model coefficients and feature-importance estimates, and may cause collinearity-induced numerical issues.Dropping redundant features may also improve model performance.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
No checks were muted.
Fast mode is on: expensive checks are skipped unless already cached.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
Pipeline(steps=[('tablevectorizer',
TableVectorizer(low_cardinality=ToCategorical())),
('histgradientboostingclassifier',
HistGradientBoostingClassifier())])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
| gender | department | department_name | division | assignment_category | employee_position_title | date_first_hired | year_first_hired | timestamp | current_annual_salary | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | F | HHS | Department of Health and Human Services | Area Health Centers | Fulltime-Regular | Community Health Nurse II | 09/30/1965 | 1,965 | 1965-09-30 00:00:00 | 1 |
| 1 | F | HHS | Department of Health and Human Services | Child Welfare Services | Fulltime-Regular | Social Worker III | 06/04/1967 | 1,967 | 1967-06-04 00:00:00 | 1 |
| 2 | F | HHS | Department of Health and Human Services | Fiscal Team | Fulltime-Regular | Accountant/Auditor I | 08/21/1967 | 1,967 | 1967-08-21 00:00:00 | 1 |
| 3 | F | CCL | County Council | Council Central Staff | Fulltime-Regular | Legislative Analyst III | 10/17/1967 | 1,967 | 1967-10-17 00:00:00 | 1 |
| 4 | F | CEC | Community Engagement Cluster | Regional Services Centers | Fulltime-Regular | Manager I | 06/21/1968 | 1,968 | 1968-06-21 00:00:00 | 1 |
| 9,223 | HHS | Department of Health and Human Services | Emergency Housing Assistance | Fulltime-Regular | Social Worker II | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,224 | REC | Department of Recreation | Neighborhood Senior Centers - Northern | Fulltime-Regular | Recreation Specialist | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,225 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 | |
| 9,226 | F | POL | Department of Police | MSB Communications Division | Fulltime-Regular | Public Safety Communications Specialist I | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 |
| 9,227 | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Aide | 12/27/2016 | 2,016 | 2016-12-27 00:00:00 | 0 |
gender
ObjectDType- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
department
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
department_name
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
division
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
assignment_category
ObjectDType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
employee_position_title
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
date_first_hired
ObjectDType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
year_first_hired
Int64DType- Null values
- 0 (0.0%)
- Unique values
-
51 (0.6%)
This column has a high cardinality (> 40).
- Mean ± Std
- 2.00e+03 ± 9.33
- Median ± IQR
- 2,005 ± 14
- Min | Max
- 1,965 | 2,016
timestamp
DateTime64DType- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
- Min | Max
- 1965-09-30T00:00:00 | 2016-12-27T00:00:00
current_annual_salary
Int64DType- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
- Mean ± Std
- 0.500 ± 0.500
- Median ± IQR
- 0 ± 1
- Min | Max
- 0 | 1
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
|
Column
|
Column name
|
dtype
|
Is sorted
|
Null values
|
Unique values
|
Mean
|
Std
|
Min
|
Median
|
Max
|
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | gender | ObjectDType | False | 17 (0.2%) | 2 (< 0.1%) | |||||
| 1 | department | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 2 | department_name | ObjectDType | False | 0 (0.0%) | 37 (0.4%) | |||||
| 3 | division | ObjectDType | False | 0 (0.0%) | 694 (7.5%) | |||||
| 4 | assignment_category | ObjectDType | False | 0 (0.0%) | 2 (< 0.1%) | |||||
| 5 | employee_position_title | ObjectDType | False | 0 (0.0%) | 443 (4.8%) | |||||
| 6 | date_first_hired | ObjectDType | False | 0 (0.0%) | 2264 (24.5%) | |||||
| 7 | year_first_hired | Int64DType | True | 0 (0.0%) | 51 (0.6%) | 2.00e+03 | 9.33 | 1,965 | 2,005 | 2,016 |
| 8 | timestamp | DateTime64DType | True | 0 (0.0%) | 2264 (24.5%) | 1965-09-30T00:00:00 | 2016-12-27T00:00:00 | |||
| 9 | current_annual_salary | Int64DType | False | 0 (0.0%) | 2 (< 0.1%) | 0.500 | 0.500 | 0 | 0 | 1 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
Please enable javascript
The skrub table reports need javascript to display correctly. If you are displaying a report in a Jupyter notebook and you see this message, you may need to re-execute the cell or to trust the notebook (button on the top right or "File > Trust notebook").
SKD013 should be absent; no fold trains on timestamps on or after its test block.
report_tscv.checks.summarize(fast_mode=True, ignore=["SKD008"])
- [SKD001] Potential overfitting. Significant train/test gaps were found for 4/6 default predictive metrics.
- [SKD016] Estimator not tuned. Estimator(s) left at default settings; consider tuning: ['learning_rate', 'max_leaf_nodes'] for HistGradientBoostingClassifier.
- [SKD005] Underrepresented classes. ML task is not multiclass classification. Got binary-classification.
- [SKD006] Coefficient interpretation. Estimator is not a linear model: it does not have a `coef_` attribute.
- [SKD007] MDI biased for high-cardinality features. Estimator is not a tree-based model: it does not have a `feature_importances_` attribute.
- [SKD014] Hyperparameters at search edge. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD015] Hyperparameters worth tuning. Estimator is not a BaseSearchCV instance. Got Pipeline.
- [SKD008] Highly correlated input features.
Fast mode is on: expensive checks are skipped unless already cached.
Mute a check by passing its code to ignore, e.g. .checks.summarize(ignore=['SKD001']).
report_tscv.metrics.summarize(data_source="both").frame(aggregate="mean")
| histgradientboostingclassifier_(train)_mean | histgradientboostingclassifier_(test)_mean | |
|---|---|---|
| metric | ||
| accuracy | 0.995442 | 0.904551 |
| precision | 0.996773 | 0.827716 |
| recall | 0.995608 | 0.917845 |
| roc_auc | 0.999732 | 0.946625 |
| log_loss | 0.023278 | 0.331034 |
| brier_score | 0.004821 | 0.079583 |
| fit_time | 1.667619 | 1.667619 |
| predict_time | 0.573863 | 0.275924 |
Time-series cross-validation estimates stability across multiple forward windows, the right tool when a single hold-out is too noisy.
Conclusion#
SKD013 protects against training on the future. In this walkthrough,
disabling shuffle and adopting TimeSeriesSplit aligned evaluation with
how salary models are deployed over newly hired employees. Always pair
temporal splits with features available at prediction time.
Total running time of the script: (1 minutes 18.226 seconds)