Not able to resolve this error : AttributeError: 'DecisionTreeClassifier' object has no attribute 'monotonic_cst'

I am continuously getting this error in streamlit while predicting. AttributeError: ‘DecisionTreeClassifier’ object has no attribute ‘monotonic_cst’
I have tried using joblib and pickle both, incase there is issue with them.

I saw solutions of changing the sklearn version but nothing seems to be working for me. I have tried these version in the requirements.txt file : streamlit==1.31.1
scikit-learn==1.3.0 / 1.3.2. (tried both)

Can someone please suggest me a solution for this?

As always with ML models, you should ensure that the scikit-learn version is the same when training the model as when loading and using the model.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.