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.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

sklearo-0.2.3.tar.gz (13.7 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.2.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sklearo-0.2.3.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for sklearo-0.2.3.tar.gz
Algorithm Hash digest
SHA256 4ce5575c9644b4abf0764d1bfcff1819ae5ca16d5e338281986cfba25c3677e9
MD5 bd356e84fa043c110238328fa04bc2ac
BLAKE2b-256 69cac776501ba406bd2e5ee1d077f92ec231c1890e0dce2de216f06fcd33a00c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sklearo-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for sklearo-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f847acb305da2b9acf255872db13f0434857c845e7069f0dd6c8f1155725ed
MD5 c3a9673945348f2c92bbc7d8160a8f82
BLAKE2b-256 8470fb7750cbd15841b3ecc55c07f99f87ce05f9858a94415d3fdcd4e960adc6

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