joining directories

This commit is contained in:
Alejandro Moreo Fernandez 2023-02-22 11:31:02 +01:00
parent 24e755dcc1
commit 750b44aedb
2 changed files with 3 additions and 7 deletions

View File

@ -1,20 +1,16 @@
import itertools import itertools
from functools import cache from typing import Iterable
import numpy as np
from densratio import densratio from densratio import densratio
from scipy.sparse import issparse, vstack from scipy.sparse import issparse, vstack
from scipy.stats import multivariate_normal from scipy.stats import multivariate_normal
from sklearn.linear_model import LogisticRegression from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV from sklearn.model_selection import GridSearchCV
import quapy as qp from Transduction.pykliep import DensityRatioEstimator
from Transduction_office.pykliep import DensityRatioEstimator
from quapy.protocol import AbstractStochasticSeededProtocol, OnLabelledCollectionProtocol from quapy.protocol import AbstractStochasticSeededProtocol, OnLabelledCollectionProtocol
from quapy.data import LabelledCollection
from quapy.method.aggregative import * from quapy.method.aggregative import *
import quapy.functional as F import quapy.functional as F
from time import time
def gaussian(mean, cov=1., label=0, size=100, random_state=0): 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): 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'): return_type='sample_prev'):
super(CovPriorShift, self).__init__(random_state) super(CovPriorShift, self).__init__(random_state)
self.domains = list(itertools.chain.from_iterable(lc.separate() for lc in domains)) self.domains = list(itertools.chain.from_iterable(lc.separate() for lc in domains))