cblearn.datasets.fetch_nature_scene_similarity#
- cblearn.datasets.fetch_nature_scene_similarity(data_home=None, download_if_missing=True, shuffle=True, random_state=None, return_triplets=False)[source]#
Load the nature scene similarity dataset (odd-one-out).
Triplets
3355
Objects (Scenes)
120
See Nature and Vogue datasets for a detailed description.
>>> dataset = fetch_nature_scene_similarity(shuffle=True) >>> dataset.image_label[[0, -1]].tolist() ['art114.jpg', 'n344019.jpg'] >>> dataset.triplet.shape (3355, 3)
- 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.
- tripletndarray, shape (n_triplets, 3)
Each row corresponding odd-one-out query. The columns represent the odd image and two others.
- class_labelndarray, shape (120, )
Names of the scene images.
- DESCRstring
Description of the dataset.
- tripletsnumpy arrays (n_triplets, 3)
Only present when return_triplets=True.
- Return type:
dataset
- Raises:
IOError – If the data is not locally available, but download_if_missing=False