Feature engineering done with Polars
Project description
Feature Engineering with Polars
Feature engineering done with Polars
How to install
pip install feature-engineering-polars
How to use it
import polars as pl
from fe_polars.imputing.base_imputing import Imputer
from fe_polars.encoding.target_encoding import TargetEncoder
dataframe = pl.DataFrame(
{
"City": ["A", "A", "B", "B", "B", "C", "C", "C"],
"Rain": [103, None, 90, 75, None, 200, 155, 127],
"Temperature": [30.5, 32, 25, 38, 40, 29.6, 21.3, 24.9],
}
)
imputer = Imputer(features_to_impute=["Rain"], strategy="mean")
encoder = TargetEncoder(smoothing=2, features_to_encode=["City"])
temp = imputer.fit_transform(x=dataframe)
encoder.fit_transform(x=temp, y=dataframe['Temperature'])
shape: (8, 3)
City Temperature Rain
f64 f64 f64
30.706 30.5 103.0
30.706 32.0 125.0
32.665 25.0 90.0
32.665 38.0 75.0
32.665 40.0 125.0
27.225 29.6 200.0
27.225 21.3 155.0
27.225 24.9 127.0
Available transformers
- Encoding:
- Target encoding
- One hot encoding
- Imputing:
- Base imputing:
- Mean imputing
- Median imputing
- Mode imputing
- Max imputing
- Min imputing
- Base imputing:
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for feature_engineering_polars-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b1eff9fc630246a4ed7fbfef62fbd19bcbf6c34ece2c9e93127662260cba4e5 |
|
MD5 | f40b60f26de10bc60f8577c8bd27a6f5 |
|
BLAKE2b-256 | d9fea84efa3a5867b743318bf4d1b554b7ca490a12b19a3d59ee7aacf7bce910 |
Close
Hashes for feature_engineering_polars-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 949156c0b09c5fe8534c495efaeeac80a1c233bf264df873c8edf1cc0ccaacef |
|
MD5 | 1e91230b4bf7a4de9b358ef20ab02ce5 |
|
BLAKE2b-256 | ed84b66778834589e1697199d701bd0748fcb259f8cceb163d4e3248495f18f3 |