{"action":"created","issue":{"url":"https://api.github.com/repos/slundberg/shap/issues/111","repository_url":"https://api.github.com/repos/slundberg/shap","labels_url":"https://api.github.com/repos/slundberg/shap/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/slundberg/shap/issues/111/comments","events_url":"https://api.github.com/repos/slundberg/shap/issues/111/events","html_url":"https://github.com/slundberg/shap/issues/111","id":330492601,"node_id":"MDU6SXNzdWUzMzA0OTI2MDE=","number":111,"title":"ValueError: left cannot be >= right","user":{"login":"PrashantSaikia","id":39755678,"node_id":"MDQ6VXNlcjM5NzU1Njc4","avatar_url":"https://avatars0.githubusercontent.com/u/39755678?v=4","gravatar_id":"","url":"https://api.github.com/users/PrashantSaikia","html_url":"https://github.com/PrashantSaikia","followers_url":"https://api.github.com/users/PrashantSaikia/followers","following_url":"https://api.github.com/users/PrashantSaikia/following{/other_user}","gists_url":"https://api.github.com/users/PrashantSaikia/gists{/gist_id}","starred_url":"https://api.github.com/users/PrashantSaikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrashantSaikia/subscriptions","organizations_url":"https://api.github.com/users/PrashantSaikia/orgs","repos_url":"https://api.github.com/users/PrashantSaikia/repos","events_url":"https://api.github.com/users/PrashantSaikia/events{/privacy}","received_events_url":"https://api.github.com/users/PrashantSaikia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-06-08T01:54:26Z","updated_at":"2018-07-03T03:37:11Z","closed_at":null,"author_association":"NONE","body":"Hey Scott,\r\n\r\nFirst of all, SHAP works almost seemlessly, or at the very least, smoothly, with Python, unlike a lot of libraries that require a lot of initial struggle to get started with. So, thanks for that. 👍 :)\r\n\r\nI am facing an issue with the `summary_plot` module. My dataset has feature names that can be a bit lengthy (I can shorten them manually, but my boss doesn't want me to alter the feature names for some reason). I think that's the reason I am getting this `ValueError: left cannot be >= right`. It does plot the figure with the correct feature names though, but it stops the code flow. Do you know any workaround for the matplotlib implementation of `summary_plot` (the `tight_layout()` module to be precise), which is what causes this error?\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-35-b8a918e5bdf1> in <module>()\r\n      1 shap_values = shap.TreeExplainer(model).shap_values(pd.DataFrame(X_train, columns=X.columns))\r\n----> 2 shap.summary_plot(shap_values, pd.DataFrame(X_train, columns=X.columns))\r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\shap\\plots.py in summary_plot(shap_values, features, feature_names, max_display, plot_type, color, axis_color, title, alpha, show, sort, color_bar, auto_size_plot, layered_violin_max_num_bins)\r\n    616     pl.ylim(-1, len(feature_order))\r\n    617     pl.xlabel(labels['VALUE'], fontsize=13)\r\n--> 618     pl.tight_layout()\r\n    619     if show:\r\n    620         pl.show()\r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\matplotlib\\pyplot.py in tight_layout(pad, h_pad, w_pad, rect)\r\n   1364     \"\"\"\r\n   1365     fig = gcf()\r\n-> 1366     fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)\r\n   1367 \r\n   1368 \r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\matplotlib\\figure.py in tight_layout(self, renderer, pad, h_pad, w_pad, rect)\r\n   2274             self, self.axes, subplotspec_list, renderer,\r\n   2275             pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)\r\n-> 2276         self.subplots_adjust(**kwargs)\r\n   2277 \r\n   2278     def align_xlabels(self, axs=None):\r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\matplotlib\\figure.py in subplots_adjust(self, *args, **kwargs)\r\n   2086 \r\n   2087         \"\"\"\r\n-> 2088         self.subplotpars.update(*args, **kwargs)\r\n   2089         for ax in self.axes:\r\n   2090             if not isinstance(ax, SubplotBase):\r\n\r\n~\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\matplotlib\\figure.py in update(self, left, bottom, right, top, wspace, hspace)\r\n    239             if self.left >= self.right:\r\n    240                 reset()\r\n--> 241                 raise ValueError('left cannot be >= right')\r\n    242 \r\n    243             if self.bottom >= self.top:\r\n\r\nValueError: left cannot be >= right\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/slundberg/shap/issues/comments/402003429","html_url":"https://github.com/slundberg/shap/issues/111#issuecomment-402003429","issue_url":"https://api.github.com/repos/slundberg/shap/issues/111","id":402003429,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjAwMzQyOQ==","user":{"login":"PrashantSaikia","id":39755678,"node_id":"MDQ6VXNlcjM5NzU1Njc4","avatar_url":"https://avatars0.githubusercontent.com/u/39755678?v=4","gravatar_id":"","url":"https://api.github.com/users/PrashantSaikia","html_url":"https://github.com/PrashantSaikia","followers_url":"https://api.github.com/users/PrashantSaikia/followers","following_url":"https://api.github.com/users/PrashantSaikia/following{/other_user}","gists_url":"https://api.github.com/users/PrashantSaikia/gists{/gist_id}","starred_url":"https://api.github.com/users/PrashantSaikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrashantSaikia/subscriptions","organizations_url":"https://api.github.com/users/PrashantSaikia/orgs","repos_url":"https://api.github.com/users/PrashantSaikia/repos","events_url":"https://api.github.com/users/PrashantSaikia/events{/privacy}","received_events_url":"https://api.github.com/users/PrashantSaikia/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T03:37:11Z","updated_at":"2018-07-03T03:37:11Z","author_association":"NONE","body":"Hi Scott. Changing the xlim worked for `shap.dependence_plot()`. But how do I do this for `shap.summary_plot(shap_interaction_values, X)`? I tried `plt.xlim(-1,1)`, but that just plotted another figure with the specified xlims, and the shap plot below it. I need this to \"zoom in\" to the values for the interaction plot below - the default xlims are -5 to +5, and its not enough zoom to make the plot clear.\r\n\r\n![shap](https://user-images.githubusercontent.com/39755678/42197439-67490842-7eb5-11e8-9903-a9307ab00d86.PNG)\r\n"}}
{"actor":{"display_login":"PrashantSaikia"}}