-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_eaglemine.py
62 lines (55 loc) · 3.01 KB
/
run_eaglemine.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python2.7
# -*- coding=utf-8 -*-
########################################################################################
# Beyond outliers and on to micro-clusters: Vision-guided Anomaly Detection
# Authors: Wenjie Feng, Shenghua Liu, Christos Faloutsos, Bryan Hooi,
# and Huawei Shen, and Xueqi Cheng
#
# Project: eaglemine
# run_eaglemine.py
# Version: 1.0
# Date: Dec. 17 2017
# Main Contact: Wenchieh Feng (wenchiehfeng.us@gmail.com)
#
# Copyright:
# This software is free of charge under research purposes.
# For commercial purposes, please contact the author.
#
# Created by @wenchieh on <12/17/2017>
#
# Main contributor: Wenjie Feng
#
# -------------------------------------------------------------------------------
# EagleMine Algorithm interface
#
# example:
# python run_eaglemine.py output/histogram.out output/node2hcel.out \
# output/hcel2avgfeat.out 4 dtmnorm 1 2 2 output/
#
###########################################################
# sys
import warnings
import argparse
# project
from src.eaglemine_main import eaglemine
warnings.filterwarnings("ignore")
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="'EagleMine' algorithm",
usage="python run_eaglemine.py in_hist in_node2hcel in_hcel2avgfeat strict "
"desc_voc wt_featidx mode mix_comps outs")
parser.add_argument("in_hist", type=str, help="input path of histogram. "
"The record in histogram should be in the format 'x,y,z,...,val', "
"denoting that the cell (x, y, z, ...) affiliates with value 'val'")
parser.add_argument("in_node2hcel", type=str, help="input path of the file mapping the node to histogram cell")
parser.add_argument("in_hcel2avgfeat", type=str, help="input path of the file mapping the histogram cell to "
"the average features and #points [see example]")
parser.add_argument('strict', type=int, default=4, help="how strict should the anderson-darling test for normality. "
"0: not at all strict; 4: very strict")
parser.add_argument("desc_voc", type=str, choices=["dtmnorm", "dmgauss"], default="dtmnorm", help="model vocabulary")
parser.add_argument("wt_featidx", type=int, default=0, help="feature index as weight for suspiciousness metric")
parser.add_argument("mode", type=int, help="the dimensions of features (the histogram)")
parser.add_argument("mix_comps", type=int, default=2, help="# mixture component for describing the major island")
parser.add_argument("outs", type=str, help="output path of result")
args = parser.parse_args()
eaglemine(args.in_hist, args.in_node2hcel, args.in_hcel2avgfeat, args.outs, args.strict,
args.desc_voc, args.wt_featidx, args.mode, args.mix_comps)