Regression is a classification problem, where the output function y is 0,1 or True, False. Then it is enough to fit_transform your original data.
from sklearn import preprocessing
y = y_train.ravel()
lab = preprocessing.LabelEncoder()
y_transformed = lab.fit_transform(y)
print(y_transformed)