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.4.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.4-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sklearo-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 bd9c01a306fdf016470e92704c8a7e1ac9b8785a65ad89b7c8870c31e2bdb2cf
MD5 1d6c8ad1d55a9bd4e8c95b3c7143ead6
BLAKE2b-256 04ae6e351e220a93f0210290298d92505d6717c10aab4ab205776e0a64bb7213

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sklearo-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dec1954ab094553fbbbf8528147ef5219ba5cf7f30c71018726cabb6142f9fad
MD5 5c7cf1cf0ef018722a9eaa9936a8f226
BLAKE2b-256 453e14bb7c5672f7fb3a270a2ebfeeae23802bb827600334c7d0445595a99f14

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