Giter Club home page Giter Club logo

feature-engineering-polars's Introduction

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

feature-engineering-polars's People

Contributors

jordandelbar avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar 伍侃 avatar Jiahao Wu avatar Hyunsung Lee avatar

Watchers

James Cloos avatar 伍侃 avatar  avatar

feature-engineering-polars's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.