From 6e910075ab490ef7640ed949a51bef7ec65fd2ef Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Tue, 17 Jan 2023 13:53:48 +0100 Subject: [PATCH] adding calibration methods from abstension package --- quapy/CHANGE_LOG.txt | 3 +++ quapy/method/aggregative.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/quapy/CHANGE_LOG.txt b/quapy/CHANGE_LOG.txt index 06d7dc4..20e0759 100644 --- a/quapy/CHANGE_LOG.txt +++ b/quapy/CHANGE_LOG.txt @@ -34,7 +34,10 @@ - newer versions of numpy raise a warning when accessing types (e.g., np.float). I have replaced all such instances with the plain python type (e.g., float). +- new dependency "abstention" (to add to the project requirements and setup) + Things to fix: +- calibration with recalibration methods has to be fixed for exact_train_prev in EMQ (conflicts with clone, deepcopy, etc.) - clean functions like binary, aggregative, probabilistic, etc; those should be resolved via isinstance(): this is not working; I don't know how to make the isinstance work. Looks like there is some problem with the path of the imported class wrt the path of the class that arrives from another module... diff --git a/quapy/method/aggregative.py b/quapy/method/aggregative.py index 57c821d..9e5338d 100644 --- a/quapy/method/aggregative.py +++ b/quapy/method/aggregative.py @@ -10,6 +10,7 @@ from sklearn.model_selection import StratifiedKFold, cross_val_predict from tqdm import tqdm import quapy as qp import quapy.functional as F +from classification.calibration import RecalibratedClassifier from quapy.classification.svmperf import SVMperf from quapy.data import LabelledCollection from quapy.method.base import BaseQuantifier, BinaryQuantifier @@ -137,6 +138,7 @@ class AggregativeProbabilisticQuantifier(AggregativeQuantifier): else: key_prefix = 'base_estimator__' parameters = {key_prefix + k: v for k, v in parameters.items()} + self.learner.set_params(**parameters)