/InvariantRuleAD

Primary LanguagePythonApache License 2.0Apache-2.0

Learning Invariant Rules from Data for Interpretable Anomaly Detection

Getting Started

Install dependencies (with python 3.7)

pip install -r requirements.txt

Reproduce results for invariant rule-based anomaly detection

cd experiments
python main_ir.py --dataset <dataset> --mode <mode> --reproduce

Specify dataset to one of the following: swat, batadal, kddcup99, gaspipeline, annthyroid or cardio.

Specify mode to one of the following: DTImpurity, UniformBins or KmeansBins.

Run new experiments for invariant rule-based anomaly detection

cd experiments
python main_ir.py --dataset <dataset> --mode <mode> --theta <theta> --gamma <gamma>

Run experiments for baselines

cd experiments

LOF:

python main_lof.py --dataset <dataset>

IF:

python main_if.py --dataset <dataset>

AE:

python main_ae.py --dataset <dataset>

DeepSVDD:

python main_deepsvdd.py --dataset <dataset>