Split
Split Dataset¶
After you import your dataset, you can split it into train, validation and test sets.
Load Dataset¶
In [1]:
Copied!
from waffle_hub.dataset import Dataset
dataset = Dataset.load(name="mnist_coco")
from waffle_hub.dataset import Dataset
dataset = Dataset.load(name="mnist_coco")
/home/lhj/anaconda3/envs/waffle/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html from .autonotebook import tqdm as notebook_tqdm
Split Dataset¶
In [3]:
Copied!
dataset.split(train_ratio=0.8, val_ratio=0.2)
train_ids, val_ids, test_ids, unlabeled_ids = dataset.get_split_ids()
dataset.split(train_ratio=0.8, val_ratio=0.2)
train_ids, val_ids, test_ids, unlabeled_ids = dataset.get_split_ids()
In [4]:
Copied!
len(train_ids), len(val_ids), len(test_ids), len(unlabeled_ids)
len(train_ids), len(val_ids), len(test_ids), len(unlabeled_ids)
Out[4]:
(79, 21, 21, 0)