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.4.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.4-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pmentropy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 31639f82af7b11fe04988ee3c80bb99f46482e79c4280cb0b786cb4584ee498a
MD5 f3ccdc58058c376f3bc6629dbdb1cf6c
BLAKE2b-256 1d7c947f696a8b57a05964bfbc443f1257967fdf12b91e81b103888d92f00647

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pmentropy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4b6f22109a1c8e24f2ec52bb95cccacf4bb3e1d839c742e4afd278a7dec810f0
MD5 c96ca90ea144b0d3a9503666f4c781d8
BLAKE2b-256 89f4388d948b40718d7ea748bcd5ef888aa59a721073ef841e1bce87c1fdfb95

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