diff --git a/KDEyAitchison/commons.py b/KDEyAitchison/commons.py index 9e7b105..d7e20bd 100644 --- a/KDEyAitchison/commons.py +++ b/KDEyAitchison/commons.py @@ -1,11 +1,12 @@ import numpy as np import pandas as pd -from quapy.method.aggregative import EMQ, KDEyML +from quapy.method.aggregative import EMQ, KDEyML, PACC from sklearn.linear_model import LogisticRegression -METHODS = ['EMQ', - 'KDEy-ML', +METHODS = ['PACC', + 'EMQ', + # 'KDEy-ML', 'KDEy-MLA' ] @@ -37,6 +38,9 @@ def new_method(method, **lr_kwargs): elif method == 'EMQ': param_grid = hyper_LR quantifier = EMQ(lr) + elif method == 'PACC': + param_grid = hyper_LR + quantifier = PACC(lr) else: raise NotImplementedError('unknown method', method) diff --git a/KDEyAitchison/show_results.py b/KDEyAitchison/show_results.py index 3c18d6b..a4b41f5 100644 --- a/KDEyAitchison/show_results.py +++ b/KDEyAitchison/show_results.py @@ -8,6 +8,7 @@ import quapy as qp from quapy.model_selection import GridSearchQ from quapy.protocol import UPP from commons import METHODS, new_method, show_results +from new_table import LatexTable SEED = 1 @@ -16,6 +17,7 @@ SEED = 1 if __name__ == '__main__': print(qp.datasets.UCI_MULTICLASS_DATASETS) + table = LatexTable() for optim in ['mae']: result_dir = f'results/ucimulti/{optim}' @@ -29,6 +31,8 @@ if __name__ == '__main__': if os.path.exists(local_result_path + '.dataframe'): report = pd.read_csv(local_result_path+'.dataframe') print(f'{method}\t{dataset}\t{report["mae"].mean():.5f}') + table.add(benchmark=dataset, method=method, v=report["mae"].values) else: print(dataset, 'not found') + table.latexPDF('./tables/mae.pdf', landscape=False)