def check_classification_targets(y):
    y_type = type_of_target(y)
    if y_type not in ['binary', 'multiclass', 'multiclass-multioutput', 
            'multilabel-indicator', 'multilabel-sequences']:
        raise ValueError("Unknown label type: %r" % y_type)
Ensure that target y is of a non-regression type.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/utils/multiclass.py/check_classification_targets