Update plot_compare_reduction.py#10394
Conversation
Misplaced plt.show(), fixed. Like me a few scikit-learn newbies might be wondering where is the graph 😁 .
|
Thanks for this awesome library and wonderful tutorials! :-D |
|
I am pretty sure the example works fine as it is. Is the problem that you copied and pasted bits of code from http://scikit-learn.org/stable/auto_examples/plot_compare_reduction.html and that basically the I would say:
|
|
I just think plt.show() tend to be at the end of most examples and I'd rather leave it there because:
|
|
@lesteve, you are right the code runs well as it is now. I suggest the change for the sake of presentations in http://scikit-learn.org/stable/auto_examples/plot_compare_reduction.html. You can see in the screenshot that there are two headings:
Giving the impression that each can be run independently. But you can see in the screenshot that plt.show() is below the second Heading, which might leave the readers reading only Caching transformers within a Pipeline what is plt.show() doing out of no where. The current structure is also ok with me, and reasons pointed by @lesteve are perfectly valid. My only point is the presentation. Thanks! |
|
Since the main heading is Selecting dimensionality reduction with Pipeline and GridSearchCV, but second heading Caching transformers within a Pipeline has loose connection with the main heading, I believe a better solution would be to have the examples in separate pages, in future edits. That way all @lesteve's points will be preserved and will also be presentably good. What do you guys say? |
|
I am going to merge this one, because I don't think it is worth spending too much discussing it. What I want to make clear: problems like the one reported in this issue is a slightly negative side-effect of using a notebook-like example. I don't think there is much we can (or even should) do about it. In particular I don't think it is worth modifying other examples. All in all I don't think it impacts most of our users:
|
|
Merged, thanks a lot @krazedkrish! Note: the CircleCI ipython 2 error was a glitch with the mldata website. |
|
FWIW a binder integration has been merged into sphinx-gallery master so that for beginners this may be the best way to run the example (as long as they are familiar with the Jupyter notebook). Look at https://sphinx-gallery.github.io/auto_examples/plot_seaborn.html#sphx-glr-auto-examples-plot-seaborn-py for example and click on the binder button at the bottom of the example. |


Misplaced plt.show(), fixed.
Like me a few scikit-learn newbies might be wondering where is the graph 😁 .
Reference Issues/PRs
What does this implement/fix? Explain your changes.
A graph is supposed to be showen in the example: of Selecting dimensionality reduction with Pipeline and GridSearchCV. But it does not show due to misplaced
plt.show()