On using fit() method on sklearn.ensemble.RandomForestClassifier I am getting a value error that says.
ValueError: could not convert string to float: 'male'
The data-set used is the one in Titanic:Machine Learning from Disaster competition on Kaggle. Here is the link- https://www.kaggle.com/c/titanic Can someone please help me how to deal with this, why is it occurring and how to prevent it in future.
Note-There are no NaN in my DataFrame for train_X, i.e I have replaced all NaN with df.fillna(df.mean()), also I cross-checked that no NaN values exist by using
train_X.isnull().sum()
where, train_X is the training data for features. Please Help!!
factor()
function. $\endgroup$