Declare4Py is the first Python package for declarative Process Mining with core functionalities to easily implement Machine Learning applications for Process Mining. Declarative process mining uses declarative behavioural rules (based on Linear Temporal Logic on finite traces) for defining process models. This results in a high flexibility of the business process model definition without neglecting hard constraints that must be satisfied. Moreover, declarative languages can be used as a bridge between Process Mining and Machine learning with the DECLARE encoding that encodes the traces in a log into a numeric format suitable as input to Machine Learning algorithms. Declare4Py implements such a bridge by including standard algorithms for:
All the Declare4Py data formats are compatible with the main Machine Learning Python packages: scikit-learn, Tensorflow and PyTorch.
We recommend the use of a virtual environment to avoid possible clashes between your local Python version and the required
libraries. A virtual environment can be created with Conda
or with the venv Python utility. Once a virtual environment has been created,
download the Declare4Py project on your local machine, activate the created virtual environment and use pip
or conda
to install the required dependencies in the requirements.txt
file. As an alternative you can install Declare4py from PyPi.
In addition, the Lydia backend for the LTLf conformance checking need to be installed with Docker:
docker pull whitemech/lydia:latest
;lydia
. On Linux and MacOS machines, the following commands should work:
echo '#!/usr/bin/env sh' > lydia
echo 'docker run -v$(pwd):/home/default whitemech/lydia lydia "$@"' >> lydia
sudo chmod u+x lydia
sudo mv lydia /usr/local/bin/
The docs/source/tutorials/
folder contains a walk-through of Declare4Py. In order, the tutorials cover the following topics:
The tutorials are Jupyter notebooks and consider the Sepsis cases log.
Declare4Py/ProcessModels
-- the implementation of the supported process models.Declare4Py/ProcessMiningTasks/
-- the implementation of the supported Process Mining tasks.tests/
-- a collection of tests for computing the Declare4Py performance.docs/source/tutorials/
-- tutorials to start with Declare4Py,If you use Declare4Py in your research, please use the following BibTeX entry.
@inproceedings{DonadelloRMS22,
author = {Ivan Donadello and
Francesco Riva and
Fabrizio Maria Maggi and
Aladdin Shikhizada},
title = {Declare4Py: {A} Python Library for Declarative Process Mining},
booktitle = {{BPM} (PhD/Demos)},
series = {{CEUR} Workshop Proceedings},
volume = {3216},
pages = {117--121},
publisher = {CEUR-WS.org},
year = {2022}
}