Skip to main content

A python making machine of sklearn pipeline

Project description

Straw-Machine

A python making machine of sklearn pipeline. This python package tempt to lower the code level in constructing a complicated sklearn pipeline in actual data ETL or ML feature engineering.

Install

pip install straw_machine==0.0.1

Usage

from straw_machine.util import (
    generate_estimator, 
    generate_transformer, 
    generate_pipeline
)

# udf function: add num to all df col 
def add(df, num:int, outcol:str):
    df[outcol] = df + num
    return df

# estimator: 
#   send ['a'] from dataframe to estimator inputs
#   estimator with function add num(1) to all inputs('a') and get outputs columns (['a', 'a+1'], if origin column is need)
estimator1 =generate_estimator(
    name='add1',
    func=add,
    inputs=['a'],
    outputs=['a','a+1'],
    kw_args={
        'num': 1,
        'outcol': 'a+1'
    }
)
estimator2 =generate_estimator(
    name='add2',
    func=add,
    inputs=['a'],
    outputs=['a+2'],
    kw_args={
        'num': 2,
        'outcol': 'a+2'
    }
)

# generate transformer with name specific and estimators list   
t1 = generate_transformer(
    name='trans1',
    estimators=[estimator1, estimator2]
)

pl = generate_pipeline(transformers=[t1])

TODO

  1. low code pipeline building
  • with streamlit / gradio support

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

straw_machine-0.0.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

straw_machine-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file straw_machine-0.0.2.tar.gz.

File metadata

  • Download URL: straw_machine-0.0.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for straw_machine-0.0.2.tar.gz
Algorithm Hash digest
SHA256 12718af5b333ed0fab1ff88c37b5c25e009b1e7a95f966ec6aa7a4bd3662939e
MD5 77f1196256e401638555a94e9a27c337
BLAKE2b-256 2694efb4a138013354b8a484b992497c1e87f92cd1f30937b172c1b1da957531

See more details on using hashes here.

File details

Details for the file straw_machine-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for straw_machine-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fddc70a7584f479562017b8c04646368b1bc40a7a7553dec746096a6d6b6d9e
MD5 79200cb0bfd3166a717eaf83e2965565
BLAKE2b-256 35e51adb52188cdd1c85415e975296427107e32d4d149ef15c5df339ee27c770

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page