Hot encoding in python 3.x -
i getting error while hot encoding categorical variables present in data frame.
error: couldn't convert string float.
encoding categorical data
from sklearn.preprocessing import labelencoder,onehotencoder encoded_training_data = encode_training_data.apply(labelencoder().fit_transform) hotencoding = onehotencoder(categorical_features = 'all') encode_training_data = hotencoding.fit_transform(encode_training_data).toarray()
Comments
Post a Comment