with tables in pdf

This commit is contained in:
Alejandro Moreo Fernandez 2025-09-27 18:01:21 +02:00
parent 29bb261f62
commit 27afea8bf1
2 changed files with 11 additions and 3 deletions

View File

@ -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)

View File

@ -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)