Skip to main content

Feature Engineering with Polars

PyPI - Python Version GitHub codecov

Feature engineering done with Polars

fe-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
      • Max imputing
      • Min imputing
      • Fixed value imputing

Metadata

Release files for feature-engineering-polars 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for feature-engineering-polars 0.5.0
File Size Uploaded
feature_engineering_polars-0.5.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for feature-engineering-polars 0.5.0
File Interpreter ABI Platform
feature_engineering_polars-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / feature_engineering_polars-0.5.0.tar.gz

Download URL feature_engineering_polars-0.5.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ee33a4d8e7337c1fb8883ab640ed179d86f19280970fb41d2096670a78139194
BLAKE2b-256 checksum
How to use checksums
d9ef2e2a7ec40780d502a65f7ac3c12a9a6808c779ea3e4c9c2fb8ccb557d848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.10.15 Linux/6.8.0-1014-azure

Release files / feature_engineering_polars-0.5.0-py3-none-any.whl

Download URL feature_engineering_polars-0.5.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a1ad9d3d765dc1f7ae10f0e7c9bbf623db0a74b0b6d7c3fbf4761504c45be3d
BLAKE2b-256 checksum
How to use checksums
c5cedbdf493622f11131edf5afc84d2936b6f45aa37d521afeb412bd875213e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.1 CPython/3.10.15 Linux/6.8.0-1014-azure

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page