src.utils.util.prepare_stimulus_data¶
- prepare_stimulus_data(all_data, data_subset, class_ignore_list, label_level)[source]¶
Prepare data for modelling.
First filters data by class. Then rescales the image to [0-255] scale.
- Parameters
all_data – Dictionary of numpy arrays which contains all data.
data_subset – A string value that denotes the train/test subset. Can only be “train” or “test”.
class_ignore_list – A list of class labels to ignore.
label_level – An integer that denotes the label hierarchy level. Lies between [0,3].
- Returns
A tuple of 2d numpy arrays which contains input image and output class labels.
- Return type
- Raises
ValueError – If label_level does not lie between [0, 3].
ValueError – If data_subset does not contain either “train” or “test”.
ValueError – If class_ignore_list is empty.
- Return type