(domain: Domain, split_label: str)
Split the domain based on values of `split_label` value.
Split the domain based on values of `split_label` value.
Split the domain based on values of split_label value .
def split_domain(domain: Domain, split_label: str):
    """Split the domain based on values of `split_label` value.
    """
    groups = defaultdict(list)
    for var in domain.attributes:
        val = var.attributes.get(split_label)
        groups[val].append(var)
    if None in groups:
        na = groups.pop(None)
        return [*groups.items(), ("N/A", na)]
    else:
        return list(groups.items())
def split_domain ( domain : Domain , split_label : str ) : groups = defaultdict ( list ) for var in domain . attributes : val = var . attributes . get ( split_label ) groups [ val ] . append ( var ) if None in groups : na = groups . pop ( None ) return [ * groups . items ( ) , ( "N/A" , na ) ] else : return list ( groups . items ( ) )