Skip to main content

stunning, one-line visualizations for scikit-learn

Project description

# 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.
clf.plot_confusion_matrix(X_test, y_test)

![alt-text]( "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
Installation is a breeze! Just run:
pip install scikit-vis
Or, if you want the latest development version, clone this repo and run
python 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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for scikit-vis, version 0.1.0.dev1
Filename, size File type Python version Upload date Hashes
Filename, size scikit-vis-0.1.0.dev1.tar.gz (14.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page