@@ -119,7 +119,7 @@ def _set_list_function(self, list_obj=None, name="objectives"):
119
119
list_obj0 .append (obj )
120
120
if len (list_obj0 ) > 0 :
121
121
print (f"MetaCluster doesn't support { name } : { list_obj0 } " )
122
- self . list_obj = list_obj1
122
+ return list_obj1
123
123
124
124
def _set_list_optimizer (self , list_optimizer = None , list_paras = None ):
125
125
if type (list_optimizer ) not in (list , tuple ):
@@ -200,7 +200,8 @@ def execute(self, data=None, cluster_finder="elbow", list_metric=None, save_path
200
200
"""
201
201
## Set up optimizer and objectives
202
202
self ._set_list_optimizer (self .list_optimizer , self .list_paras )
203
- self ._set_list_function (self .list_obj , name = "objectives" )
203
+ self .list_obj = self ._set_list_function (self .list_obj , name = "objectives" )
204
+ self .list_metric = self ._set_list_function (list_metric , name = "metrics" )
204
205
205
206
if data .y is not None :
206
207
n_clusters = len (np .unique (data .y ))
@@ -211,7 +212,6 @@ def execute(self, data=None, cluster_finder="elbow", list_metric=None, save_path
211
212
lb = np .min (data .X , axis = 0 ).tolist () * n_clusters
212
213
ub = np .max (data .X , axis = 0 ).tolist () * n_clusters
213
214
bound = mu .FloatVar (lb = lb , ub = ub , name = "center_weights" )
214
- self .list_metric = self ._set_list_function (list_metric , name = "metrics" )
215
215
216
216
## Check parent directories
217
217
self .save_path = f"{ save_path } /{ data .get_name ()} "
@@ -280,31 +280,31 @@ def save_boxplots(self, figure_size=None, xlabel="Optimizer", list_ylabel=None,
280
280
281
281
Parameters
282
282
----------
283
- figure_size : list, tuple, np.ndarray, None; default=None
283
+ figure_size : list, tuple, np.ndarray, None, default=None
284
284
The size for saved figures. `None` means it will automatically set for you.
285
285
Or you can pass (width, height) of figure based on pixel (100px to 1500px)
286
286
287
- xlabel : str; default="Optimizer"
287
+ xlabel : str, default="Optimizer"
288
288
The label for x coordinate of boxplot figures.
289
289
290
- list_ylabel : list, tuple, np.ndarray, None; default=None
290
+ list_ylabel : list, tuple, np.ndarray, None, default=None
291
291
The label for y coordinate of boxplot figures. Each boxplot corresponding to each metric in list_metric parameter,
292
292
therefor, if you wish to change to y label, you need to pass a list of string represent all metrics in order of list_metric.
293
293
None means it will use the name of metrics as the label
294
294
295
- title : str; default="Boxplot of comparison models"
295
+ title : str, default="Boxplot of comparison models"
296
296
The title of figures, it should be the same for all objectives since we have y coordinate already difference.
297
297
298
- show_legend : bool; default=True
298
+ show_legend : bool, default=True
299
299
Show the legend or not. For boxplots we can turn on or off this option, but not for convergence chart.
300
300
301
- show_mean_only : bool; default=False
301
+ show_mean_only : bool, default=False
302
302
You can show the mean value only or you can show all mean, std, median of the box by this parameter
303
303
304
- exts : list, tuple, np.ndarray; default=(".png", ".pdf")
304
+ exts : list, tuple, np.ndarray, default=(".png", ".pdf")
305
305
List of extensions of the figures. It is for multiple purposes such as latex (need ".pdf" format), word (need ".png" format).
306
306
307
- file_name : str; default="boxplot"
307
+ file_name : str, default="boxplot"
308
308
The prefix for filenames that will be saved.
309
309
"""
310
310
if type (figure_size ) in (list , tuple , np .ndarray ):
@@ -332,25 +332,25 @@ def save_convergences(self, figure_size=None, xlabel="Epoch", list_ylabel=None,
332
332
333
333
Parameters
334
334
----------
335
- figure_size : list, tuple, np.ndarray, None; default=None
335
+ figure_size : list, tuple, np.ndarray, None, default=None
336
336
The size for saved figures. `None` means it will automatically set for you.
337
337
Or you can pass (width, height) of figure based on pixel (100px to 1500px)
338
338
339
- xlabel : str; default="Optimizer"
339
+ xlabel : str, default="Optimizer"
340
340
The label for x coordinate of convergence figures.
341
341
342
- list_ylabel : list, tuple, np.ndarray, None; default=None
342
+ list_ylabel : list, tuple, np.ndarray, None, default=None
343
343
The label for y coordinate of convergence figures. Each convergence corresponding to each objective in list_obj,
344
344
therefor, if you wish to change to y label, you need to pass a list of string represent all objectives in order of list_obj.
345
345
None means it will use the name of objectives as the label
346
346
347
- title : str; default="Convergence chart of comparison models"
347
+ title : str, default="Convergence chart of comparison models"
348
348
The title of figures, it should be the same for all objectives since we have y coordinate already difference.
349
349
350
- exts : list, tuple, np.ndarray; default=(".png", ".pdf")
350
+ exts : list, tuple, np.ndarray, default=(".png", ".pdf")
351
351
List of extensions of the figures. It is for multiple purposes such as latex (need ".pdf" format), word (need ".png" format).
352
352
353
- file_name : str; default="convergence"
353
+ file_name : str, default="convergence"
354
354
The prefix for filenames that will be saved.
355
355
"""
356
356
if type (figure_size ) in (list , tuple , np .ndarray ):
0 commit comments