Skip to main content

SkPM

Process mining, the scikit-learn way.

Read the Docs Codecov License: MIT

SkPM is a Python module for process mining built on top of scikit-learn and pandas, and distributed under the MIT license.

Event logs are not tables of independent rows: cases unfold over time, every event is a moment where a prediction could be made, and almost every convenient shortcut leaks the future into the past. SkPM turns an event log into a supervised learning problem without leaking it — time-aware splits, prediction targets, feature extraction and prefix encoding, all as ordinary scikit-learn transformers, so they compose with the Pipeline, ColumnTransformer and GridSearchCV you already use.

Website: https://skpm.readthedocs.io

Installation

User installation

A PyPI release is on the way. Until then, install the latest version from the repository with uv or pip:

uv venv .venv --python 3.12 && source .venv/bin/activate
uv pip install git+https://github.com/raseidi/skpm.git

Getting started

How much longer does each running case need? On a public benchmark log:

from sklearn.ensemble import HistGradientBoostingRegressor
from sklearn.metrics import mean_absolute_error
from sklearn.pipeline import Pipeline

from skpm.event_logs import BPI20RequestForPayment
from skpm.feature_extraction import TimestampExtractor
from skpm.feature_extraction.targets import remaining_time
from skpm.model_selection import train_test_split
from skpm.sequence_encoding import Aggregation

# Payment requests from a Dutch university; downloads and caches on first use.
log = BPI20RequestForPayment()

# Split first, before extracting features: whole cases, separated in time.
train, test = train_test_split(log, strategy="unbiased")

# Hours until each case finishes. Which target to predict is your choice.
y_train = remaining_time(train, time_unit="h")
y_test = remaining_time(test, time_unit="h")

# Fitted on the training cases only, which is what keeps the estimate honest.
pipeline = Pipeline([
    ("features", TimestampExtractor(time_unit="h")),
    ("prefix", Aggregation(method="mean")),
    ("model", HistGradientBoostingRegressor()),
]).fit(train, y_train)

print(mean_absolute_error(y_test, pipeline.predict(test)))

Your own log works the same way, with no loader class and no conversion step to remember: train_test_split(pd.read_csv("my_log.csv")).

Documentation

  • Quickstart — the whole workflow on one page, on synthetic data.
  • User Guide — the event log, splitting, targets, features, prefix encoding, composition.
  • Examples — next-activity prediction, the prefix encodings side by side, and a real BPI Challenge log end to end.
  • API reference — every public class and function.

Contributing

Contributions are welcome — see CONTRIBUTING.md for how to open an issue or a pull request. SkPM follows scikit-learn's fit / transform / predict conventions, so its contributing guide applies here too.

Citation

SkPM was presented at the CoopIS 2023 demonstration track.

@inproceedings{OyamadaTJC23,
  author    = {Rafael Seidi Oyamada and
               Gabriel Marques Tavares and
               Sylvio Barbon Junior and
               Paolo Ceravolo},
  title     = {A Scikit-learn Extension Dedicated to Process Mining Purposes},
  booktitle = {Proceedings of the Demonstration Track co-located with the
               International Conference on Cooperative Information Systems 2023},
  series    = {{CEUR} Workshop Proceedings},
  publisher = {CEUR-WS.org},
  year      = {2023},
}

Metadata

Release files for skpm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skpm 0.1.0
File Size Uploaded
skpm-0.1.0.tar.gz 65.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skpm 0.1.0
File Interpreter ABI Platform
skpm-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 119.2 kB

Release files / skpm-0.1.0.tar.gz

Download URL skpm-0.1.0.tar.gz
Size 65.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a1b62cb0154deb10ee536bdec07da3bc97aeb8ec7d0e288ba517eeae66ebd772
BLAKE2b-256 checksum
How to use checksums
3741389525ff47cdf82ebe952934ffd0edab9b9acd05336de8f1511544f67340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / skpm-0.1.0-py3-none-any.whl

Download URL skpm-0.1.0-py3-none-any.whl
Size 53.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b86baa23e2313d281488c67c40621e558e04c265a3609fecc0360d28ab88453e
BLAKE2b-256 checksum
How to use checksums
7740140b672cbe68807379c63b0511e0fe00c1b81c63f78b0b2267eb1bddf07f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page