text_plain_output_1.png
def get_dataset(ds, train_split=0.8, val_split=0.1, test_split=0.1, shuffle=True, shuffle_size=10000):
    ds_size = len(ds)
    if shuffle:
        ds = ds.shuffle(shuffle_size, seed=8)
    train_size = int(train_split * ds_size)
    val_size = int(val_split * ds_size)
    train_ds = ds.take(train_size)
    val_ds = ds.skip(train_size).take(val_size)
    test_ds = ds.skip(train_size).skip(val_size)
    return (train_ds, val_ds, test_ds)

print('Length of Training Dataset is', len(train_ds))
print('\nLength of Validation Dataset is', len(val_ds))
print('\nLength of Testing Dataset is', len(test_ds))