[scikit-learn] API Discussion: Where shall we put the plotting functions?

Roman Yurchak rth.yurchak at pm.me
Wed Apr 3 07:35:23 EDT 2019


+1 for options 1 and +0.5 for 3. Do we anticipate that many plotting 
functions will be added? If it's just a dozen or less, putting them all 
into a single namespace sklearn.plot might be easier.

This also would avoid discussion about where to put some generic 
plotting functions (e.g. 
https://github.com/scikit-learn/scikit-learn/issues/13448#issuecomment-478341479).

Roman

On 03/04/2019 12:06, Trevor Stephens wrote:
> I think #1 if any of these... Plotting functions should hopefully be as 
> general as possible, so tagging with a specific type of estimator will, 
> in some scikit-learn utopia, be unnecessary.
> 
> If a general plotter is built, where does it live in other 
> estimator-specific namespace options? Feels awkward to put it under 
> every estimator's namespace.
> 
> Then again, there might be a #4 where there is no plot module and 
> plotting classes live under groups of utilities like introspection, 
> cross-validation or something?...
> 
> On Wed, Apr 3, 2019 at 8:54 PM Andrew Howe <ahowe42 at gmail.com 
> <mailto:ahowe42 at gmail.com>> wrote:
> 
>     My preference would be for (1). I don't think the sub-namespace in
>     (2) is necessary, and don't like (3), as I would prefer the plotting
>     functions to be all in the same namespace sklearn.plot.
> 
>     Andrew
> 
>     <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
>     J. Andrew Howe, PhD
>     LinkedIn Profile <http://www.linkedin.com/in/ahowe42>
>     ResearchGate Profile <http://www.researchgate.net/profile/John_Howe12/>
>     Open Researcher and Contributor ID (ORCID)
>     <http://orcid.org/0000-0002-3553-1990>
>     Github Profile <http://github.com/ahowe42>
>     Personal Website <http://www.andrewhowe.com>
>     I live to learn, so I can learn to live. - me
>     <~~~~~~~~~~~~~~~~~~~~~~~~~~~>
> 
> 
>     On Tue, Apr 2, 2019 at 3:40 PM Hanmin Qin <qinhanmin2005 at sina.com
>     <mailto:qinhanmin2005 at sina.com>> wrote:
> 
>         See https://github.com/scikit-learn/scikit-learn/issues/13448
> 
>         We've introduced several plotting functions (e.g., plot_tree and
>         plot_partial_dependence) and will introduce more (e.g.,
>         plot_decision_boundary) in the future. Consequently, we need to
>         decide where to put these functions. Currently, there're 3
>         proposals:
> 
>         (1) sklearn.plot.plot_YYY (e.g., sklearn.plot.plot_tree)
> 
>         (2) sklearn.plot.XXX.plot_YYY (e.g., sklearn.plot.tree.plot_tree)
> 
>         (3) sklearn.XXX.plot.plot_YYY (e.g.,
>         sklearn.tree.plot.plot_tree, note that we won't support from
>         sklearn.XXX import plot_YYY)
> 
>         Joel Nothman, Gael Varoquaux and I decided to post it on the
>         mailing list to invite opinions.
> 
>         Thanks
> 
>         Hanmin Qin
>         _______________________________________________
>         scikit-learn mailing list
>         scikit-learn at python.org <mailto:scikit-learn at python.org>
>         https://mail.python.org/mailman/listinfo/scikit-learn
> 
>     _______________________________________________
>     scikit-learn mailing list
>     scikit-learn at python.org <mailto:scikit-learn at python.org>
>     https://mail.python.org/mailman/listinfo/scikit-learn
> 




More information about the scikit-learn mailing list