Package: pypads
PyPadsBuilding on theMLFlowtoolset this project aims to extend the functionality for MLFlow, increase the automation and therefore reduce the workload for the user. The production of structured results is an additional goal of the extension.IntallingThis tool requires those libraries to work:Python (>= 3.6),
cloudpickle (>= 1.3.3),
mlflow (>= 1.6.0),
boltons (>= 19.3.0),
loguru (>=0.4.1)PyPads only support python 3.6 and higher. To install pypads run this in you terminalUsing source codeFirst, you have to installpoetrypip install poetry
poetry build (in the root folder of the repository pypads/)This would create two files under pypads/dist that can be used to install,pip install dist/pypads-X.X.X.tar.gz
OR
pip install dist/pypads-X.X.X-py3-none-any.whlUsing pip (PyPi release)The package can be found on PyPi in followingproject.pip install pypadsTestsThe unit tests can be found under 'test/' and can be executed usingpoetry run pytest test/DocumentationFor more information, look into theofficial documentation of PyPads.Getting StartedUsage examplepypads is easy to use. Just define what is needed to be tracked in the config and call PyPads.A simple example looks like the following,frompypads.app.baseimportPyPads# define the configuration, in this case we want to track the parameters,# outputs and the inputs of each called function included in the hooks (pypads_fit, pypads_predict)hook_mappings={"parameters":{"on":["pypads_fit"]},"output":{"on":["pypads_fit","pypads_predict"]},"input":{"on":["pypads_fit"]}}# A simple initialization of the class will activate the trackingPyPads(hooks=hook_mappings)# An examplefromsklearnimportdatasets,metricsfromsklearn.treeimportDecisionTreeClassifier# load the iris datasetsdataset=datasets.load_iris()# fit a model to the datamodel=DecisionTreeClassifier()model.fit(dataset.data,dataset.target)# pypads will track the parameters, output, and input of the model fit function.# get the predictionspredicted=model.predict(dataset.data)# pypads will track only the output of the model predict function.The used hooks for each event are defined in the mapping file where each hook represents the functions to listen to.
Users can use regex for goruping functions and even provide paths to hook functions.
In thesklearn mappingYAML file, an example entry would be:fragments:default_model:!!python/pPath __init__:hooks:"pypads_init"!!python/rSeg (fit|.fit_predict|fit_transform)$:hooks:"pypads_fit"!!python/rSeg (fit_predict|predict|score)$:hooks:"pypads_predict"!!python/rSeg (fit_transform|transform)$:hooks:"pypads_transform"mappings:!!python/pPath sklearn:!!python/pPath base.BaseEstimator:;default_model:~For instance, "pypads_fit" is an event listener on any fit, fit_predict and fit_transform call made by the tracked model class which is in this caseBaseEstimatorthat most estimators inherits from.Using no custom yaml types and no fragments the mapping file would be equal to following definition:mappings::sklearn::base.BaseEstimator::__init__:hooks:"pypads_init":{re:(fit|.fit_predict|fit_transform)$}:hooks:"pypads_fit":{re:(fit_predict|predict|score)$}:hooks:"pypads_predict":{re:(fit_transform|transform)$}:hooks:"pypads_transform"AcknowledgementThis work has been partially funded by theBavarian Ministry of Economic Affairs, Regional Development and Energyby means of the funding programm"Internetkompetenzzentrum Ostbayern"as well as by theGerman Federal Ministry of Education and Researchin the project"Provenance Analytics"with grant agreement number03PSIPT5C.