over time experiments

This commit is contained in:
Alejandro Moreo Fernandez 2025-12-15 12:19:48 +01:00
parent 1661a79dbb
commit 4e6014c0f2
2 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression as LR, LogisticRegressionCV from sklearn.linear_model import LogisticRegression as LR, LogisticRegressionCV
from tqdm import tqdm from tqdm import tqdm
import quapy as qp import quapy as qp
from data import LabelledCollection, Dataset from quapy.data import LabelledCollection, Dataset
import quapy.functional as F import quapy.functional as F
from method.composable import QUnfoldWrapper from method.composable import QUnfoldWrapper
from quapy.method.aggregative import DistributionMatchingY, EMQ, KDEyML from quapy.method.aggregative import DistributionMatchingY, EMQ, KDEyML
@ -165,7 +165,7 @@ def plot_prevalences(results_dict, target_class=1, target_label='positive', save
dates_smooth, y_smooth = smooth_curve(dates, target_component) dates_smooth, y_smooth = smooth_curve(dates, target_component)
if method=='true-prev': if method=='true-prev':
line,=plt.plot(dates_smooth, y_smooth, label=method, linewidth=3, linestyle='-') line,=plt.plot(dates_smooth, y_smooth, label=method, linewidth=3, linestyle='-', color='black')
else: else:
line,=plt.plot(dates_smooth, y_smooth, label=method, linewidth=2, linestyle='--') line,=plt.plot(dates_smooth, y_smooth, label=method, linewidth=2, linestyle='--')
plt.plot(dates, target_component, 'o', markersize=10, color=line.get_color()) plt.plot(dates, target_component, 'o', markersize=10, color=line.get_color())
@ -259,10 +259,10 @@ else:
def methods(): def methods():
yield 'CC', CC(new_classifier(), fit_classifier=to_fit) yield 'CC', CC(new_classifier(), fit_classifier=to_fit)
yield 'ACC', ACC(new_classifier(), fit_classifier=to_fit) yield 'ACC', ACC(new_classifier(), fit_classifier=to_fit)
yield 'SLD', EMQ(new_classifier(), fit_classifier=to_fit)
yield 'HDy', DistributionMatchingY(new_classifier(), fit_classifier=to_fit) yield 'HDy', DistributionMatchingY(new_classifier(), fit_classifier=to_fit)
yield 'HDx', HDxDensify() yield 'HDx', HDxDensify()
yield 'KMM', QUnfoldWrapperDensify(KMM()) yield 'KMM', QUnfoldWrapperDensify(KMM())
yield 'SLD', EMQ(new_classifier(), fit_classifier=to_fit)
yield 'KDEy', KDEyML(new_classifier(), fit_classifier=to_fit) yield 'KDEy', KDEyML(new_classifier(), fit_classifier=to_fit)

View File

@ -3,7 +3,7 @@ from sklearn.linear_model import LogisticRegression, LogisticRegressionCV
from sklearn.model_selection import GridSearchCV from sklearn.model_selection import GridSearchCV
import quapy as qp import quapy as qp
from data import LabelledCollection from quapy.data import LabelledCollection
from method.non_aggregative import DMx from method.non_aggregative import DMx
from protocol import APP from protocol import APP
from quapy.method.aggregative import CC, DMy, ACC, EMQ from quapy.method.aggregative import CC, DMy, ACC, EMQ
@ -20,9 +20,9 @@ def cls():
def gen_methods(): def gen_methods():
yield CC(cls()), r'CC$_{10' + r'\%}$' yield CC(cls()), r'CC$_{10' + r'\%}$'
yield ACC(cls()), 'ACC' yield ACC(cls()), 'ACC'
yield EMQ(cls()), 'SLD'
yield DMy(cls(), val_split=10, nbins=10, n_jobs=-1), 'HDy' yield DMy(cls(), val_split=10, nbins=10, n_jobs=-1), 'HDy'
yield DMx(nbins=10, n_jobs=-1), 'HDx' yield DMx(nbins=10, n_jobs=-1), 'HDx'
yield EMQ(cls()), 'SLD'
# yield EMQ(cls(), calib='vs'), 'SLD-VS' # yield EMQ(cls(), calib='vs'), 'SLD-VS'
def gen_data(): def gen_data():