|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Bokeh||17,393||2,936||617||18 hours ago||136||July 05, 2022||701||bsd-3-clause||Python|
|Interactive Data Visualization in the browser, from Python|
|Scientific Visualization Book||9,131||8 days ago||17||other||Python|
|An open access book on scientific visualization using python and matplotlib|
|📈 A small, fast chart for time series, lines, areas, ohlc & bars|
|Clip||5,132||17||4||3 years ago||32||June 25, 2013||1||apache-2.0||C++|
|Create charts from the command line|
|Plotnine||3,394||127||88||4 days ago||12||July 01, 2022||79||mit||Python|
|A grammar of graphics for Python|
|Chartify||3,302||5||21 hours ago||16||November 02, 2020||46||apache-2.0||Python|
|Python library that makes it easy for data scientists to create charts.|
|Implot||3,043||5 days ago||66||mit||C++|
|Immediate Mode Plotting|
|Scottplot||2,992||3||15||2 days ago||121||September 09, 2022||63||mit||C#|
|Interactive plotting library for .NET|
|Quantstats||2,832||11||a month ago||59||July 05, 2022||129||apache-2.0||Python|
|Portfolio analytics for quants, written in Python|
|Plotters||2,754||5||108||a month ago||36||September 08, 2022||76||mit||Rust|
|A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀|
Scikit-plot is the result of an unartistic data scientist's dreadful realization that visualization is one of the most crucial components in the data science process, not just a mere afterthought.
Gaining insights is simply a lot easier when you're looking at a colored heatmap of a confusion matrix complete with class labels rather than a single-line dump of numbers enclosed in brackets. Besides, if you ever need to present your results to someone (virtually any time anybody hires you to do data science), you show them visualizations, not a bunch of numbers in Excel.
That said, there are a number of visualizations that frequently pop up in machine learning. Scikit-plot is a humble attempt to provide aesthetically-challenged programmers (such as myself) the opportunity to generate quick and beautiful graphs and plots with as little boilerplate as possible.
Say we use Naive Bayes in multi-class classification and decide we want to visualize the results of a common classification metric, the Area under the Receiver Operating Characteristic curve. Since the ROC is only valid in binary classification, we want to show the respective ROC of each class if it were the positive class. As an added bonus, let's show the micro-averaged and macro-averaged curve in the plot as well.
Let's use scikit-plot with the sample digits dataset from scikit-learn.
# The usual train-test split mumbo-jumbo from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split from sklearn.naive_bayes import GaussianNB X, y = load_digits(return_X_y=True) X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33) nb = GaussianNB() nb.fit(X_train, y_train) predicted_probas = nb.predict_proba(X_test) # The magic happens here import matplotlib.pyplot as plt import scikitplot as skplt skplt.metrics.plot_roc(y_test, predicted_probas) plt.show()
And... That's it. Encaptured in that small example is the entire philosophy of Scikit-plot: single line functions for detailed visualization. You simply browse the plots available in the documentation, and call the function with the necessary arguments. Scikit-plot tries to stay out of your way as much as possible. No unnecessary bells and whistles. And when you do need the bells and whistles, each function offers a myriad of parameters for customizing various elements in your plots.
Finally, compare and view the non-scikit-plot way of plotting the multi-class ROC curve. Which one would you rather do?
Although Scikit-plot is loosely based around the scikit-learn interface, you don't actually need Scikit-learn objects to use the available functions. As long as you provide the functions what they're asking for, they'll happily draw the plots for you.
Here's a quick example to generate the precision-recall curves of a Keras classifier on a sample dataset.
# Import what's needed for the Functions API import matplotlib.pyplot as plt import scikitplot as skplt # This is a Keras classifier. We'll generate probabilities on the test set. keras_clf.fit(X_train, y_train, batch_size=64, nb_epoch=10, verbose=2) probas = keras_clf.predict_proba(X_test, batch_size=64) # Now plot. skplt.metrics.plot_precision_recall_curve(y_test, probas) plt.show()
You can see clearly here that
skplt.metrics.plot_precision_recall_curve needs only the ground truth y-values and the predicted probabilities to generate the plot. This lets you use anything you want as the classifier, from Keras NNs to NLTK Naive Bayes to that groundbreaking classifier algorithm you just wrote.
The possibilities are endless.
Installation is simple! First, make sure you have the dependencies Scikit-learn and Matplotlib installed.
Then just run:
pip install scikit-plot
Or if you want the latest development version, clone this repo and run
python setup.py install
at the root folder.
If using conda, you can install Scikit-plot by running:
conda install -c conda-forge scikit-plot
Explore the full features of Scikit-plot.
You can find detailed documentation here.
Examples are found in the examples folder of this repo.
Reporting a bug? Suggesting a feature? Want to add your own plot to the library? Visit our contributor guidelines.
Are you using Scikit-plot in an academic paper? You should be! Reviewers love eye candy.
If so, please consider citing Scikit-plot with DOI
Reiichiro Nakano. (2018). reiinakano/scikit-plot: 0.3.7 [Data set]. Zenodo. http://doi.org/10.5281/zenodo.293191
Reiichiro Nakano, “reiinakano/scikit-plot: 0.3.7”. Zenodo, 19-Feb-2017.
Reiichiro Nakano 2018. reiinakano/scikit-plot: 0.3.7. Zenodo.