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

Datatype conversion issue while requesting shapley values #16469

Open
arunaryasomayajula opened this issue Jan 6, 2025 · 0 comments
Open

Datatype conversion issue while requesting shapley values #16469

arunaryasomayajula opened this issue Jan 6, 2025 · 0 comments
Labels
bug cust-wellsfargo reporter-support Reported as a support issue by cuetomer

Comments

@arunaryasomayajula
Copy link

arunaryasomayajula commented Jan 6, 2025

H2O version, Operating System and Environment
3.34.0.8+ Pysparkling issue. Ticket #https://support.h2o.ai/a/tickets/109423 from Well Fargo

Actual behavior

Predicting from H2O3 model with shapley values produces error as below screenshot. This is due to a datatype conversion error and was fixed using the below. WF asking this to be part of the pysparkling package.
image

Expected behavior
No error should occur and the datatype conversion should happen within pysparkling.

Fix used by customer.

convert LongType columns in the DataFrame to DoubleType before the model.transform(dataFrame) .

See fix below:

for col_name in df.columns:
if df.schema[col_name].dataType == LongType():
df = df.withColumn(col_name, F.col(col_name).cast(DoubleType()))

Steps to reproduce
Steps to reproduce the behavior (with working code on a sample dataset, if possible):

  1. Do this
  2. Do that
  3. Do something else
  4. See error

Upload logs
If you can, please upload the H2O logs. More information on how to do that is available here, or you can use the h2o.downloadAllLogs() in R or the h2o.download_all_logs() function in Python.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@arunaryasomayajula arunaryasomayajula added bug reporter-support Reported as a support issue by cuetomer cust-wellsfargo labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cust-wellsfargo reporter-support Reported as a support issue by cuetomer
Projects
None yet
Development

No branches or pull requests

1 participant