Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9539a2c
Updating squashing scaler examples
rcap107 Aug 26, 2025
c6a7b92
addessing comments from code review
rcap107 Aug 26, 2025
13bfd3e
fixes
rcap107 Aug 26, 2025
d9824af
updating dataops userguide
rcap107 Aug 26, 2025
730f850
big overhaul of the user guide and the documentation
rcap107 Aug 27, 2025
a1b8f76
formatting
rcap107 Aug 27, 2025
faa9751
fixing pixi
rcap107 Aug 27, 2025
440a73c
Merge remote-tracking branch 'upstream/main' into doc-userguide-updates
rcap107 Aug 29, 2025
83c5c76
Merge remote-tracking branch 'upstream/main' into doc-userguide-updates
rcap107 Sep 1, 2025
0f4d5ed
iter splitting sections into files
rcap107 Sep 1, 2025
5c39347
iter - fixing missing text from new files
rcap107 Sep 1, 2025
0830a8a
iter
rcap107 Sep 2, 2025
52f80b3
iter
rcap107 Sep 2, 2025
38309d9
iter
rcap107 Sep 2, 2025
2b77fb0
iter
rcap107 Sep 2, 2025
386dde8
iter
rcap107 Sep 2, 2025
0f5af95
iter
rcap107 Sep 2, 2025
d808f14
iter
rcap107 Sep 2, 2025
e909468
renaming folder
rcap107 Sep 2, 2025
e13702c
iter
rcap107 Sep 2, 2025
8c8746e
iter
rcap107 Sep 2, 2025
7000548
various fixes to language and typos
rcap107 Sep 2, 2025
1dc0ba9
wip fixing crossreferences
rcap107 Sep 2, 2025
83a8739
fixing crossreference bug
rcap107 Sep 3, 2025
5066e10
renaming dataops to data_ops for consistency
rcap107 Sep 3, 2025
4cce86b
iter
rcap107 Sep 3, 2025
31afef4
fixing warnings
rcap107 Sep 3, 2025
0b29b1c
renaming a file
rcap107 Sep 3, 2025
80de991
iter dataops
rcap107 Sep 3, 2025
4f6e344
crossref fixes
rcap107 Sep 3, 2025
33160bf
fixing more warnings
rcap107 Sep 3, 2025
396ec5c
fixing failing doctests
rcap107 Sep 3, 2025
9c7ef15
fixing a link
rcap107 Sep 12, 2025
211b55c
fixing sphinx gremlins
rcap107 Sep 16, 2025
a092b16
Merge remote-tracking branch 'upstream/main' into doc-userguide-updates
rcap107 Sep 17, 2025
f3439c2
iter
rcap107 Sep 17, 2025
78483b3
iter
rcap107 Sep 17, 2025
759cc68
iter
rcap107 Sep 17, 2025
ce3ac54
renaming/moving files around based on comments
rcap107 Sep 17, 2025
153e0aa
mostly formatting and gremlins
rcap107 Sep 17, 2025
75c281a
Update doc/modules/tablereport/exploring_dataframes_interactively.rst
rcap107 Sep 17, 2025
6135408
rewriting
rcap107 Sep 17, 2025
4b1b438
changing intro
rcap107 Sep 17, 2025
e70437d
formatting, fixing skrub naming
rcap107 Sep 17, 2025
ce73fb1
adding back resource
rcap107 Sep 17, 2025
97ec417
Merge remote-tracking branch 'upstream/main' into doc-userguide-updates
rcap107 Sep 17, 2025
59867a4
grrr doctest
rcap107 Sep 17, 2025
61f3684
Update doc/data_ops.rst
rcap107 Sep 17, 2025
63836cf
Update doc/documentation.rst
rcap107 Sep 18, 2025
801aede
Apply suggestions from code review
rcap107 Sep 18, 2025
7a68b6f
removing unneeded report
rcap107 Sep 18, 2025
ddf4a8d
Merge remote-tracking branch 'upstream/main' into doc-userguide-updates
rcap107 Sep 18, 2025
fff4279
addressing comments
rcap107 Sep 19, 2025
80ee7b7
fixing broken refs
rcap107 Sep 19, 2025
17fedcf
adding a section
rcap107 Sep 19, 2025
5902176
more examples
rcap107 Sep 19, 2025
a85240a
Apply suggestions from code review
GaelVaroquaux Sep 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Highlights
to train and tune machine learning models. Then, the DataOps plans can be exported
as ``Learners`` (:class:`skrub.SkrubLearner`), standalone objects that can be
used on new data. More detail about the DataOps can be found in the
:ref:`User guide <userguide_data_ops>` and in the
:ref:`User guide <user_guide_data_ops_index>` and in the
:ref:`examples <data_ops_examples_ref>`.

- The :class:`TableReport` has been improved with many new features. Series are
Expand All @@ -84,12 +84,12 @@ Highlights

- :mod:`selectors`, :class:`ApplyToCols` and :class:`ApplyToFrame` are now available,
providing utilities for selecting columns to which a transformer should be applied
in a flexible way. For more details, see the :ref:`User guide <userguide_selectors>`
and the :ref:`example <sphx_glr_auto_examples_10_apply_on_cols.py>`.
in a flexible way. For more details, see the :ref:`User guide <user_guide_selectors>`
and the :ref:`example <sphx_glr_auto_examples_09_apply_to_cols.py>`.

- The :class:`SquashingScaler` has been added: it robustly rescales and smoothly
clips numerical columns, enabling more robust handling of numerical columns
with neural networks. See the :ref:`example <sphx_glr_auto_examples_11_squashing_scaler.py>`
clips numeric columns, enabling more robust handling of numeric columns
with neural networks. See the :ref:`example <sphx_glr_auto_examples_10_squashing_scaler.py>`

New features
------------
Expand Down Expand Up @@ -135,8 +135,8 @@ New features
in reports. :pr:`1470` by :user:`George S <georgescutelnicu>`.

- Added the :class:`SquashingScaler`, a transformer that
robustly rescales and smoothly clips numerical columns,
enabling more robust handling of numerical columns
robustly rescales and smoothly clips numeric columns,
enabling more robust handling of numeric columns
with neural networks. :pr:`1310` by :user:`Vincent Maladiere <Vincent-Maladiere>` and
:user:`David Holzmüller <dholzmueller>`.

Expand Down Expand Up @@ -204,7 +204,7 @@ Changes

- The :class:`TableReport` now supports Series in addition to Dataframes. :pr:`1420` by :user:`Vitor Pohlenz<vitorpohlenz>`.

- The :class:`Cleaner` now exposes a parameter to convert numerical values to float32. :pr:`1440` by
- The :class:`Cleaner` now exposes a parameter to convert numeric values to float32. :pr:`1440` by
:user:`Riccardo Cappuzzo<rcap107>`.

- The :class:`TableReport` now shows if columns are sorted. :pr:`1512` by :user:`Dea María Léon<DeaMariaLeon>`.
Expand Down Expand Up @@ -335,8 +335,7 @@ Release 0.4.1
Changes
-------

* :class: `TableReport` has `write_html` method
:pr:`1190` by :user:`Mojdeh Rastgoo<mrastgoo>`.
* :class:`TableReport` has `write_html` method. :pr:`1190` by :user:`Mojdeh Rastgoo<mrastgoo>`.

* A new parameter ``verbose`` has been added to the :class:`TableReport` to toggle on or off the
printing of progress information when a report is being generated.
Expand Down Expand Up @@ -804,7 +803,7 @@ Minor changes
- `check_is_fitted` now looks at `"transformers_"` rather than `"columns_"`
- the default of the `remainder` parameter in the docstring is now `"passthrough"`
instead of `"drop"` to match the implementation.
- uint8 and int8 dtypes are now considered as numerical columns.
- uint8 and int8 dtypes are now considered as numeric columns.

* Removed the leading "<" and trailing ">" symbols from KEN entities
and types.
Expand Down Expand Up @@ -854,10 +853,10 @@ Dirty-cat release 0.4.1

Major changes
-------------
* :func:`fuzzy_join` and :class:`FeatureAugmenter` can now join on numerical columns based on the euclidean distance.
* :func:`fuzzy_join` and :class:`FeatureAugmenter` can now join on numeric columns based on the euclidean distance.
:pr:`530` by :user:`Jovan Stojanovic <jovan-stojanovic>`

* :func:`fuzzy_join` and :class:`FeatureAugmenter` can perform many-to-many joins on lists of numerical or string key columns.
* :func:`fuzzy_join` and :class:`FeatureAugmenter` can perform many-to-many joins on lists of numeric or string key columns.
:pr:`530` by :user:`Jovan Stojanovic <jovan-stojanovic>`

* :func:`GapEncoder.transform` will not continue fitting of the instance anymore.
Expand Down Expand Up @@ -947,7 +946,7 @@ Dirty-cat Release 0.3.0
Major changes
-------------

* New encoder: :class:`DatetimeEncoder` can transform a datetime column into several numerical columns
* New encoder: :class:`DatetimeEncoder` can transform a datetime column into several numeric columns
(year, month, day, hour, minute, second, ...). It is now the default transformer used
in the :class:`TableVectorizer` for datetime columns. :pr:`239` by :user:`Leo Grinsztajn <LeoGrin>`

Expand Down
2 changes: 1 addition & 1 deletion doc/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ <h5 class="feature-title">Inspect it, apply it to new data</h5>
</div>
<p class="feature-text-see-also">
<!-- name of the userguide file on DataOps -->
<a href="userguide_data_ops.html">Discover the skrub DataOps →</a>
<a href="{{ pathto('auto_examples/data_ops/11_data_ops_intro') }}">Discover the skrub DataOps →</a>
</p>
</div>
<div class="col-md-7">
Expand Down
17 changes: 9 additions & 8 deletions doc/api_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
"sections": [
{
"description": (
"See :ref:`End-to-End pipeline <userguide_tablevectorizer>` for "
"further details. For more flexibility and control to build "
"pipelines, see the :ref:`skrub DataOps <userguide_data_ops>`."
"See :ref:`End-to-End pipeline"
" <user_guide_building_pipeline_index>` for further details. For"
" more flexibility and control to build pipelines, see the"
" :ref:`skrub DataOps <user_guide_data_ops_index>`."
),
"autosummary": [
"tabular_pipeline",
"tabular_learner",
"TableVectorizer",
"SelectCols",
"DropCols",
Expand All @@ -79,7 +79,8 @@
"sections": [
{
"description": (
"See :ref:`encoding <userguide_encoders>` for further details."
"See :ref:`encoding <user_guide_encoders_index>` for further"
" details."
),
"autosummary": [
"StringEncoder",
Expand Down Expand Up @@ -153,7 +154,7 @@
{
"description": (
"Contains method to select columns in a dataframe. See the"
" :ref:`selectors <userguide_selectors>` section for further"
" :ref:`selectors <user_guide_selectors>` section for further"
" details."
),
"autosummary": [
Expand Down Expand Up @@ -186,8 +187,8 @@
"sections": [
{
"description": (
"Generalizing the scikit-learn pipeline. "
"See :ref:`skrub DataOps <userguide_data_ops>` for further details."
"Generalizing the scikit-learn pipeline. See :ref:`skrub DataOps"
" <user_guide_data_ops_index>` for further details."
),
"autosummary": ["var", "X", "y", "as_data_op", "deferred"],
"template": "base.rst",
Expand Down
18 changes: 18 additions & 0 deletions doc/column_level_featurizing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.. _user_guide_encoders_index:
Comment thread
rcap107 marked this conversation as resolved.

Column-level feature extraction
===============================

Skrub provides various transformers that help with feature engineering numeric,
datetime and categorical data. The encoders covered in this section convert the
raw features found in an input dataframe into numeric features that can be used
directly by machine learning models.

.. include:: includes/big_toc_css.rst

.. toctree::
:maxdepth: 3

modules/column_level_featurizing/feature_engineering_categorical
modules/column_level_featurizing/feature_engineering_datetimes
modules/column_level_featurizing/robust_scaling
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
"skrub Documentation",
author,
"skrub",
"Prepping tables for machine learning.",
"Machine learning with dataframes",
"Data Science",
),
]
Expand Down Expand Up @@ -397,7 +397,7 @@ def notebook_modification_function(notebook_content, notebook_filename):
"</div>",
]
)

# TODO: remove this when we remove KEN embeddings
if "06_ken_embeddings_example" in notebook_filename:
message_class = "danger"
message = (
Expand Down
13 changes: 13 additions & 0 deletions doc/configuration_and_utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _user_guide_configuration_index:

Configuration and dataset utilities
=========================================

This section covers the skrub global configurations and dataset utilities.

.. toctree::
:maxdepth: 2

modules/configuration_and_utils/customizing_configuration
modules/configuration_and_utils/deduplicate_categorical_data
modules/configuration_and_utils/fetching_datasets
71 changes: 71 additions & 0 deletions doc/data_ops.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.. _user_guide_data_ops_index:

Complex multi-table pipelines with Data Ops
===========================================

Skrub provides an easy way to build complex, flexible machine learning pipelines.
There are several needs that are not easily addressed with standard scikit-learn
tools such as :class:`~sklearn.pipeline.Pipeline` and
:class:`~sklearn.compose.ColumnTransformer`, and for which the Skrub DataOps offer
a solution:

- Multiple tables: We often have several tables of different shapes (for
example, "Customers", "Orders", and "Products" tables) that need to be
processed and assembled into a design matrix ``X``. The target ``y`` may also
be the result of some data processing. Standard scikit-learn estimators do not
support this, as they expect right away a single design matrix ``X`` and a
target array ``y``, with one row per observation.
- DataFrame wrangling: Performing typical DataFrame operations such as
projections, joins, and aggregations should be possible and allow leveraging
the powerful and familiar APIs of `Pandas <https://pandas.pydata.org>`_ or
`Polars <https://docs.pola.rs/>`_.
- Hyperparameter tuning: Choices of estimators, hyperparameters, and even
the pipeline architecture can be guided by validation scores. Specifying
ranges of possible values outside of the pipeline itself (as in
:class:`~sklearn.model_selection.GridSearchCV`) is difficult in complex
pipelines.
- Iterative development: Building a pipeline step by step while inspecting
intermediate results allows for a short feedback loop and early discovery of
errors.

In this section we cover all about the skrub Data Ops, from starting out with a
simple example, to more advanced concepts like parameter tuning and and pipeline
validation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The below does not render great in the site's table of contents (because the titles on this page are not exposed on the site's table of content) but I don't know how to fix this, so I'm moving on for now.


Data Ops basic concepts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 3

modules/data_ops/basics/what_are_data_ops
modules/data_ops/basics/building_data_ops_plan
modules/data_ops/basics/using_previews
modules/data_ops/basics/direct_access_methods
modules/data_ops/basics/control_flow
modules/data_ops/basics/data_ops_vs_alternatives

Building a complex pipeline with the skrub Data Ops
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 2

modules/data_ops/ml_pipeline/applying_ml_estimators
modules/data_ops/ml_pipeline/applying_different_transformers
modules/data_ops/ml_pipeline/documenting_data_ops_plan
modules/data_ops/ml_pipeline/evaluating_debugging_data_ops
modules/data_ops/ml_pipeline/using_part_of_data_ops_plan
modules/data_ops/ml_pipeline/subsampling_data

Tuning and validating Skrub DataOps plans
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 2

modules/data_ops/validation/tuning_validating_data_ops
modules/data_ops/validation/hyperparameter_tuning
modules/data_ops/validation/nested_cross_validation
modules/data_ops/validation/nesting_choices_choosing_pipelines
modules/data_ops/validation/exporting_data_ops
16 changes: 16 additions & 0 deletions doc/default_wrangling.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _user_guide_building_pipeline_index:

Wrangling data with good defaults
=================================

This section covers how to build a predictive pipeline starting from a dataframe.
The skrub objects described in this section can be used as strong defaults for
building baseline pipelines, and can be customized for specific use cases.


.. toctree::
:maxdepth: 3

modules/default_wrangling/cleaning_dataframes
modules/default_wrangling/table_vectorizer
modules/default_wrangling/tabular_pipeline
52 changes: 29 additions & 23 deletions doc/documentation.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
.. |TableReport| replace:: :class:`~skrub.TableReport`
.. |Cleaner| replace:: :class:`~skrub.Cleaner`
.. |TableVectorizer| replace:: :class:`~skrub.TableVectorizer`
.. |tabular_pipeline| replace:: :func:`~skrub.tabular_pipeline`

.. _user_guide:

User Guide
==========
Skrub is a library that eases machine learning with dataframes
for machine learning.
Skrub is a library that eases machine learning with dataframes, from exploring
dataframes to validating a machine-learning pipeline.

The |TableReport| is a powerful data exploration tool, which can be followed by
data sanitization and feature engineering tools in the |Cleaner| and |TableVectorizer|.
The |tabular_pipeline| combines the two to build a strong baseline for dataframes.

The skrub :ref:`column-level encoders<user_guide_encoders_index>` can be tweaked by the user for more
specific needs.
Various :ref:`multi-column transformers <user_guide_building_pipeline_index>` and the :ref:`selectors API<user_guide_selectors>`
provide a high degree of control over which columns should be modified.

Starting from rich, complex data stored in one or several dataframes, it helps
performing the data wrangling necessary to produce a numeric array that is fed
to a machine-learning model. This wrangling comprises joining tables (possibly
with inexact matches), parsing structured data such as datetimes from text,
and extracting numeric features from non-numeric data.
More complex, multi-table scenarios can make use of the skrub :ref:`Data Ops <user_guide_data_ops_index>`,
which enable constructing and validating pipelines that involve
multiple dataframes and hyperparameter tuning.

For those tasks, skrub does not replace pandas or polars. Instead, it
Skrub does not replace pandas or polars. Instead, it
leverages the dataframe libraries to provide more high-level building blocks that
perform the data preprocessing steps that are typically needed in a machine learning
pipeline.

This guide demonstrates how to resolve various issues using Skrub's features.
See the examples section for full code snippets.


.. include:: includes/big_toc_css.rst

.. toctree::
:maxdepth: 2

userguide_tablereport
userguide_encoders
userguide_datetimes
userguide_tablevectorizer
userguide_data_cleaning
userguide_selectors
userguide_data_ops
userguide_data_ops_ml_pipeline
userguide_data_ops_validation
userguide_joining_tables
userguide_utils
:maxdepth: 3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of your PR but could you fix the first sentence above?

"Skrub is a library that eases machine learning with dataframes for machine learning."

that's just too much machine learning 😝

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still about the 1st paragraph above:

  • "helps performing" -> "helps perform" (I think)
  • should we sneak a very brief mention of tablereport in there?
  • I guess skrub goes beyond preprocessing, as it helps build and serialize whole pipelines all the way down to the final estimator + tuning and validation. I'm not sure but maybe we can slightly reword or add a short sentence to give a more comprehensive picture, it seems this intro is only describing the tablevectorizer (and the joiners which are problematic for various reasons)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote the intro here


exploring_a_dataframe
default_wrangling
column_level_featurizing
multi_column_operations
data_ops
configuration_and_utils
joining_dataframes
14 changes: 14 additions & 0 deletions doc/exploring_a_dataframe.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _user_guide_exploring_a_dataframe_index:

Exploring a Dataframe
=====================

This section covers the :class:`~skrub.TableReport` and how it can be used for exploring
and understanding your dataframes.


.. toctree::
:maxdepth: 3

modules/tablereport/exploring_dataframes_interactively
modules/tablereport/finding_correlated_columns
11 changes: 11 additions & 0 deletions doc/joining_dataframes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _user_guide_joining_dataframes:

Joining Dataframes
==================

This section covers the various methods provided by skrub to join dataframes.

.. toctree::
:maxdepth: 3

modules/joining_tables/assembling
Loading
Loading