You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<iframewidth="560"height="315"src="https://www.youtube.com/embed/5bCg8VfX2x8"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
23
23
24
24
## Upcoming feature in release 1.2
25
-
Starting next release(v1.2) Scikit-learn provides the ability for the outputs of Scikit-learn transformers to be either in Numpy or Pandas format by configuring it explicitly.Previously, mapping a transformed output back into columns would be cumbersome as it might not be a one-to-one mapping because of complex preprocessing (e.g: Polynomial features ).
26
-
The next release(v1.2) Pandas output for transformers maps the transformed features into corresponding names/how they were created automatically.This would be useful for more complex preprocessing pipelines.
25
+
Starting with the next release of [scikit-learn](https://github.com/scikit-learn/scikit-learn) (v1.2), pandas dataframe output will be available for all sklearn transformers! This will make running pipelines on dataframes much easier and provide better ways to track feature names. Previously, mapping a transformed output back into columns would be cumbersome as it might not be a one-to-one mapping in cases of complex preprocessing (e.g., polynomial features ).
27
26
28
-
## Links to Sample notebook and usage:
29
-
-[Pandas output for transformers](https://scikit-learn.org/dev/auto_examples/miscellaneous/plot_set_output.html#sphx-glr-auto-examples-miscellaneous-plot-set-output-py)
The pandas dataframe output feature for transformers solves this by tracking features generated from pipelines automatically. The transformer output format can be configured explictly for either **numpy** or **pandas** output formats as shown in [sklearn.set_config](https://scikit-learn.org/dev/modules/generated/sklearn.set_config.html#sklearn.set_config) and the sample code below.
28
+
```python
29
+
from sklearn import set_config
30
+
set_config(transform_output="pandas")
31
+
```
32
+
33
+
Please see the sample notebook and documentation for a more detailed example and usage.
34
+
35
+
## Links to documentation and example notebook:
36
+
-[Pandas output for transformers documentation](https://scikit-learn.org/dev/auto_examples/miscellaneous/plot_set_output.html#sphx-glr-auto-examples-miscellaneous-plot-set-output-py)
0 commit comments