with tables in pdf
This commit is contained in:
parent
29bb261f62
commit
27afea8bf1
|
|
@ -1,11 +1,12 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
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
|
from sklearn.linear_model import LogisticRegression
|
||||||
|
|
||||||
METHODS = ['EMQ',
|
METHODS = ['PACC',
|
||||||
'KDEy-ML',
|
'EMQ',
|
||||||
|
# 'KDEy-ML',
|
||||||
'KDEy-MLA'
|
'KDEy-MLA'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -37,6 +38,9 @@ def new_method(method, **lr_kwargs):
|
||||||
elif method == 'EMQ':
|
elif method == 'EMQ':
|
||||||
param_grid = hyper_LR
|
param_grid = hyper_LR
|
||||||
quantifier = EMQ(lr)
|
quantifier = EMQ(lr)
|
||||||
|
elif method == 'PACC':
|
||||||
|
param_grid = hyper_LR
|
||||||
|
quantifier = PACC(lr)
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError('unknown method', method)
|
raise NotImplementedError('unknown method', method)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import quapy as qp
|
||||||
from quapy.model_selection import GridSearchQ
|
from quapy.model_selection import GridSearchQ
|
||||||
from quapy.protocol import UPP
|
from quapy.protocol import UPP
|
||||||
from commons import METHODS, new_method, show_results
|
from commons import METHODS, new_method, show_results
|
||||||
|
from new_table import LatexTable
|
||||||
|
|
||||||
|
|
||||||
SEED = 1
|
SEED = 1
|
||||||
|
|
@ -16,6 +17,7 @@ SEED = 1
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(qp.datasets.UCI_MULTICLASS_DATASETS)
|
print(qp.datasets.UCI_MULTICLASS_DATASETS)
|
||||||
|
table = LatexTable()
|
||||||
for optim in ['mae']:
|
for optim in ['mae']:
|
||||||
result_dir = f'results/ucimulti/{optim}'
|
result_dir = f'results/ucimulti/{optim}'
|
||||||
|
|
||||||
|
|
@ -29,6 +31,8 @@ if __name__ == '__main__':
|
||||||
if os.path.exists(local_result_path + '.dataframe'):
|
if os.path.exists(local_result_path + '.dataframe'):
|
||||||
report = pd.read_csv(local_result_path+'.dataframe')
|
report = pd.read_csv(local_result_path+'.dataframe')
|
||||||
print(f'{method}\t{dataset}\t{report["mae"].mean():.5f}')
|
print(f'{method}\t{dataset}\t{report["mae"].mean():.5f}')
|
||||||
|
table.add(benchmark=dataset, method=method, v=report["mae"].values)
|
||||||
else:
|
else:
|
||||||
print(dataset, 'not found')
|
print(dataset, 'not found')
|
||||||
|
table.latexPDF('./tables/mae.pdf', landscape=False)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue