Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi Everyone, Has Someone Of You Tried To Track Your Shap Plots With Clearml? Somehow In My Dashboard The Tracked Plots Are Empty. Might They Be Too Complex Or Something? Br Sophie

Hi everyone, has someone of you tried to track your SHAP plots with clearML? Somehow in my dashboard the tracked plots are empty. Might they be too complex or something? BR Sophie

  
  
Posted 3 days ago
Votes Newest

Answers 7


Hi @<1787291173992271872:profile|BlandCormorant75> , how are you logging those plots? Can you provide a stand alone snippet that reproduces your behaviour?

  
  
Posted 3 days ago

This should work:

from clearml import Task

task = Task.init(project_name="examples", task_name="shap example")
import xgboost
import shap

# train an XGBoost model
X, y = shap.datasets.california()
model = xgboost.XGBRegressor().fit(X, y)

# explain the model's predictions using SHAP
# (same syntax works for LightGBM, CatBoost, scikit-learn, transformers, Spark, etc.)
explainer = shap.Explainer(model)
shap_values = explainer(X)

# visualize the first prediction's explanation
shap.plots.waterfall(shap_values[0])

image

  
  
Posted 2 days ago

Hey, good day and thank you for your quick replies! So this is the code snippet I was using to create the plots (see appended image). I also tried removing the plt.savefig() part or the plt.show() part or manually adding the report_matplotlib_figure-part for the task but nothing seems to make a difference.
image

  
  
Posted 2 days ago

"plt" comes from matplotlib.pyplot and as I understand the clearML documentation, matplotlib plots are logged automatically. In other scripts, this works just fine but not with these SHAP-plots that are just displayed as empty plots:
image

  
  
Posted 2 days ago

Hmm Could you check if it makes a difference importing ClearML before shap ?
If this changes nothing, could you put a standalone script to reproduce the issue ?

  
  
Posted 2 days ago

Hey Martin, unfortunately the adapted import order did not change anything. Thank you anyways 🙂 I will try to provide some standalone code so the issue can be reproduced

  
  
Posted one day ago

another though, see what happens if you remove the .save and .close and stay with the .show, maybe the close call somehow interfere's with it ?
Otherwise, if you can test one of the shaps examples and see maybe they fail in your setup that's another avenue to take for reproducing the issue

  
  
Posted one day ago
25 Views
7 Answers
3 days ago
16 hours ago
Tags