causalml icon indicating copy to clipboard operation
causalml copied to clipboard

Unable to adjust figsize when plotting feature importance

Open y14a-k331 opened this issue 5 years ago • 3 comments

Hi. I have a problem using BaseXClassifier.plot_importance to visualize feature importance with my dataset that has approx. 300 features. The matplotlib.pyplot.figsize is too small for the data that the letters inside a visualized output are unable to be seen. Also, I failed to intervene the values of figsize, as the method above is dependent on Explainer.plot_importance in causalml.inference.meta.explainer , which internally and automatically adjusts the figsize to (12,8) on its execution.

Is there any proper way to externally adjust the size of the ouput image? Thank you.

PS. I was wondering if this is a feature request or a minor bug report. I would re-submit the post if it's necessary.

Environment (please complete the following information):

  • Python Version: 3.7.1
  • causalml Version: 0.5.0

URL

y14a-k331 avatar Nov 17 '20 03:11 y14a-k331

Hi @yoshiakit thanks for using CausalML and reporting this. I think @yungmsh who is the contribution of the explainer module probably will know more why we set it up as (12, 8). I don't know a way to adjust it externally, maybe we could just allow users to pass the figsize into the plot_importance() function. How do you guys think about it? @jeongyoonlee @yungmsh @paullo0106. I can work on it if we just want to simply pass the parameter to the function.

ppstacy avatar Nov 19 '20 00:11 ppstacy

@ppstacy Thanks for your sincerity and connecting people. I'll be waiting for their updates :) I'd also be glad to work on it if needed!

y14a-k331 avatar Nov 19 '20 03:11 y14a-k331

that's the same fix I have in mind too : )

paullo0106 avatar Nov 19 '20 07:11 paullo0106