I have a dataset with 300 images, each of which has a variable number of flowers. These flower examples can be any of 3 classes. My goal is to develop a prediction algorithm to classify the flower based on its individual appearance.
I want to get:
- A stratified 50:25:25 training:validation:test for the flowers.
- However, I want to do this while guaranteeing that all flowers within the same image are assigned together into their respective training, validation or the testing set.
The second condition must be satisfied because I want to be able to say that image X is either a training image, a validation image or a testing image. Unless all flowers in image X fall into the same set, I cannot say this about image X.
I couldn't find anything in sklearn that can do this. Any hints?