Hi, got this error while trying to deploy a model i built with pycaret, any suggestion would be a great help.
Hi @seyirex -
Can you provide a code snippet that demonstrates this behavior? Itās not easy to tell what you are trying to do just by looking at a picture of the error.
Best,
Randy
@seyirex The problem is that in the features dictionary, you are making variables as keys and strings as values. But the problem is that in python, keys must be unique which in your case is not happening i.e. all the feature names mentioned in the error are having multiple repeatable keys thatās why when feature dictionary is called, these features are not included and thus creating error for the streamlit.
Try this instead:
feature = {'Property_Type:Property_Type,
āBedsā:Beds,
āBathsā:Baths,
āToiletsā:Toilets,
āProperty_attributeā:Property_attribute,
āStateā:State
}
Notice, I have changed the position of key and values. You have to change all the variables like this and then it will work out fine. Remember, first strings as key and then variable as value i.e. strings : variable.
I hope it helps,
Best,
Muhammad Ali
@alihussainia thanks i would try it out and get back to you.
Brother @randyzwitch and brother @seyirex have a look at app.py of my streamlit based project repo.
@randyzwitch and @seyirex hereās the deployed version of the app.
https://share.streamlit.io/alihussainia/star-ratings-prediction/app.py
@alihussainia the solution worked
Nice app, @alihussainia if only you could make the rating fit a table without scrolling to the right to view the rating but due to the your dataset it might not be visable, i love the fact that one is able to use pycaret and steamlit together makes model deployment easy
Thanks, brother @seyirex. I am glad that you liked the work.