Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmartExplainer: sometimes can not handle input data that have more than 5 variables #523

Open
brahim7 opened this issue Jan 22, 2024 · 1 comment

Comments

@brahim7
Copy link

brahim7 commented Jan 22, 2024

I said in the title above sometimes ...because the behavior is random.
1-I did two tests, passing my Xtest data which have 5 variables and all works good.
but ones I pass into Smartexplainer a data frame with same format as Xtest but has more than 5 variables, the error bellow appear.
my table type is float32 based from input text originally. the error: AttributeError: 'DataFrame' object has no attribute 'dtype'.....which is not true

2-I tried to upgrade the shapash version but I still also have this warning

Code 👍
xpl = SmartExplainer(
model=model
)

xpl.compile(x=Xtest, y_pred=y_pred)

app = xpl.run_app()

\smart_app.py:126: FutureWarning:

DataFrame.applymap has been deprecated. Use DataFrame.map instead.

T
raceback (most recent call last):

Cell In[8], line 369
app = xpl.run_app()

File ~\anaconda3\Lib\site-packages\shapash\explainer\smart_explainer.py:1079 in run_app
self.smartapp = SmartApp(self, settings)

File ~\anaconda3\Lib\site-packages\shapash\webapp\smart_app.py:137 in init
self.init_data()

File ~\anaconda3\Lib\site-packages\shapash\webapp\smart_app.py:207 in init_data
typ = self.dataframe[col].dtype

File ~\anaconda3\Lib\site-packages\pandas\core\generic.py:6204 in getattr
return object.getattribute(self, name)

AttributeError: 'DataFrame' object has no attribute 'dtype'

Python version :Python 3.11.5 64-bit | Qt 5.15.2 | PyQt5 5.15.7 | Spyder IDE 5.4.3

Shapash version : 2.4.1

Operating System :Windows 10

@brahim7 brahim7 changed the title SmartExplainer: can not handle input data that have more than 5 variables SmartExplainer: sometimes can not handle input data that have more than 5 variables Jan 22, 2024
@guerinclement
Copy link
Collaborator

Hello brahim7,
Could you please provide a full executable example so we can reproduce your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants