Following up on my ‘Solved: Abalone Shell Load CSV batch input from dataset’ topic:
abalone_csv_ds = tf.data.experimental.make_csv_dataset(
abalone_file_path,
column_names=["Length", "Diameter", "Height", "Whole weight", "Shucked weight",
"Viscera weight", "Shell weight", "Age"],
batch_size=10, # Artificially small to make examples easier to show.
label_name='Age',
num_epochs=1,
ignore_errors=True,)
def pack(features, label):
return tf.stack(list(features.values()), axis=-1), label
packed_dataset = abalone_csv_ds.map(pack)
Model.fit(packed_dataset, ..)
As make_csv_dataset does not seem to support split: I guess packed_dataset is not split automatically into a training and test set? Any suggestions on how to split the CSV batches into a train and validation set?
Thanks,
GW