I'm developing a machine learning project in which I need to predict the prices of hotel rooms.
Since in my data set there are also the names of the hotels, I want to improve the performance of my model by using DictVectorizer on the name feature.
However Python keeps presenting the "str' object is not callable" error at the line vec= dict.fit_transform(X_data). Can anyone help me with this?
For reference, I think the issue arises due to use of
dtype='str'while initializingDictVectorizer(sparse=False,dtype='str'). Instead it should be specified asdtype=strwithout the quotes.stris not a callable object in python whereasstris a callable object.