When I use model.predict()
, the following error occurs,
ValueError: could not convert string to float:
One-hot encoding was used in my code as follows,
features_df = pd.get_dummies(df, columns=['garage_type', 'city'])
The predict code used is given below.
sample = [["attached"], ["Richardport"]]
predictedvalue = model.predict(sample)'
Any suggestions to solve this error? Thank you.