-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
40 lines (31 loc) · 965 Bytes
/
Copy pathmain.py
File metadata and controls
40 lines (31 loc) · 965 Bytes
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
"""The main program that runs gSpan."""
# -*- coding=utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from gspan_mining.config import get_args
from gspan_mining.gspan import gSpan
def main():
"""Run gSpan."""
FLAGS = get_args()
if not os.path.exists(FLAGS.database_file_name):
print('{} does not exist.'.format(FLAGS.database_file_name))
sys.exit()
gs = gSpan(
database_file_name=FLAGS.database_file_name,
min_support=FLAGS.min_support,
min_num_vertices=FLAGS.lower_bound_of_num_vertices,
max_num_vertices=FLAGS.upper_bound_of_num_vertices,
max_ngraphs=FLAGS.num_graphs,
is_undirected=(not FLAGS.directed),
verbose=FLAGS.verbose,
visualize=FLAGS.plot,
where=FLAGS.where
)
gs.run()
gs.time_stats()
return gs
if __name__ == '__main__':
main()