The main use of this package is to use Sklearn Pipeline with transformer / estimator that doesn't comply with the basic Pipeline:
1 - Use sklearn Pipeline with transformation on Y:
from sklearn_pandas_transformers.transformers import SplitXY, EstimatorWithoutYWrapper, SklearnPandasWrapper
from sklearn.ensemble import RandomForestRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.impute import KNNImputer
from sklearn.pipeline import Pipeline
import pandas as pd
import numpy as np
input_df = pd.DataFrame([[0, 1, 2, 3], [4, 5, 6, 7], [8, np.nan, 9, 10]])
input_df.columns = ["a", "b", "c", "d"]
spliter = SplitXY("a")
pipe = Pipeline([
("imputer", SklearnPandasWrapper(KNNImputer())),
("spliter", spliter), ("scaler", StandardScaler()),
("rf",
EstimatorWithoutYWrapper(RandomForestRegressor(random_state=45),
spliter))
])
pipe.fit(input_df)
res = pipe.predict(input_df)
2 - Use sklearn Transformer (returning numpy array) to return pandas DataFrame (with unchanged columns names):
SklearnPandasWrapper(StandardScaler()))
Metadata
Release files for sklearn-pandas-transformers 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sklearn-pandas-transformers-0.0.12.tar.gz | 2.5 kB | Without provenance | Details for sklearn-pandas-transformers-0.0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sklearn_pandas_transformers-0.0.12-py3-none-any.whl | Python 3 | none | any | Details for sklearn_pandas_transformers-0.0.12-py3-none-any.whl |
Total release size: 4.5 kB
Release files / sklearn-pandas-transformers-0.0.12.tar.gz
| Download URL | sklearn-pandas-transformers-0.0.12.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cc4e596273988a8d6e9e349e09722a64551cc0faf9fc4d6eb03d02f0a444c32
|
|
BLAKE2b-256 checksum How to use checksums |
a0e6938c0a6688b183bf2f17cf3b69ca3f703d7b5c34d6b5843dd930b5f96b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
|
Release files / sklearn_pandas_transformers-0.0.12-py3-none-any.whl
| Download URL | sklearn_pandas_transformers-0.0.12-py3-none-any.whl |
|---|---|
| Size | 1.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2283a26bcc3bf1b50bc116f4199916bb5831c57d6f2bbf0e56028e07dc8c74c4
|
|
BLAKE2b-256 checksum How to use checksums |
b818e4f3d160da36f6e9e78a31b68939ed034970b17818b228a9158be754c059
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
|
Security for sklearn-pandas-transformers 0.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.