Skip to main content

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 (https://rdcu.be/dJMwH)

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmentropy-0.0.5.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pmentropy-0.0.5-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file pmentropy-0.0.5.tar.gz.

File metadata

  • Download URL: pmentropy-0.0.5.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for pmentropy-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5292d302cb30e8b68c3c608fd08b30607244492d92f16f688301613395b22354
MD5 72ded003de2c4620d3869c7b61a81997
BLAKE2b-256 017d9e696ea877216f29966243a18b57b6473ee606493b553e1b89a28d9b0ec3

See more details on using hashes here.

File details

Details for the file pmentropy-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pmentropy-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for pmentropy-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bea9664e44846f3dbb87b1db10e6a05becdceae33d64020cd20081c655b3633d
MD5 3c86494bc07481ec581eb59775fdcbb1
BLAKE2b-256 bfdd8ddceaa40d728f6764b8c336d5351131e9a3548f578bd3560b797f7e77a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page