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 one day ago
Votes Newest

Answers 5


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 one day ago

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

  
  
Posted one day 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 one day 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 one day 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 18 hours ago
20 Views
5 Answers
one day ago
9 hours ago
Tags