adding bootstrap variants
This commit is contained in:
parent
12b431ef4b
commit
fd62e73d2d
|
|
@ -6,13 +6,14 @@ from pathlib import Path
|
|||
from sklearn.linear_model import LogisticRegression
|
||||
import quapy as qp
|
||||
from BayesianKDEy._bayeisan_kdey import BayesianKDEy
|
||||
from method.aggregative import DistributionMatchingY as DMy
|
||||
from quapy.method.base import BinaryQuantifier
|
||||
from quapy.model_selection import GridSearchQ
|
||||
from quapy.data import Dataset
|
||||
# from BayesianKDEy.plot_simplex import plot_prev_points, plot_prev_points_matplot
|
||||
from quapy.method.confidence import ConfidenceIntervals, BayesianCC, PQ, WithConfidenceABC
|
||||
from quapy.method.confidence import ConfidenceIntervals, BayesianCC, PQ, WithConfidenceABC, AggregativeBootstrap
|
||||
from quapy.functional import strprev
|
||||
from quapy.method.aggregative import KDEyML
|
||||
from quapy.method.aggregative import KDEyML, ACC
|
||||
from quapy.protocol import UPP
|
||||
import quapy.functional as F
|
||||
import numpy as np
|
||||
|
|
@ -34,9 +35,14 @@ def new_classifier():
|
|||
|
||||
def methods():
|
||||
cls, cls_hyper = new_classifier()
|
||||
hdy_hyper = {**cls_hyper, 'n_bins': [3,4,5,8,16,32]}
|
||||
kdey_hyper = {**cls_hyper, 'bandwidth': [0.001, 0.005, 0.01, 0.05, 0.1, 0.2]}
|
||||
yield 'BootstrapACC', AggregativeBootstrap(ACC(clone(cls)), n_test_samples=1000), cls_hyper
|
||||
yield 'BootstrapHDy', AggregativeBootstrap(DMy(clone(cls), divergence='HD'), n_test_samples=1000), hdy_hyper
|
||||
yield 'BootstrapKDEy', AggregativeBootstrap(KDEyML(clone(cls)), n_test_samples=1000), kdey_hyper
|
||||
# yield 'BayesianACC', BayesianCC(clone(cls), mcmc_seed=0), cls_hyper
|
||||
# yield 'BayesianHDy', PQ(clone(cls), stan_seed=0), {**cls_hyper, 'n_bins': [3,4,5,8,16,32]}
|
||||
yield 'BayesianKDEy', BayesianKDEy(clone(cls), mcmc_seed=0), {**cls_hyper, 'bandwidth': [0.001, 0.005, 0.01, 0.05, 0.1, 0.2]}
|
||||
# yield 'BayesianHDy', PQ(clone(cls), stan_seed=0), hdy_hyper
|
||||
# yield 'BayesianKDEy', BayesianKDEy(clone(cls), mcmc_seed=0), kdey_hyper
|
||||
|
||||
|
||||
def experiment(dataset: Dataset, method: WithConfidenceABC, grid: dict):
|
||||
|
|
|
|||
Loading…
Reference in New Issue