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

2d PDP Z-axis colours appear too similar #535

Open
emrynHofmannElephant opened this issue May 1, 2024 · 1 comment
Open

2d PDP Z-axis colours appear too similar #535

emrynHofmannElephant opened this issue May 1, 2024 · 1 comment

Comments

@emrynHofmannElephant
Copy link

Hi, not sure if this is always the case, or just when the interactions don't provide much value, but the colours within the explainability dashboard (and when you export them) are very flat. Perhaps instead of using the scores_range here, something else should be used?

heatmap["zmin"] = data_dict["scores_range"][0]

At the moment I've fixed the issue within a function which exports the individual plots:

fig = model.explain_global().visualize(key)
# Reformat the plot - autoscale, and if it is a heatmap (2d PDP) rescale the Z value
fig["layout"]["yaxis"].update(autorange=True)
if hasattr(fig.data[0], "z"): # Checks if there's Z values 
    fig = fig.update_traces(
        zmin=np.min(fig.data[0].z)-(0.5*np.abs(np.min(fig.data[0].z))), # Set zmin as the min plotted, minus a little bit
        zmax=np.max(fig.data[0].z)+(0.5*np.abs(np.max(fig.data[0].z))), # Set zmax as the max plotted, plus a little bit
        selector=dict(type='heatmap') # Only apply this to heatmaps
    )

Where key is an iterator from a loop of indices

Before the change:
image
After:
image

(not the best example, due to this pdp being quite flat, but even in the case of a 2x2 plot, it looked flat, but there is a difference between z values)

@paulbkoch
Copy link
Collaborator

Hi @emrynHofmannElephant -- I think the color scale could be improved by using the maximum absolute score of the pairs instead of the existing scores_range. We have a previous issue for this. The underlying problem is that the EBM visualizations use the maximum absolute score for both pairs and mains, but often the pair score range is smaller than for the mains.

#236

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

No branches or pull requests

2 participants