cblearn.datasets.fetch_food_similarity#
- cblearn.datasets.fetch_food_similarity(data_home=None, download_if_missing=True, shuffle=True, random_state=None, return_triplets=False)[source]#
Load the Food-100 food similarity dataset (triplets).
Warning
This function downloads the file without verifying the ssl signature to circumvent an outdated certificate of the dataset hosts. However, after downloading the function verifies the file checksum before loading the file to minimize the risk of man-in-the-middle attacks.
Triplets
190376
Objects
100
Dimensionality
unknown
See Food Similarity dataset for a detailed description.
- Parameters:
data_home (PathLike | None) – optional, default: None Specify another download and cache folder for the datasets. By default all scikit-learn data is stored in ‘~/scikit_learn_data’ subfolders.
download_if_missing (bool) – optional, default=True
shuffle (bool) – default = True Shuffle the order of triplet constraints.
random_state (RandomState | None) – optional, default = None Initialization for shuffle random generator
return_triplets (bool) – boolean, default=False. If True, returns numpy array instead of a Bunch object.
- Returns:
BunchDictionary-like object, with the following attributes.
- data: ndarray, shape (n_triplets, 3)
Each row corresponding a triplet constraint. The columns represent the target, more similar and more distant food index.
- image_namesndarray, shape (n_objects,)
The food image names corresponding to the indices.
- DESCRstring
Description of the dataset.
- tripletsnumpy array (n_triplets, 3)
Only present when return_triplets=True.
- Return type:
dataset
- Raises:
IOError – If the data is not locally available, but downlaod_if_missing=False