def train_valid_split(df):
    unique_whales = train_labels['Id'].unique()
    mapping = {}
    for whale in unique_whales:
        lst_of_images = list(train_labels[(train_labels['Id'] == whale)]['Image'].values)
        mapping[whale] = lst_of_images
    train_revised = []
    valid_revised = []
    for v in mapping.values():
        cut = int((0.2 * len(v)))
        cut2 = int((0.25 * len(v)))
        tr = v[:cut]
        val = v[cut:cut2]
        train_revised.append(tr)
        valid_revised.append(val)
    return (train_revised, valid_revised)
def train_valid_split(df):
    unique_whales = train_labels['Id'].unique()
    mapping = {}
    for whale in unique_whales:
        lst_of_images = list(train_labels[(train_labels['Id'] == whale)]['Image'].values)
        mapping[whale] = lst_of_images
    train_revised = []
    valid_revised = []
    for v in mapping.values():
        cut = int((0.2 * len(v)))
        cut2 = int((0.25 * len(v)))
        tr = v[:cut]
        val = v[cut:cut2]
        train_revised.append(tr)
        valid_revised.append(val)
    return (train_revised, valid_revised)