I am predicting the IPL match win probability. While deploying the model using streamlit it show this error:
AttributeError: 'ColumnTransformer' object has no attribute '_name_to_fitted_passthrough'
That's my code:
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder
trf = ColumnTransformer([('trf',OneHotEncoder(sparse=False,drop='first'),
['batting_team','bowling_team','city'])],remainder='passthrough')
pipeline code
pipe = Pipeline(steps=[
('step1',trf),
('step2',LogisticRegression(solver='liblinear'))])
See the version of your sklearn in the environment while building and saving the model using
do the same in the environment where you are loading the model using the same.
probably they aren't the same. Hope this helps!