From 1ad9776565d0b57fba4c590ad905a16806bc84bd Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Fri, 20 Jan 2017 12:03:54 -0500 Subject: [PATCH] version bump to 0.3.2 --- docs/about.rst | 37 +++++++++++++++++++++----- docs/api/modules.rst | 8 +++--- docs/api/yellowbrick.features.rst | 10 +++---- docs/api/yellowbrick.rst | 4 +-- docs/conf.py | 9 ++++++- requirements.txt | 1 + tests/__init__.py | 2 +- yellowbrick/classifier.py | 44 +++++++++++++++---------------- yellowbrick/utils.py | 22 ++++++++++------ yellowbrick/version.py | 4 +-- 10 files changed, 89 insertions(+), 52 deletions(-) diff --git a/docs/about.rst b/docs/about.rst index a457108c3..de2dcf4af 100644 --- a/docs/about.rst +++ b/docs/about.rst @@ -83,12 +83,33 @@ From Wikipedia_: Changelog --------- +Hardened the Yellowbrick API to elevate the idea of a Visualizer to a first principle. This included reconciling shifts in the development of the preliminary versions to the new API, formalizing Visualizer methods like `draw()` and `finalize()`, and adding utilities that revolve around Scikit-Learn. To that end we also performed administrative tasks like refreshing the documentation and preparing the repository for more and varied open source contributions. + +Version 0.3.2 +^^^^^^^^^^^^^ + +* Tag: v0.3.2_ +* Deployed: Friday, January 20, 2017 +* Contributors: Benjamin Bengfort, Rebecca Bilbro + +Changes: + - Converted Mkdocs documentation to Sphinx documentation + - Updated docstrings for all Visualizers and functions + - Created a DataVisualizer base class for dataset visualization + - Single call functions for simple visualizer interaction + - Added yellowbrick specific color sequences and palettes and env handling + - More robust examples with downloader from DDL host + - Better axes handling in visualizer, matplotlib/sklearn integration + - Added a finalize method to complete drawing before render + - Improved testing on real data sets from examples + - Bugfix: score visualizer renders in notebook but not in Python scripts. + - Bugfix: tests updated to support new API Hotfix 0.3.1 ^^^^^^^^^^^^ Hotfix to solve pip install issues with Yellowbrick. -* Tag: v0.3.1 +* Tag: v0.3.1_ * Deployed: Monday, October 10, 2016 * Contributors: Benjamin Bengfort @@ -103,7 +124,7 @@ This release marks a major change from the previous MVP releases as Yellowbrick In this release specifically we focused on visualizers in the data space for feature analysis and visualizers in the model space for scoring and evaluating models. Future releases will extend these base classes and add more functionality. -* Tag: v0.3 +* Tag: v0.3_ * Deployed: Sunday, October 9, 2016 * Contributors: Benjamin Bengfort, Rebecca Bilbro, Marius van Niekerk @@ -134,7 +155,7 @@ Version 0.2 ^^^^^^^^^^^ Intermediate steps towards a complete API for visualization. Preparatory stages for Scikit-Learn visual pipelines. -* Tag: v0.2 +* Tag: v0.2_ * Deployed: Sunday, September 4, 2016 * Contributors: Benjamin Bengfort, Rebecca Bilbro, Patrick O'Melveny, Ellen Lowy, Laura Lorenz @@ -157,7 +178,7 @@ Version 0.1 ^^^^^^^^^^^ Created the yellowbrick library MVP with two primary operations: a classification report heat map and a ROC/AUC curve model analysis for classifiers. This is the base package deployment for continuing yellowbrick development. -* Tag: v0.1 +* Tag: v0.1_ * Deployed: Wednesday, May 18, 2016 * Contributors: Benjamin Bengfort, Rebecca Bilbro @@ -169,10 +190,12 @@ Created the yellowbrick library MVP with two primary operations: a classificatio - Stub tests/stub documentation - - - .. _SIGMOD: http://cseweb.ucsd.edu/~arunkk/vision/SIGMODRecord15.pdf .. _cycle: http://nvie.com/posts/a-successful-git-branching-model/ .. _board: https://waffle.io/districtdatalabs/yellowbrick .. _Wikipedia: https://en.wikipedia.org/wiki/Yellow_brick_road +.. _v0.3.2: https://github.com/DistrictDataLabs/yellowbrick/releases/tag/v0.3.2 +.. _v0.3.1: https://github.com/DistrictDataLabs/yellowbrick/releases/tag/v0.3.1a2 +.. _v0.3: https://github.com/DistrictDataLabs/yellowbrick/releases/tag/v0.3 +.. _v0.2: https://github.com/DistrictDataLabs/yellowbrick/releases/tag/v0.2 +.. _v0.1: https://github.com/DistrictDataLabs/yellowbrick/releases/tag/v0.1 diff --git a/docs/api/modules.rst b/docs/api/modules.rst index be66dabad..798061270 100644 --- a/docs/api/modules.rst +++ b/docs/api/modules.rst @@ -2,8 +2,8 @@ API Reference ============== .. toctree:: - :maxdepth: 4 + :maxdepth: 4 - yellowbrick - yellowbrick.style - yellowbrick.features + yellowbrick + yellowbrick.style + yellowbrick.features diff --git a/docs/api/yellowbrick.features.rst b/docs/api/yellowbrick.features.rst index 178f92dd0..4dc15c809 100644 --- a/docs/api/yellowbrick.features.rst +++ b/docs/api/yellowbrick.features.rst @@ -1,11 +1,11 @@ yellowbrick.features package -=================== +============================ Submodules ---------- yellowbrick.features.base module ---------------------------- +-------------------------------- .. automodule:: yellowbrick.features.base :members: @@ -13,7 +13,7 @@ yellowbrick.features.base module :show-inheritance: yellowbrick.features.pcoords module ---------------------------- +----------------------------------- .. automodule:: yellowbrick.features.pcoords :members: @@ -21,7 +21,7 @@ yellowbrick.features.pcoords module :show-inheritance: yellowbrick.features.radviz module ---------------------------- +---------------------------------- .. automodule:: yellowbrick.features.radviz :members: @@ -29,7 +29,7 @@ yellowbrick.features.radviz module :show-inheritance: yellowbrick.features.rankd module ---------------------------- +--------------------------------- .. automodule:: yellowbrick.features.rankd :members: diff --git a/docs/api/yellowbrick.rst b/docs/api/yellowbrick.rst index 63fcc2ab7..bbdc9bd2b 100644 --- a/docs/api/yellowbrick.rst +++ b/docs/api/yellowbrick.rst @@ -21,7 +21,7 @@ yellowbrick.base module :show-inheritance: yellowbrick.bestfit module ------------------------ +-------------------------- .. automodule:: yellowbrick.bestfit :members: @@ -60,7 +60,7 @@ yellowbrick.regressor module :members: :undoc-members: :show-inheritance: - + yellowbrick.utils module ------------------------ diff --git a/docs/conf.py b/docs/conf.py index 60f0b8a3b..6180e0c05 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,10 +34,13 @@ # ones. extensions = [ 'sphinx.ext.autodoc', + 'sphinx.ext.autosummary', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', + 'sphinx.ext.todo', + 'numpydoc', ] # Add any paths that contain templates here, relative to this directory. @@ -340,6 +343,10 @@ # # texinfo_no_detailmenu = False +# Autodoc requires numpy to skip class members otherwise we get an exception: +# toctree contains reference to nonexisting document +# See: https://github.com/phn/pytpm/issues/3#issuecomment-12133978 +numpydoc_show_class_members = False # Locations of objects.inv files for intersphinx extension that auto links to external api docs. intersphinx_mapping = {'python': ('https://docs.python.org/3', None), @@ -347,4 +354,4 @@ 'scipy': ('http://scipy.github.io/devdocs/', None), 'numpy': ('https://docs.scipy.org/doc/numpy-dev/', None), 'cycler': ('http://matplotlib.org/cycler/', None), - 'seaborn': ('http://seaborn.pydata.org/index.html', None)} + 'sklearn': ('http://scikit-learn.org/stable/', None)} diff --git a/requirements.txt b/requirements.txt index 6944e79dc..964d7e1c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,6 +25,7 @@ cycler>=0.10.0 ## Documentation (uncomment to build documentation) #Sphinx>=1.4.4 #sphinx-rtd-theme>=0.1.9 +#numpydoc>=0.6.0 ## Documentation Dependencies (installed from above) #alabaster==0.7.9 diff --git a/tests/__init__.py b/tests/__init__.py index 5013fc95e..241a2df75 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -28,7 +28,7 @@ ## Test Constants ########################################################################## -EXPECTED_VERSION = "0.3.1" +EXPECTED_VERSION = "0.3.2" ########################################################################## diff --git a/yellowbrick/classifier.py b/yellowbrick/classifier.py index 3ab940e00..417979b15 100644 --- a/yellowbrick/classifier.py +++ b/yellowbrick/classifier.py @@ -412,32 +412,32 @@ def roc_auc(model, X, y=None, ax=None, **kwargs): class ClassBalance(ClassificationScoreVisualizer): """ Class balance chart that shows the support for each class in the - fitted classification model displayed as a bar plot. - """ - def __init__(self, model, ax=None, classes=None, **kwargs): - """ - Pass in a fitted model to generate a class balance chart. + fitted classification model displayed as a bar plot. It is initialized + with a fitted model and generates a class balance chart on draw. - Parameters - ---------- + Parameters + ---------- - :param ax: the axis to plot the figure on. + ax: axes + the axis to plot the figure on. - :param model: the Scikit-Learn estimator - Should be an instance of a classifier, else the __init__ will - return an error. + model: estimator + Scikit-Learn estimator object. Should be an instance of a classifier, + else ``__init__()`` will raise an exception. - :param classes: a list of class names for the legend - If classes is None and a y value is passed to fit then the classes - are selected from the target vector. + classes: list + A list of class names for the legend. If classes is None and a y value + is passed to fit then the classes are selected from the target vector. - :param kwargs: keyword arguments passed to the super class. Here, used - to colorize the bars in the histogram. + kwargs: dict + Keyword arguments passed to the super class. Here, used + to colorize the bars in the histogram. - These parameters can be influenced later on in the visualization - process, but can and should be set as early as possible. + These parameters can be influenced later on in the visualization + process, but can and should be set as early as possible. + """ + def __init__(self, model, ax=None, classes=None, **kwargs): - """ super(ClassBalance, self).__init__(model, ax=ax, **kwargs) self.colors = color_palette(kwargs.pop('colors', None)) @@ -457,7 +457,7 @@ def fit(self, X, y=None, **kwargs): kwargs: keyword arguments passed to Scikit-Learn API. Returns - ------ + ------- self : instance Returns the instance of the classification score visualizer @@ -481,7 +481,7 @@ def score(self, X, y=None, **kwargs): An array or series of target or class values Returns - ------ + ------- ax : the axis with the plotted figure """ @@ -495,7 +495,7 @@ def draw(self): Renders the class balance chart across the axis. Returns - ------ + ------- ax : the axis with the plotted figure diff --git a/yellowbrick/utils.py b/yellowbrick/utils.py index 04748ff5a..bea7cf504 100644 --- a/yellowbrick/utils.py +++ b/yellowbrick/utils.py @@ -87,8 +87,10 @@ def is_classifier(estimator): estimator: class or instance The object to test whether or not is a Scikit-Learn classifier. - See Also: - https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L526 + See also + -------- + is_classifier + `sklearn.is_classifier() `_ """ # TODO: once we make ScoreVisualizer and ModelVisualizer pass through # wrappers as in Issue #90, these three lines become unnecessary. @@ -113,8 +115,10 @@ def is_regressor(estimator): model: class or instance The object to test whether or not is a Scikit-Learn regressor. - See Also: - https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L531 + See also + -------- + is_regressor + `sklearn.is_regressor() `_ """ # TODO: once we make ScoreVisualizer and ModelVisualizer pass through # wrappers as in Issue #90, these three lines become unnecessary. @@ -161,13 +165,15 @@ def memoized(fget): getter on the first access. The result is stored and on subsequent accesses is returned, preventing the need to call the getter any more. - See Also: - https://github.com/estebistec/python-memoized-property - Parameters ---------- fget: function The getter method to memoize for subsequent access. + + See also + -------- + python-memoized-property + `python-memoized-property `_ """ attr_name = '_{0}'.format(fget.__name__) @@ -189,7 +195,7 @@ class docutil(object): single call wrapper should be identical, this decorator ensures that we only have to edit one doc string. - Usage: + Usage:: @docutil(Visualizer.__init__) def visualize(*args, **kwargs): diff --git a/yellowbrick/version.py b/yellowbrick/version.py index 7c1cbad93..876e75fdc 100644 --- a/yellowbrick/version.py +++ b/yellowbrick/version.py @@ -20,9 +20,9 @@ __version_info__ = { 'major': 0, 'minor': 3, - 'micro': 1, + 'micro': 2, 'releaselevel': 'alpha', - 'serial': 2, + 'serial': 3, } ##########################################################################