Skip to content

Estimator utils

check_if_y_is_encoded(y)

checks if the target y is composed of sequential ints from 0 to N

Source code in tpot2/tpot_estimator/estimator_utils.py
def check_if_y_is_encoded(y):
    '''
    checks if the target y is composed of sequential ints from 0 to N
    '''
    y = sorted(set(y))
    return all(i == j for i, j in enumerate(y))