full example of training, model selection, and evaluation using the lequa2022 dataset with the new protocols

This commit is contained in:
Alejandro Moreo Fernandez 2022-11-04 15:15:12 +01:00
parent 6cb9f388e0
commit eafc82c96a
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ from data.datasets import LEQUA2022_SAMPLE_SIZE, fetch_lequa2022
from evaluation import evaluation_report
from method.aggregative import EMQ
from model_selection import GridSearchQ
import pandas as pd
task = 'T1A'
@ -21,6 +22,8 @@ model_selection = GridSearchQ(quantifier, param_grid, protocol=val_generator, n_
quantifier = model_selection.fit(training)
# evaluation
report = evaluation_report(quantifier, protocol=test_generator, error_metrics=['mae', 'mrae'], verbose=True)
report = evaluation_report(quantifier, protocol=test_generator, error_metrics=['mae', 'mrae', 'mkld'], verbose=True)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', 1000)
print(report)