| gender | department | department_name | division | assignment_category | employee_position_title | date_first_hired | year_first_hired | |
|---|---|---|---|---|---|---|---|---|
| 0 | F | FIN | Department of Finance | Operations and Administration - Risk Management | Fulltime-Regular | Program Specialist I | 06/29/2015 | 2,015 |
| 1 | M | FRS | Fire and Rescue Services | Third Battalion - Administration | Fulltime-Regular | Fire/Rescue Lieutenant | 06/07/2004 | 2,004 |
| 2 | M | HHS | Department of Health and Human Services | Environmental Health and Regulatory Services | Fulltime-Regular | Environmental Health Specialist III | 02/20/2007 | 2,007 |
| 9,226 | M | DGS | Department of General Services | Facilities Maintenance | Fulltime-Regular | Master Plumber | 03/26/2001 | 2,001 |
| 9,227 | F | HHS | Department of Health and Human Services | Infants and Toddlers | Fulltime-Regular | Program Specialist II | 03/25/2013 | 2,013 |
gender
StringDtype- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
Most frequent values
department
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
department_name
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
division
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
Most frequent values
assignment_category
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
Most frequent values
employee_position_title
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
Most frequent values
date_first_hired
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
Most frequent values
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
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 | StringDtype | False | 17 (0.2%) | 2 (< 0.1%) | |||||
| 1 | department | StringDtype | False | 0 (0.0%) | 37 (0.4%) | |||||
| 2 | department_name | StringDtype | False | 0 (0.0%) | 37 (0.4%) | |||||
| 3 | division | StringDtype | False | 0 (0.0%) | 694 (7.5%) | |||||
| 4 | assignment_category | StringDtype | False | 0 (0.0%) | 2 (< 0.1%) | |||||
| 5 | employee_position_title | StringDtype | False | 0 (0.0%) | 443 (4.8%) | |||||
| 6 | date_first_hired | StringDtype | 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 |
No columns match the selected filter: . You can change the column filter in the dropdown menu above.
gender
StringDtype- Null values
- 17 (0.2%)
- Unique values
- 2 (< 0.1%)
Most frequent values
department
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
department_name
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 37 (0.4%)
Most frequent values
division
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
694 (7.5%)
This column has a high cardinality (> 40).
Most frequent values
assignment_category
StringDtype- Null values
- 0 (0.0%)
- Unique values
- 2 (< 0.1%)
Most frequent values
employee_position_title
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
443 (4.8%)
This column has a high cardinality (> 40).
Most frequent values
date_first_hired
StringDtype- Null values
- 0 (0.0%)
- Unique values
-
2,264 (24.5%)
This column has a high cardinality (> 40).
Most frequent values
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
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 | |
| division | assignment_category | 0.588 | |
| assignment_category | employee_position_title | 0.485 | |
| division | employee_position_title | 0.414 | |
| department_name | assignment_category | 0.412 | |
| department | assignment_category | 0.412 | |
| department | employee_position_title | 0.409 | |
| department_name | employee_position_title | 0.409 | |
| department | division | 0.358 | |
| department_name | division | 0.358 | |
| gender | department | 0.358 | |
| gender | department_name | 0.358 | |
| employee_position_title | date_first_hired | 0.294 | |
| gender | employee_position_title | 0.246 | |
| gender | assignment_category | 0.246 | |
| gender | division | 0.233 | |
| department | date_first_hired | 0.169 | |
| department_name | date_first_hired | 0.169 | |
| date_first_hired | year_first_hired | 0.159 | |
| employee_position_title | year_first_hired | 0.136 | |
| division | date_first_hired | 0.121 | |
| gender | date_first_hired | 0.107 | |
| department | year_first_hired | 0.0847 | |
| department_name | year_first_hired | 0.0847 | |
| assignment_category | date_first_hired | 0.0792 | |
| division | year_first_hired | 0.0716 | |
| gender | year_first_hired | 0.0684 | |
| assignment_category | year_first_hired | 0.0533 |
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").
Effortless Tabular Learning
The Table Vectorizer
Turn your mixed-type dataframe into a numeric
feature matrix with the
TableVectorizer.
Automatically performs preprocessing of the data, such as standardizing missing values and parsing dates,
before encoding based on whether a column contains numbers, strings, or datetimes.
The Tabular Pipeline
Choose regression or classification and let tabular_pipeline do the rest. Use the power of the TableVectorizer
to immediately create a scikit-learn baseline model with good defaults for each column
based on the datetype.
Given a complex dataframe
df: (expand for full code)
from skrub.datasets import fetch_employee_salaries
dataset = fetch_employee_salaries()
df = dataset.X
y = dataset.y
df
from sklearn.model_selection import cross_val_score
from skrub import tabular_pipeline
pipeline = tabular_pipeline('regressor')
Pipeline(steps=[('tablevectorizer',
TableVectorizer(low_cardinality=ToCategorical())),
('histgradientboostingregressor',
HistGradientBoostingRegressor())])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
cross_val_score(pipeline, df, y)
array([0.89370447, 0.89279068, 0.92282557, 0.92319094, 0.92162666])
Powerful Feature Engineering
Encode text and high cardinality categorical data:
Extract temporal features with:
Robustly scale and clip numerical features with:
Many more transformations, all scikit-learn
compatible. All transformers can be applied
to a custom selection of columns
using
ApplyToCols.
The skrub DataOps framework
Custom trainable pipelines
- Define a pipeline that transforms any data, from loading to the
final predictor.
- No restrictions on input data types: dataframes (with
dedicated
transformers),
images, or anything else. Apply different transformers to specific columns with
.skb.applyand selectors.
- No restrictions on input data types: dataframes (with
dedicated
transformers),
images, or anything else. Apply different transformers to specific columns with
- Keep using scikit-learn
transformers
and predictors in your pipeline, and
export
it as a learner providing
fit()andpredict(). - Create reports with intermediate results and links to the source code of each estimator.
Leakproof cross-validation
- Include the construction of
Xandyin the pipeline itself. - Evaluate without data leakage with the built-in cross-validation.
- Tune data pipeline decisions, not only hyperparameters:
- Combine and
nest
the
choose_*functions to build extensive hyperparameter grids with no effort. - Explore the hyperparameter space with scikit-learn or Optuna.
- Combine and
nest
the
features = order_ids.skb.apply_func( join_orders_products, vectorized_products,- agg_func="mean",+ agg_func=skrub.choose_from(["mean", "sum"]),)pred = features.skb.apply(- HistGradientBoostingClassifier(learning_rate=0.1),+ HistGradientBoostingClassifier(+ learning_rate=skrub.choose_float(0.01, 0.5, log=True)+ ), y=fraud_flags,)
Our Community
The skrub project is powered by the efforts of a world-wide community of contributors. Here we display a randomly selected group of 30 contributors.
Try it yourself!
Ready to write less code and get more insights? Dive into skrub now
and be part of an emerging community!