question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[RFC] Unify appearance of `plot_param_importances` between plotly and matplotlib backends

See original GitHub issue

Motivation

Plotly’s plot_param_importances shows the importance scores explicitly as in the optuna’s docs page on the right next of each bar. On the other hand, mathplotlib’s one does not show the scores as in the optuna’s docs page there. To minimize the difference between them, we would like to see similar plots not depending on the backends.

I think we have two options:

  1. Remove importance scores from Plotly’s plot
  2. Add importance scores to matplotlib’s plot

The reason behind the first option is that the scores mislead users sometimes, particular when the importance scores are less than 0.01. See https://github.com/optuna/optuna/issues/2868#issue-978621430 as an example. Note that users can modify the plot object returned by plot functions in practice; users can remove them or adjust importance scores. In addition, if optuna internally removes the importance scores, it is hard for users to compute the importance score again due to its stochastic nature (see also related issue https://github.com/optuna/optuna/issues/2757).

Screenshot 2021-09-07 at 16 11 07

Description

Depending on the decision.

Alternatives (optional)

Additional context (optional)

A similar plot by scikit-learn does not provide such values.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
nzw0301commented, Nov 25, 2021

I think we can close this issue because @xadrianzetx resolved this issue by #3012 and #3073. Thank you so much for improving both plot_param_importances functions!

3reactions
nzw0301commented, Oct 12, 2021

Let me summarise the opinions from dev-members @HideakiImamura @hvy @toshihikoyanase.

  • Keep numerical values on the right next to bars. Technically we can add std bar for the current importance score’s algorithms. However, we cannot add an error bar as on sklearn’s example if we introduce a deterministic importance calculation algorithm.
  • Add importance scores to matplotlib’s plot to unify the appearance.
  • For an importance score is less than 0.01, change the format to <0.01. (further opinions are welcome!)

Now, I suppose that we can resolve this issue by sending two PRs:

  • change the format for importance score less than 0.01
  • add the same importance score’s text to matplotlib backend as Plotly’s one.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Stabilise visualisation module · Issue #2959 · optuna ... - GitHub
I've already created related issues: [RFC] Unify appearance of plot_param_importances between plotly and matplotlib backends #2893 ...
Read more >
Plotting Data in Python: matplotlib vs plotly - ActiveState
In this article, I will compare and demonstrate two common visualization tools used in Python: matplotlib and plotly.
Read more >
Matplotlib vs. Plotly Express: Which One is the Best Library for ...
Today we are going to compare Matplotlib to Plotly Express. ... I know that you are here to see real-life comparisons between these...
Read more >
Connecting Matplotlib with plotly - Geo-Python
In the final part of this week's lesson, we will learn how to automatically export plots from matplotlib to plotly, where they can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found