diff --git a/Transduction_office/prueba.py b/Transduction/prueba.py similarity index 97% rename from Transduction_office/prueba.py rename to Transduction/prueba.py index 5e05315..78f20a2 100644 --- a/Transduction_office/prueba.py +++ b/Transduction/prueba.py @@ -1,20 +1,16 @@ import itertools -from functools import cache +from typing import Iterable -import numpy as np from densratio import densratio from scipy.sparse import issparse, vstack from scipy.stats import multivariate_normal from sklearn.linear_model import LogisticRegression from sklearn.model_selection import GridSearchCV -import quapy as qp -from Transduction_office.pykliep import DensityRatioEstimator +from Transduction.pykliep import DensityRatioEstimator from quapy.protocol import AbstractStochasticSeededProtocol, OnLabelledCollectionProtocol -from quapy.data import LabelledCollection from quapy.method.aggregative import * import quapy.functional as F -from time import time def gaussian(mean, cov=1., label=0, size=100, random_state=0): @@ -43,7 +39,7 @@ def gaussian(mean, cov=1., label=0, size=100, random_state=0): # ------------------------------------------------------------------------------------ class CovPriorShift(AbstractStochasticSeededProtocol): - def __init__(self, domains: list[LabelledCollection], sample_size=None, repeats=100, min_support=0, random_state=0, + def __init__(self, domains: Iterable[LabelledCollection], sample_size=None, repeats=100, min_support=0, random_state=0, return_type='sample_prev'): super(CovPriorShift, self).__init__(random_state) self.domains = list(itertools.chain.from_iterable(lc.separate() for lc in domains)) diff --git a/Transduction_office/pykliep.py b/Transduction/pykliep.py similarity index 100% rename from Transduction_office/pykliep.py rename to Transduction/pykliep.py