-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all() #5
Comments
Hi Neeraj, Do you have the full stack trace? Where exactly does it throw the error? From the error itself it seems that somewhere in the code where I expect a type that resolves to a bool, I get a dataframe instead. I didn't make any recent releases, so I would guess it's probably is an incompatibility with your environment? Did you update any packages in the last two days? What OS are you using? What kind of model are you using (and what version?)? Version of shap? But happy that overall you find it useful! Let's get this error fixed! :) |
Hi Neeraj, The first error could be related to running an old version of dash (the line When the So not sure what's going in your case, but I guess it's an old version. So could you How did you construct the explainer for the second error? explainer.cats should be a list of strings that you passed to the constructor. But from the error it seems that in your example explainer.cats is either a pd.Series or a pd.DataFrame? |
Hi Oege, Thanks again! I have one more question though, so when we use LIME explainer, then it needs data in certain format, for example, when we before label encoding the categories, it needs dictionary of those key value label encodes to be passed for it determine correctly, if "sex" is category and if yes, 1- means Male. In titanic example, the data seem to have one-hot encoding done categories, do we need to do that in all cases.? PS- also do you know how to share the dashboard quickly, is it supposed to be depoyed on heroku or something? Best, |
Yeah, the In order to share the dashboard you need to deploy it somewhere. You should talk to IT within your organization to see if they have a server available to host it. The deployment section of the docs give some info on how to do it. Or otherwise the dash deployment documentation. You'd probably also want to think of adding some authentication of some kind (will probably add this into the package in the near future as well): https://dash.plotly.com/authentication |
I have a simple dataset & a SVR. However,
What does it mean, what could be the problem? |
Do you have a deeper stacktrace? Not clear to me where this error actually originates... does it happen when you just wrap |
That's everything. Without the wrap (X and y are pd.read_csv()) it is
|
ah, so the issue is in the line Are there any nan's in your |
No nan's.
|
... ah, hence I have to use |
Ah, so you y_test, was not one dimensional? Usually you would get a dimensionality error though: pd.Series(np.ones((1, 10))).astype('float32')
---------------------------------------------------------------------------
ValueError: Data must be 1-dimensional Is there something about your input data that I could autodetect and then correct for? |
It's a dataframe of shape |
hmm. I could just put in an assertion Or just wrap it in a |
I keep getting this error for any and all ind of model running. I even tried running the example dataset- Titanic, even that ended up throwing same error.
Is there any update in process because of which this is happening, because it explainer dashboard was working fine until 2 days ago. I would appreciate a quick response. :)
This is really cool implementation and is very useful in my current work environment, thank you very much for working on this.
The text was updated successfully, but these errors were encountered: