diff --git a/distribution_matching/lequa_experiments.py b/distribution_matching/lequa_experiments.py index 9e6e11c..95b6b5e 100644 --- a/distribution_matching/lequa_experiments.py +++ b/distribution_matching/lequa_experiments.py @@ -18,7 +18,7 @@ if __name__ == '__main__': qp.environ['SAMPLE_SIZE'] = qp.datasets.LEQUA2022_SAMPLE_SIZE['T1B'] qp.environ['N_JOBS'] = -1 optim = 'mrae' - result_dir = f'results_lequa_{optim}' + result_dir = f'results/results_lequa_{optim}' os.makedirs(result_dir, exist_ok=True) diff --git a/distribution_matching/show_results.py b/distribution_matching/show_results.py index 918d12e..5f71776 100644 --- a/distribution_matching/show_results.py +++ b/distribution_matching/show_results.py @@ -2,7 +2,7 @@ import sys from pathlib import Path import pandas as pd -result_dir = 'results_tweet_mae_redohyper' +result_dir = 'results/results_tweet_mae_redohyper' #result_dir = 'results_lequa_mrae' dfs = [] diff --git a/distribution_matching/tweets_experiments.py b/distribution_matching/tweets_experiments.py index 8d2e542..3aa3611 100644 --- a/distribution_matching/tweets_experiments.py +++ b/distribution_matching/tweets_experiments.py @@ -21,7 +21,7 @@ if __name__ == '__main__': n_bags_val = 250 n_bags_test = 1000 optim = 'mae' - result_dir = f'results_tweet_{optim}_redohyper' + result_dir = f'results/results_tweet_{optim}_redohyper' os.makedirs(result_dir, exist_ok=True) diff --git a/quapy/data/base.py b/quapy/data/base.py index 8c80fba..244d39d 100644 --- a/quapy/data/base.py +++ b/quapy/data/base.py @@ -319,7 +319,8 @@ class LabelledCollection: else: raise NotImplementedError('unsupported operation for collection types') labels = np.concatenate([lc.labels for lc in args]) - classes = np.unique(labels).sort() + classes = np.unique(labels) + classes.sort() return LabelledCollection(instances, labels, classes=classes) @property diff --git a/quapy/data/datasets.py b/quapy/data/datasets.py index 5a0dde1..499b997 100644 --- a/quapy/data/datasets.py +++ b/quapy/data/datasets.py @@ -204,7 +204,7 @@ def fetch_UCIDataset(dataset_name, data_home=None, test_split=0.3, verbose=False :return: a :class:`quapy.data.base.Dataset` instance """ data = fetch_UCILabelledCollection(dataset_name, data_home, verbose) - return Dataset(*data.split_stratified(1 - test_split, random_state=0)) + return Dataset(*data.split_stratified(1 - test_split, random_state=0), name=dataset_name) def fetch_UCILabelledCollection(dataset_name, data_home=None, verbose=False) -> LabelledCollection: