A versatile Python package featuring scikit-learn like transformers for feature preprocessing, compatible with all kind of dataframes thanks to narwhals.
Project description
sklearo
/sklɛro/
A versatile Python package featuring scikit-learn like transformers for feature preprocessing, compatible with all kind of DataFrames thanks to narwhals.
Installation
Install from PyPI:
pip install sklearo
Usage
Here's a basic example of how to use the package with the WOEEncoder:
import pandas as pd
from sklearo.encoding import WOEEncoder
data = {
"category": ["A", "A", "A", "B", "B", "B", "C", "C", "C"],
"target": [1, 0, 0, 1, 1, 0, 1, 1, 0],
}
df = pd.DataFrame(data)
encoder = WOEEncoder()
encoder.fit(df[["category"]], df["target"])
encoded = encoder.transform(df[["category"]])
print(encoded)
category
0 -0.916291
1 -0.916291
2 -0.916291
3 0.470004
4 0.470004
5 0.470004
6 0.470004
7 0.470004
8 0.470004
Features
- ∫ Easy Integration: built on top of narwhals, meaning it can work with any kind of dataframe supported by narwhals like pandas, polars and much more!
- 🌸 Scikit-learn Compatibility: Designed to work with scikit-learn pipelines.
- ✅ tested against pandas and Polars dataframes.
Contributing
We welcome contributions! Please check the development guides for more details.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or suggestions, please open an issue on GitHub.
Why sklearo?
The name sklearo is a combination of sklearn and omni (o), which means all. This package is designed to work with all kinds of dataframes, hence the name sklearo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sklearo-0.2.5.tar.gz.
File metadata
- Download URL: sklearo-0.2.5.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64b115e6b4e73737c332d504706b9965ba5930e03f5077a61b1d248c98044e26
|
|
| MD5 |
54486c7919b8ee98c6adf6225661b071
|
|
| BLAKE2b-256 |
669ecf2e4b77d3a85809c7fd461f63bb522b5f88038722323026eedc91944548
|
File details
Details for the file sklearo-0.2.5-py3-none-any.whl.
File metadata
- Download URL: sklearo-0.2.5-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c6584afd92855018e65b5cdc29985e9138c1820f8c43bed86c736da026ca98e
|
|
| MD5 |
e078ff95219b5ecdd028cb27fe7f49f7
|
|
| BLAKE2b-256 |
6c1ef8d2212836b49f4c66619533878570dcb92255d7d7ee7825f720c3d5e714
|