-
Notifications
You must be signed in to change notification settings - Fork 3
/
server_cluster.py
31 lines (27 loc) · 1.55 KB
/
server_cluster.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
import argparse
from param_search_cluster import train_cluster
parser = argparse.ArgumentParser("cluster", fromfile_prefix_chars='@')
parser.add_argument('-d', '--dimension_reduction', type=int, default=0, help='0:none,1:pca, 2:nmf')
parser.add_argument('-c', "--cluster_way", type=int, default=0, help='1:birch, 3:dbscan')
parser.add_argument('-n', "--n_components", type=int, default=0, help='n_components')
parser.add_argument('-e', "--eps", type=float, default=1.0, help='dbscan')
parser.add_argument('-t', "--threshold", type=float, default=2, help='birch threshold')
parser.add_argument('-nc', "--n_clusters", type=int, default=200, help='birch n_clusters')
parser.add_argument('-bc', "--branching_factor", type=int, default=50, help='birch branching_factor')
parser.add_argument('-l', "--linkage", type=int, default=0,
help='AgglomerativeClustering: ["ward", "complete", "average", "single"]')
parser.add_argument('-dt', "--data_type", type=int, default=0, help='0:only tfidf, 1:all, 2:only nn')
parser.add_argument('-i', "--max_iter", type=int, default=200, help='max_iter for NMF')
args = parser.parse_args()
data_type = args.data_type
dimension_reduction = args.dimension_reduction
cluster_way = args.cluster_way
n_components = args.n_components
threshold = args.threshold
n_clusters = args.n_clusters
branching_factor = args.branching_factor
linkage = args.linkage
max_iter = args.max_iter
eps = args.eps
train_cluster(data_type, dimension_reduction, cluster_way, n_components, threshold, n_clusters, branching_factor,
linkage, max_iter, eps)