I am new to tensorflow, and I have started to use tensorflow 2.0
I have built a tensorflow dataset for a multi-class classification problem. Let's call this labeled_ds
. I have prepared this dataset by loading all the image files from their respective class wise directories. I have followed along the tutorial here : tensorflow guide to load image dataset
Now, I need to split labeld_ds
into three disjoint pieces : train, validation and test. I was going through the tensorflow API, but there was no example which allows to specify the split percentages. I found something in the load method, but I am not sure how to use it. Further, how can I get splits to be stratified ?
# labeled_ds contains multi class data, which is unbalanced.
train_ds, val_ds, test_ds = tf.data.Dataset.tfds.load(labeled_ds, split=["train", "validation", "test"])
I am stuck here, would appreciate any advice on how to progress from here. Thanks in advance.
tf.data
dataset – Awad