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.2
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
- low code pipeline building
- with streamlit / gradio support
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
straw_machine-0.0.3.tar.gz
(5.8 kB
view details)
Built Distribution
File details
Details for the file straw_machine-0.0.3.tar.gz
.
File metadata
- Download URL: straw_machine-0.0.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec42e49a725e1b1c2ca6733a4f4899f47d9dc292257408c1f32b58361f0a9c34 |
|
MD5 | cf92087d8ef6c54577cc84135cf9d879 |
|
BLAKE2b-256 | 895d6bac9a99173c5baaf21c4937740f7198427a412d74703f2aa54e70de15da |
File details
Details for the file straw_machine-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: straw_machine-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e54778f094cf3d613092df3b85657e893610956ba165f6a992fa62eabe4ff0 |
|
MD5 | 76dd2e493f55a902cccf8bde897e4fb6 |
|
BLAKE2b-256 | a15f3b18ac8f21b920386a183f2053a8708b0b9991e8182d40388bbbac4ac2a3 |