First I do a label encoding to all the columns that are strings so they will be numeric. After that, I take just the columns with the labels, convert them to np array, reshape, and convert them to one-hot encoding.
The "y" is of size 900 (of floats), and in the resize I change it to (900,1) so the one hot will work.
I use scikit-learn OneHotEncoding, and when doing fir_transform the result is:
Why do I get a tuple as output and not vectors of 1 and 0?
def OneHot(self,y): ohe = OneHotEncoder() y = y.reshape(len(y) , 1) y_hot = ohe.fit_transform(y) print(y_hot) return y_hot