Skip to content

smartjourneymining/mdp_ce

Repository files navigation

Counterfactual Strategies for Markov Decision Processes

This repository contains all files to reproduce the results reported in the paper `Counterfactual Strategies for Markov Decision Processes' submitted to IJCAI 2025.

Artifact Structure

├── requirements.txt # Requirements to re-run file
├── README.md
├── plots.ipynb # File to re-generate presented plots
├── benchmarks.py
├── journepy # Library for processing datasets.
├── data
│   ├── Store datasets here
├── out
│   ├── diversity
│   │   ├── Plots for Diversity
│   ├── models
│   │   ├── Stored model files
│   ├── user_strategies
│   |   ├── Stored Strategy files
│   └── result files
├── Result.py
├── LogParser.py
├── gurobi_example.py
└── solver.py

Generating Counterfactual Strategies

Counterfactual strategies are generated by running the benchmarks.py script. It offers several commandline arguments for specifying details of the execution:

  -t, --timeout: Timeout for Gurobi
  
  -s, --steps: Number of steps for each model
  
  -i, --iterations: Iterations for each step
  
  -c, --cores: Cores to use to parallelize experiments
  
  -e, --experiments: Name of experiments to run
  
  -rm, --rebuild_models: Rebuild models, implies rebuilding strategies
  
  -rs, --rebuild_strategies: Rebuild strategies
  
  -mi, --model_iterations: Number of models to generate for each setting
  
  -as, --all_spotify: All spotify models in steps of 10% are generated
  
  -d, --diversity_runs: Number of diverse counterfactuals
  
  -b, --bounds: Bounds for gamma, evenly split by steps

Experiments can be from: 'greps', 'bpic12', 'bpic17-before', 'bpic17-after', 'bpic17-both', 'spotify', 'spotify1000', 'spotify2000', ... , 'spotify10000'.

Dataset

The used datasets are not contained in the artifact due to their licensing. However, all generated models and strategies are contained under out/models and out/user_strategies. If you wish to generate models yourself, please download the respective datasets first to data/:

Reproducing Results

The artifact is written in Python and uses Gurobi. Before running any code, please make sure that all requirements from requirements.txt are installed and that a valid Gurobi license is available.

To reproduce the results reported for GrepS, BPIC'12 and BPIC'17, run:

python3 benchmarks.py --experiments greps bpic12  bpic17-both  --steps 10 --iterations 10 --model_iterations 1 --timeout 1800 --diversity_runs 2 

To reproduce the detailed results reported for MSSD10 - MSSD30, run:

python3 benchmarks.py --experiments spotify1000 spotify2000 spotify3000 --steps 12 --iterations 10 --timeout 1800 --model_iterations 10 --diversity_runs 0  --bounds 0.1 0.5

To reproduce the general results for MSSD, run:

python3 benchmarks.py --experiments spotify --steps 10 --iterations 10 --model_iterations 10 --timeout 1800 --diversity_runs 0 --all_spotify

Plots

All presented plots can be reproduced by running the plots.ipynb notebook, the results file are contained in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published