PMEventropy
Compute in python entropy for process mining describe in Back, C.O., Debois, S. & Slaats, T. Entropy as a Measure of Log Variability. J Data Semant 8, 129–156 (2019). https://doi.org/10.1007/s13740-019-00105-3 (the article)
This project is inspired by https://github.com/backco/eventropy
Installation
pip install pmentropy
Get started
First import the XES file
import pmentropy
logs = pmentropy.read_file("path", flatten=False)
Then compute an entropy
entropy1 = pmentropy.kNN_entropy(logs, k=3, p=2)
entropy2 = pmentropy.global_block_entropy(logs k=3, p=2)
Import with pm4py
with a DataFrame
import pmentropy
from pm4py.read import read_xes
df = read_xes("path")
logs = pmentropy.read_DataFrame(df, flatten=False)
entropy1 = pmentropy.kNN_entropy(logs, k=3, p=2)
trace by trace if you already read by stream
import pmentropy
from pm4py.streaming.importer.xes import importer as xes_importer
stream = xes_importer.apply("path", variant=xes_importer.xes_trace_stream)
next_trace, logs = pmentropy.read_trace_by_trace(flatten=False)
for trace in stream:
next_trace(trace)
entropy1 = pmentropy.kNN_entropy(logs, k=3, p=2)
Documentation
Parse file
- read_file(file_path: str, flatten=False)
- read_trace_by_trace(flatten=False)
Entropy
- trace_entropy(logs)
- prefix_entropy(logs)
- unique_trace(logs)
- k_block_entropy(logs, k: int)
- global_block_entropy(logs)
- kL_entropy(logs, p: int)
- kNN_entropy(logs, k: int, p: int)
- lempel_ziv_entropy_rate(logs)
- k_block_entropy_rate_ratio(logs, c)
- k_block_entropy_rate_diff(logs, c)
- unique_trace(logs)
Metadata
Release files for pmentropy 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pmentropy-0.0.5.tar.gz | 20.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pmentropy-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.4 kB
Release files / pmentropy-0.0.5.tar.gz
| Download URL | pmentropy-0.0.5.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5292d302cb30e8b68c3c608fd08b30607244492d92f16f688301613395b22354
|
|
BLAKE2b-256 checksum How to use checksums |
017d9e696ea877216f29966243a18b57b6473ee606493b553e1b89a28d9b0ec3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|
Release files / pmentropy-0.0.5-py3-none-any.whl
| Download URL | pmentropy-0.0.5-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bea9664e44846f3dbb87b1db10e6a05becdceae33d64020cd20081c655b3633d
|
|
BLAKE2b-256 checksum How to use checksums |
bfdd8ddceaa40d728f6764b8c336d5351131e9a3548f578bd3560b797f7e77a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.9.19
|