knockouts-redesign
About
This is the implementation of a data-driven approach for discovering improvement opportunities related to the execution of knock-out checks within business processes.
The tool comes with a browser-based UI (powered by Streamlit), but it can also be invoked via CLI or imported as a module in Python scripts.
Resources
Index
- Set-up
- Usage
- Running tests
- Notes
Set-up
Option A: Using a setup
script
Expand
- Clone the repo
- [Create a virtual environment with venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)
- In the directory that contains the newly created `venv` folder, run:
```
source venv/Scripts/activate
pip install -r requirements.txt
```
- Depending on your platform, install graphviz (v 3.0.0+) separately, and make sure it's in your `PATH`
(see also: [graphviz downloads page](https://graphviz.org/download/#windows)):
```bash
# Windows:
choco install graphviz
# Linux:
sudo apt install graphviz
# Mac:
brew install graphviz
```
Usage
Create a config file following the schema defined in config_schema.json (the directory also contains examples).
Then you can choose whether to:
-
Launch the tool as a web app (powered by Streamlit):
# Windows:
start.bat
# Linux:
bash start.sh
-
Launch from CLI:
# Windows:
python main.py config/synthetic_example.json
# Linux:
python3 main.py config/synthetic_example.json
-
Or programmatically:
from knockout_ios.pipeline_wrapper import Pipeline
ko_redesign_adviser = Pipeline(config_file_name="synthetic_example.json").run_pipeline()
In all these cases, if using the default settings, output will be written to .csv
and txt
files in
the data/outputs
folder.
Running tests
Shell scripts are provided, which run the tests in parallel (thanks to pytest-xdist).
# Windows:
test.bat
# Linux:
bash test.sh
Notes
About wittgenstein & grid search
Expand
- Excessive warnings are printed due to `frame.append` deprecation warnings in the `wittgenstein` package.
- Currently, they can just be suppressed by passing the `-Wignore` flag.
- Another situation where excessive warnings are printed, is during the parameter grid search, as some combinations may
yield too small training sets or sets with no positive examples.
- This can be safely ignored as long as the grid contains at least one parameter combination that results in a valid
dataset, and the rule discovery module is able to return meaningful rules.