Commit 5011c245f1dbb62ba77f1390b626427e2086fb36
1 parent
dfcac4b1
Exists in
master
and in
1 other branch
Updated config options.
Showing
1 changed file
with
10 additions
and
5 deletions
Show diff stats
src/config.py
... | ... | @@ -44,7 +44,8 @@ class Config(): |
44 | 44 | self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index") |
45 | 45 | self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir") |
46 | 46 | self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir") |
47 | - self.index_mode = "0" # use old index | |
47 | + self.k_medoids = 100 | |
48 | + self.index_mode = "old" | |
48 | 49 | self.strategy = "cb" |
49 | 50 | self.weight = "bm25" |
50 | 51 | self.load_options() |
... | ... | @@ -65,8 +66,9 @@ class Config(): |
65 | 66 | print " -a, --axi=PATH Path to Apt-xapian-index" |
66 | 67 | print " -p, --popconindex=PATH Path to popcon dedicated index" |
67 | 68 | print " -m, --popcondir=PATH Path to popcon submissions dir" |
68 | - print " -u, --index_mode= 0: old, 1:reindex, 11:clustered_index" | |
69 | + print " -u, --indexmode= old, reindex, cluster, recluster" | |
69 | 70 | print " -l, --clustersdir=PATH Path to popcon clusters dir" |
71 | + print " -e, --medoids=k Number of medoids for clustering" | |
70 | 72 | print " -w, --weight=OPTION Search weighting scheme" |
71 | 73 | print " -s, --strategy=OPTION Recommendation strategy" |
72 | 74 | print "" |
... | ... | @@ -115,13 +117,14 @@ class Config(): |
115 | 117 | self.popcon_dir = self.read_option('recommender', 'popcon_dir') |
116 | 118 | self.index_mode = self.read_option('recommender', 'index_mode') |
117 | 119 | self.clusters_dir = self.read_option('recommender', 'clusters_dir') |
120 | + self.k_medoids = self.read_option('recommender', 'k_medoids') | |
118 | 121 | self.weight = self.read_option('recommender', 'weight') |
119 | 122 | self.strategy = self.read_option('recommender', 'strategy') |
120 | 123 | |
121 | - short_options = "hdvo:c:a:p:m:ul:w:s:" | |
124 | + short_options = "hdvo:c:a:p:m:ul:e:w:s:" | |
122 | 125 | long_options = ["help", "debug", "verbose", "output=", "config=", |
123 | - "axi=", "popconindex=", "popcondir=", "index_mode=", | |
124 | - "clusters_dir=", "weight=", "strategy="] | |
126 | + "axi=", "popconindex=", "popcondir=", "indexmode=", | |
127 | + "clustersdir=", "kmedoids=", "weight=", "strategy="] | |
125 | 128 | try: |
126 | 129 | opts, args = getopt.getopt(sys.argv[1:], short_options, |
127 | 130 | long_options) |
... | ... | @@ -154,6 +157,8 @@ class Config(): |
154 | 157 | self.index_mode = p |
155 | 158 | elif o in ("-l", "--clustersdir"): |
156 | 159 | self.clusters_dir = p |
160 | + elif o in ("-e", "--kmedoids"): | |
161 | + self.k_medoids = p | |
157 | 162 | elif o in ("-w", "--weight"): |
158 | 163 | self.weight = p |
159 | 164 | elif o in ("-s", "--strategy"): | ... | ... |