stunning, one-line visualizations for scikit-learn
People: Hans Musgrave
# scikit-vis: Scikit-Learn with Visualizations
scikit-vis adds **gorgeous**, **easy-to-use** graphics to the massively popular scikit-learn. I grew tired of writing and maintaining 50+ lines of code for every cool graphic I found in the scikit-learn docs, so I included them in scikit-vis with sensible defaults. I want any machine learning visualization to **only take one line of code.**
## See for yourself how easy it is.
In the following example, we train a mediocre classifier `clf`, and it takes exactly **one** additional line of code to generate a stunning confusion matrix.
We need to have a model before we can plot anything using that model.
from skvis.datasets import load_digits
from skvis.linear_model import RidgeClassifier
from skvis.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(*load_digits(n_class=5, return_X_y=True))
clf = RidgeClassifier().fit(X_train, y_train)
Here is where the magic happens.
![alt-text](https://github.com/quantum-programmer/scikit-vis/blob/master/doc/source/media/confusion_matrix.png?s=200 \"Scikit-learn Digits Confusion Matrix\")
## Who\'s this for?
Anyone who uses scikit-learn. Seriously. Yes, you. The scikit-vis API exposes EVERY function and class from scikit-learn, and it adds powerful, expressive plotting syntax tailored to your machine-learning needs. There is literally nothing to lose.
Installation is a breeze! Just run:
pip install scikit-vis
Or, if you want the latest development version, clone this repo and run
python setup.py install
at the root folder.
If you are using conda, you can install scikit-vis by running:
conda install -c conda-forge scikit-vis
## If scikit-vis can do everything Scikit-learn does, why do I need Scikit-learn installed?
scikit-vis is monkeypatched on top of scikit-learn. At installation, it inspects live versions of scikit-learn and automatically generates necessary source files. At runtime, it loads scikit-learn objects whenever scikit-vis is requested and adds additional functionality to the live objects.
## What now? Is that safe? Is that legal??
Trust me; it\'s better this way. The scikit-learn developers did an excellent job of documenting and maintaining their code so that the same monkeypatching on my end works for every version of their code.
What does that mean for you? I\'m glad you asked. That means you can mix and match versions to your heart\'s content. The machine-learning from scikit-learn is decoupled from the plotting here at scikit-vis, and you can update either one without the other. Better yet, that means fewer bugs since I only have to create and maintain one copy of scikit-vis. That means more time rolling out cutting-edge features for your latest project.
You can download the latest distribution from PyPI here: http://pypi.python.org/pypi/scikit-vis
You can install scikit-vis for yourself from the terminal by running:
pip install --user scikit-vis
If you want to install it for all users on your machine, do:
pip install scikit-vis
On Linux, do sudo pip install scikit-vis
If you don't yet have the pip tool, you can get it following
This package was discovered in PyPI.