From 8fc466904648b2ffd05f26b7c140fead914ff444 Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Tue, 14 Feb 2023 19:15:59 +0100 Subject: [PATCH] import fix --- examples/custom_quantifier.py | 8 ++++---- examples/lequa2022_experiments.py | 9 ++++----- quapy/method/aggregative.py | 8 +++----- quapy/method/meta.py | 3 +-- quapy/method/neural.py | 2 +- setup.py | 6 ++++-- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/examples/custom_quantifier.py b/examples/custom_quantifier.py index 705c371..31a69cd 100644 --- a/examples/custom_quantifier.py +++ b/examples/custom_quantifier.py @@ -1,8 +1,8 @@ import quapy as qp -from data import LabelledCollection -from method.base import BaseQuantifier, BinaryQuantifier -from model_selection import GridSearchQ -from quapy.method.aggregative import PACC, AggregativeProbabilisticQuantifier +from quapy.data import LabelledCollection +from quapy.method.base import BinaryQuantifier +from quapy.model_selection import GridSearchQ +from quapy.method.aggregative import AggregativeProbabilisticQuantifier from quapy.protocol import APP import numpy as np from sklearn.linear_model import LogisticRegression diff --git a/examples/lequa2022_experiments.py b/examples/lequa2022_experiments.py index 6b6225d..f3eec55 100644 --- a/examples/lequa2022_experiments.py +++ b/examples/lequa2022_experiments.py @@ -1,12 +1,11 @@ import numpy as np -from sklearn.calibration import CalibratedClassifierCV from sklearn.linear_model import LogisticRegression import quapy as qp import quapy.functional as F -from data.datasets import LEQUA2022_SAMPLE_SIZE, fetch_lequa2022 -from evaluation import evaluation_report -from method.aggregative import EMQ -from model_selection import GridSearchQ +from quapy.data.datasets import LEQUA2022_SAMPLE_SIZE, fetch_lequa2022 +from quapy.evaluation import evaluation_report +from quapy.method.aggregative import EMQ +from quapy.model_selection import GridSearchQ import pandas as pd """ diff --git a/quapy/method/aggregative.py b/quapy/method/aggregative.py index ee73ba3..3410999 100644 --- a/quapy/method/aggregative.py +++ b/quapy/method/aggregative.py @@ -2,16 +2,14 @@ from abc import abstractmethod from copy import deepcopy from typing import Callable, Union import numpy as np -from joblib import Parallel, delayed from scipy import optimize -from sklearn.base import BaseEstimator, clone +from sklearn.base import BaseEstimator from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import confusion_matrix -from sklearn.model_selection import StratifiedKFold, cross_val_predict -from tqdm import tqdm +from sklearn.model_selection import cross_val_predict import quapy as qp import quapy.functional as F -from classification.calibration import NBVSCalibration, BCTSCalibration, TSCalibration, VSCalibration +from quapy.classification.calibration import NBVSCalibration, BCTSCalibration, TSCalibration, VSCalibration from quapy.classification.svmperf import SVMperf from quapy.data import LabelledCollection from quapy.method.base import BaseQuantifier, BinaryQuantifier, OneVsAllGeneric diff --git a/quapy/method/meta.py b/quapy/method/meta.py index 6db6861..2bb8af7 100644 --- a/quapy/method/meta.py +++ b/quapy/method/meta.py @@ -7,7 +7,6 @@ from sklearn.model_selection import GridSearchCV, cross_val_predict from tqdm import tqdm import quapy as qp -from evaluation import evaluate_on_samples from quapy import functional as F from quapy.data import LabelledCollection from quapy.model_selection import GridSearchQ @@ -178,7 +177,7 @@ class Ensemble(BaseQuantifier): For each model in the ensemble, the performance is measured in terms of _error_name_ on the quantification of the samples used for training the rest of the models in the ensemble. """ - from quapy.evaluation import evaluate + from quapy.evaluation import evaluate_on_samples error = qp.error.from_name(error_name) tests = [m[3] for m in self.ensemble] scores = [] diff --git a/quapy/method/neural.py b/quapy/method/neural.py index e407aeb..aeb8a7d 100644 --- a/quapy/method/neural.py +++ b/quapy/method/neural.py @@ -6,7 +6,7 @@ import torch from torch.nn import MSELoss from torch.nn.functional import relu -from protocol import UPP +from quapy.protocol import UPP from quapy.method.aggregative import * from quapy.util import EarlyStop diff --git a/setup.py b/setup.py index 898ff46..5bb39a4 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ def get_version(rel_path): return line.split(delim)[1] else: raise RuntimeError("Unable to find version string.") + # Arguments marked as "Required" below must be included for upload to PyPI. # Fields marked as "Optional" may be commented out. @@ -114,7 +115,7 @@ setup( python_requires='>=3.6, <4', - install_requires=['scikit-learn', 'pandas', 'tqdm', 'matplotlib'], + install_requires=['scikit-learn', 'pandas', 'tqdm', 'matplotlib', 'joblib', 'xlrd', 'abstention'], # List additional groups of dependencies here (e.g. development # dependencies). Users will be able to install these using the "extras" @@ -158,7 +159,8 @@ setup( project_urls={ # Optional 'Contributors': 'https://github.com/HLT-ISTI/QuaPy/graphs/contributors', 'Bug Reports': 'https://github.com/HLT-ISTI/QuaPy/issues', - 'Documentation': 'https://github.com/HLT-ISTI/QuaPy/wiki', + 'Wiki': 'https://github.com/HLT-ISTI/QuaPy/wiki', + 'Documentation': 'https://hlt-isti.github.io/QuaPy/build/html/index.html', 'Source': 'https://github.com/HLT-ISTI/QuaPy/', }, )