Skip to content

Commit

Permalink
Merge branch 'release-v1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Feb 26, 2020
2 parents dd795b4 + 4d6cb3e commit 682b352
Show file tree
Hide file tree
Showing 236 changed files with 3,024 additions and 695 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Yellowbrick

**NOTE: This document is a "getting started" summary for contributing to the Yellowbrick project.** To read the full contributor's guide, please visit the [contributing page](http://www.scikit-yb.org/en/latest/about.html#contributing) in the documentation. Please make sure to read this page carefully to ensure the review process is as smooth as possible and to ensure the greatest likelihood of having your contribution be merged.
**NOTE: This document is a "getting started" summary for contributing to the Yellowbrick project.** To read the full contributor's guide, please visit the [contributing page](http://www.scikit-yb.org/en/latest/contributing/index.html) in the documentation. Please make sure to read this page carefully to ensure the review process is as smooth as possible and to ensure the greatest likelihood of having your contribution be merged.

For more on the development path, goals, and motivations behind Yellowbrick, check out our developer presentation: [Visualizing Model Selection with Scikit-Yellowbrick: An Introduction to Developing Visualizers](http://www.slideshare.net/BenjaminBengfort/visualizing-model-selection-with-scikityellowbrick-an-introduction-to-developing-visualizers).

Expand All @@ -16,11 +16,11 @@ Beyond creating visualizers, there are many ways to contribute:
- Contribute a Jupyter notebook to our examples[ gallery](https://github.com/DistrictDataLabs/yellowbrick/tree/develop/examples).
- Assist us with [user testing](http://www.scikit-yb.org/en/latest/evaluation.html).
- Add to the documentation or help with our website, [scikit-yb.org](http://www.scikit-yb.org).
- Write unit or integration tests for our project.
- Write [unit or integration tests](https://www.scikit-yb.org/en/latest/contributing/developing_visualizers.html#integration-tests) for our project.
- Answer questions on our issues, mailing list, Stack Overflow, and elsewhere.
- Translate our documentation into another language.
- Write a blog post, tweet, or share our project with others.
- Teach someone how to use Yellowbrick.
- [Teach](https://www.scikit-yb.org/en/latest/teaching.html) someone how to use Yellowbrick.

As you can see, there are lots of ways to get involved and we would be very happy for you to join us! The only thing we ask is that you abide by the principles of openness, respect, and consideration of others as described in the [Python Software Foundation Code of Conduct](https://www.python.org/psf/codeofconduct/).

Expand Down Expand Up @@ -250,7 +250,7 @@ $ pytest tests/test_your_visualizer.py

The Makefile uses the pytest runner and testing suite as well as the coverage library, so make sure you have those dependencies installed!

**Note**: Advanced developers can use our _image comparison tests_ to assert that an image generated matches a baseline image. Read more about this in our [testing documentation](http://www.scikit-yb.org/en/latest/contributing.html#testing)
**Note**: Advanced developers can use our _image comparison tests_ to assert that an image generated matches a baseline image. Read more about this in our [testing documentation](https://www.scikit-yb.org/en/latest/contributing/developing_visualizers.html#image-comparison-tests).

### Documentation

Expand Down Expand Up @@ -296,4 +296,4 @@ class MyVisualizer(Visualizer):
"""
```

This is a very good start to producing a high quality visualizer, but unless it is part of the documentation on our website, it will not be visible. For details on including documentation in the `docs` directory see the [Contributing Documentation](http://www.scikit-yb.org/en/latest/contributing.html#documentation) section in the larger contributing guide.
This is a very good start to producing a high quality visualizer, but unless it is part of the documentation on our website, it will not be visible. For details on including documentation in the `docs` directory see the [Contributing Documentation](https://www.scikit-yb.org/en/latest/contributing/index.html) section in the larger contributing guide.
3 changes: 1 addition & 2 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Visualizers are estimators — objects that learn from data — whose pr
- **t-SNE Corpus Visualization**: uses stochastic neighbor embedding to project documents
- **UMAP Corpus Visualization**: plot similar documents closer together to discover clusters

... and more! Yellowbrick is adding new visualizers all the time so be sure to check out our [examples gallary](https://www.scikit-yb.org/en/latest/api/index.html) — or even the [develop](https://github.com/districtdatalabs/yellowbrick/tree/develop) branch — and feel free to contribute your ideas for new Visualizers!
... and more! Yellowbrick is adding new visualizers all the time so be sure to check out our [examples gallery]https://github.com/DistrictDataLabs/yellowbrick/tree/develop/examples) — or even the [develop](https://github.com/districtdatalabs/yellowbrick/tree/develop) branch — and feel free to contribute your ideas for new Visualizers!

## Affiliations
[![District Data Labs](https://github.com/DistrictDataLabs/yellowbrick/raw/develop/docs/images/readme/affiliates_ddl.png)](https://www.districtdatalabs.com/) [![NumFOCUS Affiliated Project](https://github.com/DistrictDataLabs/yellowbrick/raw/develop/docs/images/readme/affiliates_numfocus.png)](https://numfocus.org/)

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 District Data Labs
Copyright 2016-2020 The scikit-yb developers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file describes how the Yellowbrick project is maintained and provides conta

When creating a pull request, your contribution will be reviewed by one or probably two maintainers who will give you the :+1: when your extension is ready to be merged. Maintainers work hard to ensure that Yellowbrick is a high quality project and that contributors are successful.

For more about how to develop visualizers and contribute features to Yellowbrick, see our [contributor's guide](CONTRIBUTING.md) and the documentation.
For more about how to develop visualizers and contribute features to Yellowbrick, see our [contributor's guide](CONTRIBUTING.md) and the [documentation](https://www.scikit-yb.org/en/latest/contributing/index.html).

For everyone who has [contributed](https://github.com/DistrictDataLabs/yellowbrick/graphs/contributors) in big and in small ways, **thank you!**. Yellowbrick is intended to be a community project, welcoming to new and experienced developers alike. If you would like to become a core contributor you must simply submit a pull request that shows core knowledge of the Yellowbrick library. Usually new Visualizers meet this standard; let the maintainers know you'd like to join the team, and they'll help you work toward it!

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,27 @@ visualizer.score(X,y)
visualizer.show()
```

For additional information on getting started with Yellowbrick, view the quickstart guide in the [documentation](https://www.scikit-yb.org/en/latest/) and check out our [examples notebook](https://github.com/DistrictDataLabs/yellowbrick/blob/develop/examples/examples.ipynb).
For additional information on getting started with Yellowbrick, view the [Quick Start Guide](https://www.scikit-yb.org/en/latest/quickstart.html) in the [documentation](https://www.scikit-yb.org/en/latest/) and check out our [examples notebook](https://github.com/DistrictDataLabs/yellowbrick/blob/develop/examples/examples.ipynb).

## Contributing to Yellowbrick

Yellowbrick is an open source project that is supported by a community who will gratefully and humbly accept any contributions you might make to the project. Large or small, any contribution makes a big difference; and if you've never contributed to an open source project before, we hope you will start with Yellowbrick!

If you are interested in contributing, check out our [contributor's guide](https://www.scikit-yb.org/en/latest/contributing.html). Beyond creating visualizers, there are many ways to contribute:
If you are interested in contributing, check out our [contributor's guide](https://www.scikit-yb.org/en/latest/contributing/index.html). Beyond creating visualizers, there are many ways to contribute:

- Submit a bug report or feature request on [GitHub Issues](https://github.com/DistrictDataLabs/yellowbrick/issues).
- Contribute a Jupyter notebook to our examples[ gallery](https://github.com/DistrictDataLabs/yellowbrick/tree/develop/examples).
- Contribute a Jupyter notebook to our examples [gallery](https://github.com/DistrictDataLabs/yellowbrick/tree/develop/examples).
- Assist us with [user testing](https://www.scikit-yb.org/en/latest/evaluation.html).
- Add to the documentation or help with our website, [scikit-yb.org](https://www.scikit-yb.org).
- [Write unit or integration tests](https://www.scikit-yb.org/en/latest/contributing.html#testing) for our project.
- Write [unit or integration tests](https://www.scikit-yb.org/en/latest/contributing/developing_visualizers.html#integration-tests) for our project.
- Answer questions on our issues, mailing list, Stack Overflow, and elsewhere.
- Translate our documentation into another language.
- Write a blog post, tweet, or share our project with others.
- Teach someone how to use Yellowbrick.
- [Teach](https://www.scikit-yb.org/en/latest/teaching.html) someone how to use Yellowbrick.

As you can see, there are lots of ways to get involved and we would be very happy for you to join us! The only thing we ask is that you abide by the principles of openness, respect, and consideration of others as described in the [Python Software Foundation Code of Conduct](https://www.python.org/psf/codeofconduct/).

For more information, checkout the `CONTRIBUTING.md` file in the root of the repository or the detailed documentation at [Contributing to Yellowbrick](https://www.scikit-yb.org/en/latest/contributing.html)
For more information, checkout the `CONTRIBUTING.md` file in the root of the repository or the detailed documentation at [Contributing to Yellowbrick](https://www.scikit-yb.org/en/latest/contributing/index.html)

## Yellowbrick Datasets

Expand Down
34 changes: 33 additions & 1 deletion docs/api/classifier/class_prediction_error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ The Yellowbrick ``ClassPredictionError`` plot is a twist on other and sometimes

The class prediction error chart provides a way to quickly understand how good your classifier is at predicting the right classes.

================= ==============================
Visualizer :class:`~yellowbrick.classifier.class_prediction_error.ClassPredictionError`
Quick Method :func:`~yellowbrick.classifier.class_prediction_error.class_prediction_error`
Models Classification
Workflow Model evaluation
================= ==============================

.. plot::
:context: close-figs
:alt: Class Prediction Error plot on Fruit
Expand Down Expand Up @@ -77,12 +84,37 @@ By contrast, in the following example, the ``RandomForestClassifier`` does a gre
# Draw visualization
visualizer.show()

Quick Method
------------

Similar functionality as above can be achieved in one line using the associated quick method, ``class_prediction_error``. This method will instantiate and fit a ``ClassPredictionError`` visualizer on the training data, then will score it on the optionally provided test data (or the training data if it is not provided).

.. plot::
:context: close-figs
:alt: class_prediction_error quick method

from sklearn.svm import LinearSVC
from sklearn.model_selection import train_test_split as tts
from yellowbrick.classifier import class_prediction_error
from yellowbrick.datasets import load_occupancy

# Load the dataset and split into train/test splits
X, y = load_occupancy()
X_train, X_test, y_train, y_test = tts(
X, y, test_size=0.2, shuffle=True
)

class_prediction_error(
LinearSVC(random_state=42),
X_train, y_train, X_test, y_test,
classes=["vacant", "occupied"]
)


API Reference
-------------

.. automodule:: yellowbrick.classifier.class_prediction_error
:members: ClassPredictionError
:members: ClassPredictionError, class_prediction_error
:undoc-members:
:show-inheritance:
43 changes: 42 additions & 1 deletion docs/api/classifier/classification_report.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Classification Report

The classification report visualizer displays the precision, recall, F1, and support scores for the model. In order to support easier interpretation and problem detection, the report integrates numerical scores with a color-coded heatmap. All heatmaps are in the range ``(0.0, 1.0)`` to facilitate easy comparison of classification models across different classification reports.

================= =================
Visualizer :class:`~yellowbrick.classifier.classification_report.ClassificationReport`
Quick Method :func:`~yellowbrick.classifier.classification_report.classification_report`
Models Classification
Workflow Model evaluation
================= =================

.. plot::
:context: close-figs
:alt: Classification Report
Expand Down Expand Up @@ -55,10 +62,44 @@ The metrics are defined in terms of true and false positives, and true and false

.. note:: This example uses ``TimeSeriesSplit`` to split the data into the training and test sets. For more information on this cross-validation method, please refer to the scikit-learn `documentation <https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.TimeSeriesSplit.html>`_.

Quick Method
------------
The same functionality above can be achieved with the associated quick method ``classification_report``. This method
will build the ``ClassificationReport`` object with the associated arguments, fit it, then (optionally) immediately
show it.

.. plot::
:context: close-figs
:alt: classification_report on the occupancy dataset

from sklearn.model_selection import TimeSeriesSplit
from sklearn.naive_bayes import GaussianNB

from yellowbrick.datasets import load_occupancy
from yellowbrick.classifier import classification_report

# Load the classification data set
X, y = load_occupancy()

# Specify the target classes
classes = ["unoccupied", "occupied"]

# Create the training and test data
tscv = TimeSeriesSplit()
for train_index, test_index in tscv.split(X):
X_train, X_test = X.iloc[train_index], X.iloc[test_index]
y_train, y_test = y.iloc[train_index], y.iloc[test_index]

# Instantiate the visualizer
visualizer = classification_report(
GaussianNB(), X_train, y_train, X_test, y_test, classes=classes, support=True
)


API Reference
-------------

.. automodule:: yellowbrick.classifier.classification_report
:members: ClassificationReport
:members: ClassificationReport, classification_report
:undoc-members:
:show-inheritance:
38 changes: 37 additions & 1 deletion docs/api/classifier/confusion_matrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ Below are a few examples of using the ``ConfusionMatrix`` visualizer; more
information can be found by looking at the
scikit-learn documentation on `confusion matrices <http://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html>`_.

================= =================
Visualizer :class:`~yellowbrick.classifier.confusion_matrix.ConfusionMatrix`
Quick Method :func:`~yellowbrick.classifier.confusion_matrix.confusion_matrix`
Models Classification
Workflow Model evaluation
================= =================


.. plot::
:context: close-figs
:alt: ConfusionMatrix plot of sklearn Digits dataset
Expand Down Expand Up @@ -83,11 +91,39 @@ Class names can be added to a ``ConfusionMatrix`` plot using the ``label_encoder

iris_cm.show()

Quick Method
------------

The same functionality above can be achieved with the associated quick method ``confusion_matrix``. This method will build the ``ConfusionMatrix`` object with the associated arguments, fit it, then (optionally) immediately show it. In the below example we can see how a ``LogisticRegression`` struggles to effectively model the credit dataset (hint: check out :class:`~yellowbrick.features.rankd.Rank2D` to examine for multicollinearity!).

.. plot::
:context: close-figs
:alt: confusion_matrix on the credit dataset

from yellowbrick.datasets import load_credit
from yellowbrick.classifier import confusion_matrix
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split as tts

#Load the classification dataset
X, y = load_credit()

#Create the train and test data
X_train, X_test, y_train, y_test = tts(X, y, test_size=0.2)

# Instantiate the visualizer with the classification model
confusion_matrix(
LogisticRegression(),
X_train, y_train, X_test, y_test,
classes=['not_defaulted', 'defaulted']
)
plt.tight_layout()


API Reference
-------------

.. automodule:: yellowbrick.classifier.confusion_matrix
:members: ConfusionMatrix
:members: ConfusionMatrix, confusion_matrix
:undoc-members:
:show-inheritance:
34 changes: 33 additions & 1 deletion docs/api/classifier/prcurve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ under the curve represents both high recall and precision, the best case
scenario for a classifier, showing a model that returns accurate results
for the majority of classes it selects.

================= ==============================
Visualizer :class:`~yellowbrick.classifier.prcurve.PrecisionRecallCurve`
Quick Method :func:`~yellowbrick.classifier.prcurve.precision_recall_curve`
Models Classification
Workflow Model evaluation
================= ==============================


Binary Classification
---------------------

Expand Down Expand Up @@ -98,10 +106,34 @@ A more complex Precision-Recall curve can be computed, however, displaying the e

.. seealso:: `Scikit-Learn: Model Selection with Precision Recall Curves <http://scikit-learn.org/stable/auto_examples/model_selection/plot_precision_recall.html>`_


Quick Method
------------

Similar functionality as above can be achieved in one line using the associated quick method, ``precision_recall_curve``. This method will instantiate and fit a ``PrecisionRecallCurve`` visualizer on the training data, then will score it on the optionally provided test data (or the training data if it is not provided).

.. plot::
:context: close-figs
:alt: precision_recall_curve quick method with binary classification

from sklearn.naive_bayes import BernoulliNB
from sklearn.model_selection import train_test_split as tts
from yellowbrick.classifier import precision_recall_curve
from yellowbrick.datasets import load_spam

# Load the dataset and split into train/test splits
X, y = load_spam()

X_train, X_test, y_train, y_test = tts(X, y, test_size=0.2, shuffle=True)

# Create the visualizer, fit, score, and show it
viz = precision_recall_curve(BernoulliNB(), X_train, y_train, X_test, y_test)


API Reference
-------------

.. automodule:: yellowbrick.classifier.prcurve
:members: PrecisionRecallCurve
:members: PrecisionRecallCurve, precision_recall_curve
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 682b352

Please sign in to comment.