Prolothar Process Discovery
Algorithms to discover process behavior from data mining on sequential data such as process logs.
Based on the publication
Boris Wiegand, Dietrich Klakow, and Jilles Vreeken. Mining easily understandable models from complex event logs. In: Proceedings of the SIAM International Conference on Data Mining (SDM), Virtual Event. 2021, pp. 244-252.
Prerequisites
Python 3.11+
Usage
If you want to run the algorithms on your own data, follow the steps below.
Installing
pip install prolothar-process-discovery
Creating or reading an EventLog
Option 1: you can create an EventLog from a pandas dataframe
# 1) there must be a header line
# 2) each line belongs to one event
# 3) there is one column containing the case ID
# 4) there is one column containing the activity name of the event
# 5) there can be columns for trace and event attributes
import pandas as pd
eventlog = EventLog.create_from_pandas_df(
pd.read_csv('path/to/eventlog.csv', delimiter=','),
'CaseId', 'Activity',
trace_attribute_columns=['Customer'],
event_attribute_columns=['Duration']
)
Option 2: you can create an EventLog from .xes with the help of the pm4py package
from pm4py.objects.log.importer.xes import importer as xes_import_factory
import prolothar_common.pm4py_utils as pm4py_utils
xes = xes_import_factory.apply('path/to/eventlog.xes.gz')
eventlog = pm4py_utils.convert_pm4py_log(xes)
Option 3: you can create an EventLog manually
from prolothar_common.models.eventlog import EventLog, Trace, Event
eventlog = EventLog()
#case ID (0 in the example) can be any hashable type, e.g. int or string. must be unique.
eventlog.add_trace(Trace(0, [
Event('start computer', attributes={'user': 'alice'}),
Event('drink coffee', attributes={'milk': 'yes', 'grams_of_sugar': 5}),
]))
Discovering a PatternGraph
from prolothar_process_discovery.discovery import Proseqo
from prolothar_process_discovery.discovery import ProSimple
from prolothar_process_discovery.discovery.proseqo.pattern_dfg import PatternDfg
directly_follows_graph = PatternDfg.create_from_event_log(eventlog)
pattern_graph = Proseqo().mine_dfg(eventlog, directly_follows_graph, verbose=True)
pattern_graph.plot()
pattern_graph = ProSimple().mine_dfg(eventlog, directly_follows_graph, verbose=True)
# we can also plot to a file
pattern_graph.plot(filepath='path/to/your/file', filetype: str='pdf', view=False)
If you get an error stating that parameter "last_covered_activity" is unexpectedly of type "None", add a common start and a common end activity to all traces:
log.add_start_activity_to_every_trace('START')
log.add_end_activity_to_every_trace('END')
Development
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Additional Prerequisites
- make (optional)
Running the tests
make test
Deployment
- Change the version in version.txt
- Build and publish the package on pypi by
make clean_package
make package && make publish
- Create and push a tag for this version by
git tag -a [version] -m "describe this version"
git push --tags
Versioning
We use SemVer for versioning.
Authors
If you have any questions, feel free to ask one of our authors:
- Boris Wiegand - boris.wiegand@stahl-holding-saar.de
Metadata
Release files for prolothar-process-discovery 7.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prolothar_process_discovery-7.0.2.tar.gz | 8.3 MB | Without provenance | Details for prolothar_process_discovery-7.0.2.tar.gz |
Release files / prolothar_process_discovery-7.0.2.tar.gz
| Download URL | prolothar_process_discovery-7.0.2.tar.gz |
|---|---|
| Size | 8.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fff3aa8cdd313587ea52854a7a807d5429378d69ee04fd7ab7933dfc9664a425
|
|
BLAKE2b-256 checksum How to use checksums |
403707e6a3cfa26fb6ee26f38a1ac19bceccc84f22228ad59aea9878a816df5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Security for prolothar-process-discovery 7.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.