Skip to main content

A versatile Python package featuring scikit-learn like transformers for feature preprocessing, compatible with all kind of dataframes thanks to narwhals.

Project description

pytest PyPI documentation

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

To install the package, use pip:

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.223144
1 -0.223144
2 -0.223144
3  1.029619
4  1.029619
5  1.029619
6  1.029619
7  1.029619
8  1.029619

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

sklearo-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sklearo-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file sklearo-0.1.0.tar.gz.

File metadata

  • Download URL: sklearo-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.1

File hashes

Hashes for sklearo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 86dce675d53708fbc1ea73ddada86b0ecd920837df92aefc8f87aa21c083f226
MD5 05bf5f9dc2a9edaf43d01fdfa640a8e3
BLAKE2b-256 58994213b178c8df45733107d3a9c4b447a17a7477caaedb5838cec17f7d2af1

See more details on using hashes here.

File details

Details for the file sklearo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sklearo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.1

File hashes

Hashes for sklearo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77de54138f179896e93494c89a8dd2ec5b1f3bc275b94f74912dec4909daf783
MD5 582034062a3a20c8ba3b5ff79ea67450
BLAKE2b-256 790a1aecebba93acbd9428d314a9e2ece60f2ef95c3c113a25378bca273a00c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page