--- title: Next-Activity Prediction type: concept tags: [ppm, prediction, classification] sources: [] created: 2026-04-13 updated: 2026-04-13 --- # Next-Activity Prediction A [[concepts/predictive-process-monitoring|PPM]] task: given a prefix of an event trace, predict the **next activity** the case will execute. ## Formulation - **Input:** prefix `⟨e₁, e₂, …, eₖ⟩` of a running case. - **Output:** activity label `eₖ₊₁` ∈ `A` (multi-class classification over activity vocabulary). - **Training data:** every prefix-continuation pair extracted from completed cases. ## Canonical approaches - **Probabilistic / Markov** — transition-matrix models over activity sequences. - **Classical ML** — features extracted via [[concepts/trace-encoding]]; classifier (random forest, decision tree, logistic regression). - **RNN / [[concepts/lstm-ppm|LSTM]]** — sequence models with activity embeddings; dominant approach 2016–2020. - **[[concepts/transformer-ppm|Transformer / attention]]** — rising since 2020–2021. - **Graph Neural Nets (GNN)** — treat the log as a graph; 2023 onward. ## Evaluation - **Accuracy / top-k accuracy** — did the predicted activity match the true next? - **F1 (weighted / macro)** — handles class imbalance across activities. - **Brier score** — if probabilistic outputs are needed. ## Full-suffix variant Extend the prediction recursively to produce the whole remaining activity sequence. Accumulates error quickly; often evaluated with **Damerau-Levenshtein** distance between predicted and actual suffix. ## Related [[concepts/predictive-process-monitoring]] · [[concepts/remaining-time-prediction]] · [[concepts/trace-encoding]]