UCI Datasets
quack.datasets._uci_datasets.load_uci(dataset)
Load a UCI dataset by name using the registered loader factory.
Downloads (if not cached), preprocess and splits features/targets for
the requested UCI dataset, delegating the whole pipeline to the
corresponding BaseDatasetLoader subclass registered in UCILoaderFactory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
str
|
Dataset key. Must be one of |
required |
Returns:
| Type | Description |
|---|---|
X, y: np.ndarray, np.ndarray
|
Feature matrix |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
Examples:
>>> from quack.datasets import load_uci
>>> X, y = load_uci("bc-count")
Source code in quack/datasets/_uci_datasets.py
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | |
quack.datasets._uci_datasets.UCILoaderFactory
Factory used to instanciate the correct Loader based on the dataset name.
Some of these datasets are build with one-versus-all strategy and others are naturally binary problems. These are the datasets used in [1].
Refs [1] Schumacher, Tobias, Markus Strohmaier, and Florian Lemmerich. "A comparative evaluation of quantification methods." Journal of Machine Learning Research 26.55 (2025): 1-54.
Source code in quack/datasets/_uci_datasets.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | |
Forman Datasets
quack.datasets._forman_datasets.load_forman(dataset, data_home=None, force_load=False)
Load the datasets from [1] following scikit patterns. If there is no tmp dataset locally available, this method will download a tmp version from zenodo and save locally.
Note that the splits are not performed, once the user may want to perform a binary or a multiclass quantification over these datasets.
Refs: [1] Forman, G. Quantifying counts and costs via classification. Data Min Knowl Disc 17, 164–206 (2008). https://doi.org/10.1007/s10618-008-0097-y
Args: dataset (str): Dataset name. The list of valid dataset name is available at quack.datasets.FORMAN_DATASETS. data_home (Path, optional): Directory that the tmp dataset file will be saved locally. If its None, the default dataset will be obtained from utils. Defaults to None. force_load (bool, optional): Force the download of the files even if there is a tmp file available locally. Defaults to False.
Returns: tuple[np.ndarray, np.ndarray]: Tuple containing the features and labels of the choosen dataset.
Source code in quack/datasets/_forman_datasets.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |