Skip to main content

Activity and Sequence Detection Performance Measures: A package to evaluate activity detection results, including the sequence of events given multiple activity types.

Project description

AquDeM

https://img.shields.io/pypi/v/aqudem.svg Documentation Status

Activity and Sequence Detection Evaluation Metrics: A Comprehensive Tool for Event Log Comparison.

Installation

pip install aqudem

Usage

import aqudem

aqu_context = aqudem.Context("ground_truth_log.xes", "detected_log.xes")

aqu_context.activity_names # get all activity names present in log
aqu_context.case_ids # get all case IDs present in log

aqu_context.cross_correlation() # aggregate over all cases and activites
aqu_context.event_analysis(activity_name="Pack", case_id="1") # filter on case and activity
ts = aqu_context.two_set(activity_name="Pack") # filter on activity, aggregate over cases
ts_f1_score = ts.f1 # get the F1 score of the Two Set metric

For a more detailed description of the available methods, please refer to the rest of the documentation.

Preface

  • Metrics to evaluate activity detection results

  • Input: two XES files, one with the ground truth and one with the detection results

  • Output: a set of metrics to evaluate the detection results

  • Prerequisites for the input files: the XES files must…

    • … have a sampling_freq in Hz associated with each case (only detected file), and each case must have the same sampling frequency

    • … have a concept:name attribute for each case (case ID), with a matching case ID in both files (ground truth and detected)

    • … have a time:timestamp attribute for each event

    • … have an concept:name attribute for each event (activity name)

    • … have a lifecycle:transition attribute for each event

    • … each start event must have a corresponding complete event; and only these two types of events are relevant for the analysis currently; activity executions with a duration of exactly zero are removed

An ACTIVITY_METRIC is a metric that is calculated for each activity type in each case separately. Available ACTIVITY_METRICs are:

A SEQUENCE_METRIC is a metric that is calculated for each case separately. Available SEQUENCE_METRICs are:

  • Damerau-Levenshtein Distance

  • Levenshtein Distance

All metrics are also available in appropriately normalized versions. For requests that span multiple cases, the results are aggregated. The default and only aggregation method is currently the mean. For more detailed definitions of the metrics, please refer to the documentation.

History

0.3.0 (2025-06-29)

Make it more clear that EA and TS derived metrics/rates are micro-averaged:

In order to clarify the nature of the rates and metrics such as F1 of the event analysis and two set metrics we decided to give sums of event and frame classification totals. Derived metrics are then more clearly understood to be micro-averaged. The average over all case-activity case-pairs was prone to misinterpretation. Furthermore we improved the documentation of the code to reflect this aspect.

More details on micro-averaging: https://doi.org/10.1016/j.ipm.2009.03.002

0.2.1 (2025-05-01)

Resolved some dependency issues (by updating all requirements to newest version).

0.2.0 (2024-10-11)

Added additional properties for the EventAnalysis and TwoSet classes, for a better overview of the performance of methods. The main additions are:

  • The TwoSet class now offers the properties precision, recall, f1, and balanced_accuracy.

  • The EventAnalysis class now offers the properties precision, recall, and f1 (balanced_accuracy does not make sense here, since there is no notion of true negative events).

0.1.1 (2024-08-14)

  • Added additional validations and checks for the input logs, with helpful tips in errors in case of non-compliance.

  • Minor bug fixes.

0.1.0 (2024-06-19)

  • First release on PyPI.

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

aqudem-0.3.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

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

aqudem-0.3.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file aqudem-0.3.0.tar.gz.

File metadata

  • Download URL: aqudem-0.3.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for aqudem-0.3.0.tar.gz
Algorithm Hash digest
SHA256 417dc4731c4c4bbc5c8ef54c79cda214f0a7a3bbbaf10480c92288dff383ad67
MD5 974b53f5a41007b75f28014a4bd7cdc2
BLAKE2b-256 b431f073348e2f29f3c900e00ec340e289c31e999ef96e197c2c15cb6f32c7af

See more details on using hashes here.

File details

Details for the file aqudem-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: aqudem-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for aqudem-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f50d3eb9109ef7f86451389082fdd3fd4580eff58e73f72e6c42d8404068afe3
MD5 e662821ba702a967a492a50ccf6bc60a
BLAKE2b-256 832f32ba901ea58b1686035d34071dc610ada766185620f41f5e47c47bd44a42

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