This project is designed to analyze and discover process models from event logs using various process mining techniques. The implementation leverages the PM4Py library to perform process discovery, evaluation, and conformance checking. The models are extracted using Alpha Miner, Heuristics Miner, and Inductive Miner, then visualized and assessed for performance.
- Load and preprocess event logs from XES files.
- Extract process structures including traces, events, and activities.
- Apply process discovery algorithms (Alpha, Heuristics, and Inductive Miner).
- Visualize generated process models using Petri nets.
- Evaluate models based on process conformance and fitness.
- Check conformance through token-based replay analysis.
Ensure you have Python installed (recommended version 3.8+). The required dependencies are listed below:
pip install pm4pyEnsure you have an event log file in .xes format. Place it in the Datasets/ directory.
Execute the script using:
python Scripts/process_mining.py- The script will print statistics about the event log, including traces and activities.
- Generated Petri net models will be saved in
PetriNets/. - Model evaluations will be printed in the console.
- Conformance checking results will be displayed.
ProcessMiningProject/
├── Datasets/
│ ├── ProcessLog_Original_20231027.xes
│ ├── ProcessLog_ClaudeAugmented_20231027.xes
│ └── ProcessLog_GeminiAugmented_20231027.xes
├── PetriNets/
│ ├── PetriNets_Original/
│ │ └── ... (immagini)
│ ├── PetriNets_ClaudeAugmented/
│ │ └── ... (immagini)
│ └── PetriNets_GeminiAugmented/
│ └── ... (immagini)
├── Scripts/
│ └── process_mining.py
└── README.md
log, log_df = load_event_log(file_path)- Converts XES logs into a structured format.
models = apply_discovery_algorithms(log, filtered_log)- Extracts process models using different mining techniques.
visualize_models(models)- Saves Petri nets in
PetriNets/for each discovered model.
check_conformance(filtered_log, *models["inductive_filtered"])- Evaluates how well the process model aligns with actual event logs.
Feel free to contribute by improving the code, adding more evaluation techniques, or refining the visualization methods.
This project is open-source and available under the MIT License.