To be more robust here in classification, you can infer the label set from `y` and `estimator.classes_`. Then you can correct the type of y from binary to multiclass classification if necessary.