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
- 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.1.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file straw_machine-0.0.1.tar.gz
.
File metadata
- Download URL: straw_machine-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57efed186df2a1f0cf43e79946a1814d4b53643a6dca762c0fecadf162a45e22 |
|
MD5 | f4b6a6f12a666233001f477a3d1a2bdf |
|
BLAKE2b-256 | 2205e6c842d8aa8e813ad70c35e6b1ae990d97bc6f3376b5858709f2513bee24 |
File details
Details for the file straw_machine-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: straw_machine-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce26f48fe05f827ed1a44dd1bec4817459fd251847ba3a78f136e5565359ffb2 |
|
MD5 | 866eb1c36de5b7d42dcfea513b9255e3 |
|
BLAKE2b-256 | 9edce6f2104d82c13525b165dbb64862a88ae1b090d6cb111c8ab2350129ce83 |