---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-74-f4ec8d8babcb> in <module>
----> 1 predictor_load.add_input(x=Xtrain, ypred=ytrain)
c:\users\chetan_ambi\.conda\envs\shapash\lib\site-packages\shapash\explainer\smart_predictor.py in add_input(self, x, ypred, contributions)
195 """
196 if x is not None:
--> 197 x = self.check_dataset_features(self.check_dataset_type(x))
198 self.data = self.clean_data(x)
199 self.data["x_postprocessed"] = self.apply_postprocessing()
c:\users\chetan_ambi\.conda\envs\shapash\lib\site-packages\shapash\explainer\smart_predictor.py in check_dataset_features(self, x)
293 assert all(column in self.features_types.keys() for column in x.columns)
294 if not all([str(x[feature].dtypes) == self.features_types[feature] for feature in x.columns]):
--> 295 raise ValueError("Types of features in x doesn't match with the expected one in features_types.")
296 return x
297
ValueError: Types of features in x doesn't match with the expected one in features_types.
It's considering only np.float, np.int. Should we consider adding np.int32, np.float32, np.int64, np.float64
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-24-f4ec8d8babcb> in <module>
----> 1 predictor_load.add_input(x=Xtrain, ypred=ytrain)
c:\users\chetan_ambi\.conda\envs\shapash\lib\site-packages\shapash\explainer\smart_predictor.py in add_input(self, x, ypred, contributions)
211
212 if ypred is not None:
--> 213 self.data["ypred_init"] = self.check_ypred(ypred)
214
215 if contributions is not None:
c:\users\chetan_ambi\.conda\envs\shapash\lib\site-packages\shapash\explainer\smart_predictor.py in check_ypred(self, ypred)
305 User-specified prediction values.
306 """
--> 307 return check_ypred(self.data["x"],ypred)
308
309 def choose_state(self, contributions):
c:\users\chetan_ambi\.conda\envs\shapash\lib\site-packages\shapash\utils\check.py in check_ypred(x, ypred)
135 raise ValueError("y_pred must be a one column pd.Dataframe or pd.Series.")
136 if not (ypred.dtypes[0] in [np.float, np.int]):
--> 137 raise ValueError("y_pred must contain int or float only")
138 if isinstance(ypred, pd.Series):
139 if not (ypred.dtype in [np.float, np.int]):
ValueError: y_pred must contain int or float only