About Anaconda Help Download Anaconda

Installers

pip install

To install this package run one of the following:
pip install -i https://pypi.anaconda.org/scikit-plots-wheels-staging-nightly/simple scikit-plots

Description

Welcome to Scikit-plots 101

Single line functions for detailed visualizations

The quickest and easiest way to go from analysis...

๐Ÿ“˜ Documentation, Examples and Try|Install Scikit-plots

Explore the full features of Scikit-plots: https://scikit-plots.github.io/dev/devel/index.html

๐Ÿ› User Installation:

๐Ÿ“ฆ From PIP Installation by pypi , pypi.anaconda.org or GITHUB

The easiest way to set up scikit-plots is to install it using pip with the following command:

๐Ÿง  Gotchas:

  • โš ๏ธ (Recommended): Use a Virtual Environmentt (like venv pipenv ) to Avoid Conflicts.
  • ๐Ÿšซ Don't use conda base โ€” it's prone to conflicts.
  • โœ… This avoids dependency issues and keeps your system stable.
# (conda or mamba) Create New Env and install ``scikit-plots``
# Create a new environment and install Python 3.11 with IPython kernel support
mamba create -n py311 python=3.11 ipykernel -y
# Activate the environment
conda activate py311

# Now Install scikit-plots (via pip, conda, or local source)
pip install scikit-plots

## (Optionally) Install the lost packages "Runtime dependencies"
## https://github.com/celik-muhammed/scikit-plots/tree/main/requirements
## wget https://raw.githubusercontent.com/scikit-plots/scikit-plots/main/requirements/default.txt
curl -O https://raw.githubusercontent.com/scikit-plots/scikit-plots/main/requirements/default.txt
pip install -r default.txt
## Try After Ensure all "Runtime dependencies" installed
pip install -U -i https://pypi.anaconda.org/scikit-plots-wheels-staging-nightly/simple scikit-plots

  • By GITHUB: @<branch> , @<tag> or Source Code Archive URLs to specify a version

## pip install git+https://github.com/scikit-plots/scikit-plots.git@<branches>
## Latest in Development
pip install git+https://github.com/scikit-plots/scikit-plots.git@main
##
## (Added C, Cpp, Fortran Support) Works with standard Python (CPython)
pip install git+https://github.com/scikit-plots/scikit-plots.git@maintenance/0.4.x
##
## (Works with PyPy interpreter) Works with standard Python (CPython)
pip install git+https://github.com/scikit-plots/scikit-plots.git@maintenance/0.3.x
pip install git+https://github.com/scikit-plots/scikit-plots.git@maintenance/0.3.7

## pip install git+https://github.com/scikit-plots/scikit-plots.git@<tags>
pip install git+https://github.com/scikit-plots/[email protected]
pip install git+https://github.com/scikit-plots/[email protected]
pip install git+https://github.com/scikit-plots/[email protected]

๐Ÿ“ From Source Installation by Archive or GIT Clone

๐Ÿ Pitfalls:

  • ๐Ÿ’ก You can download GitHub Source Code Archives (.zip or .tar.gz) by specifying a branch, tag, or a specific commit ID.
  • ๐Ÿ› ๏ธ After unzipping the GitHub Source Code Archive (similar to cloning), remember require to run git submodule update to initialize submodules.
  • ๐Ÿ”„ Alternatively, you can install scikit-plots directly from the GitHub Source Code Repository to access the latest updates.
  • โ†”๏ธ Alternatively, Source Distribution (.tar.gz) are also available for direct installation via PyPI (sdist), if applicable.

## pip install package  Installs wheel (.whl) if available, else source
## pip install --no-binary=package package  # Forces source installation only the specified package
pip install --no-binary=scikit-plots scikit-plots
## pip install --no-binary=:all: package  # Forces source installation for Package + all dependencies
## This forces scikit-plots and all its dependencies to be installed from source (from .tar.gz).
pip install --no-binary=:all: scikit-plots

Source code archives are available at specific URLs for each repository. For example, consider the repository scikit-plots/scikit-plots .

## Forked repo: https://github.com/scikit-plots/scikit-plots.git
git clone https://github.com/YOUR-USER-NAME/scikit-plots.git
cd scikit-plots
## (Optionally) Add safe directories for git
# bash docker/script/safe_dirs.sh
git config --global --add safe.directory '*'
## download submodules
git submodule update --init
# pip install -r ./requirements/all.txt
pip install -r ./requirements/build.txt
## Install development version
pip install --no-cache-dir -e . -v

๐ŸงŠ๐Ÿ”ง It is also possible to include optional dependencies:

## https://github.com/celik-muhammed/scikit-plots/tree/main/requirements
## (Optionally) Try Development [build,dev,test,doc]
## For More in Doc: https://scikit-plots.github.io/
python -m pip install --no-cache-dir --no-build-isolation -e .[build,dev,test,doc] -v
## https://github.com/celik-muhammed/scikit-plots/tree/main/requirements
## [cpu] refer tensorflow-cpu, transformers, tf-keras
## [gpu] refer Cupy tensorflow lib require NVIDIA CUDA support
pip install "scikit-plots[cpu]"

Sample Plots

plot_feature_importances.png plot_classifier_eval.png plot_classifier_eval.png
plot_roc.png plot_precision_recall.png
plot_pca_component_variance.png plot_pca_2d_projection.png
plot_elbow.png plot_silhouette.png
plot_cumulative_gain.png plot_lift.png
plot_learning_curve.png plot_calibration_curve.png

Scikit-plots 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-plots 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.

Okay then, prove it. Show us an example.

Say we use Keras Classifier in multi-class classification and decide we want to visualize the results of a common classification metric, such as sklearn's classification report with a confusion matrix.

Letโ€™s start with a basic example where we use a Keras classifier to evaluate the digits dataset provided by Scikit-learn.

# Before tf {'0':'All', '1':'Warnings+', '2':'Errors+', '3':'Fatal Only'} if any
import os; os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# Disable GPU and force TensorFlow to use CPU
import os; os.environ['CUDA_VISIBLE_DEVICES'] = ''
import tensorflow as tf
# Set TensorFlow's logging level to Fatal
import logging; tf.get_logger().setLevel(logging.CRITICAL)
import numpy as np
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split

# Loading the dataset
X, y = load_digits(
  return_X_y=True,
)
# Split the dataset into training and validation sets
X_train, X_val, y_train, y_val = train_test_split(
  X, y, test_size=0.33, random_state=0
)
# Convert labels to one-hot encoding
Y_train = tf.keras.utils.to_categorical(y_train)
Y_val = tf.keras.utils.to_categorical(y_val)
# Define a simple TensorFlow model
tf.keras.backend.clear_session()
model = tf.keras.Sequential([
    # tf.keras.layers.Input(shape=(X_train.shape[1],)),  # Input (Functional API)
    tf.keras.layers.InputLayer(shape=(X_train.shape[1],)),
    tf.keras.layers.Dense(64, activation='relu'),
    tf.keras.layers.Dense(64, activation='relu'),
    tf.keras.layers.Dense(10, activation='softmax')
])
# Compile the model
model.compile(
  optimizer='adam',
  loss='categorical_crossentropy',
  metrics=['accuracy'],
)
# Train the model
model.fit(
    X_train, Y_train,
    batch_size=32,
    epochs=2,
    validation_data=(X_val, Y_val),
    verbose=0
)
# Predict probabilities on the validation set
y_probas = model.predict(X_val)
# Plot the data
import matplotlib.pyplot as plt
import scikitplot as sp
# sp.get_logger().setLevel(sp.sp_logging.WARNING)
sp.logger.setLevel(sp.logger.INFO)  # default WARNING
# Plot precision-recall curves
sp.metrics.plot_precision_recall(
  y_val, y_probas,
)
quick_start

Pretty.

Maximum flexibility. Compatibility with non-scikit-learn objects.

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.

The possibilities are endless.

Release Notes

See the changelog for a history of notable changes to scikit-plots.

Contributing to Scikit-plots

Reporting a bug? Suggesting a feature? Want to add your own plot to the library? Visit our.

The Scikit-plots Project is made both by and for its users, so we welcome and encourage contributions of many kinds. Our goal is to keep this a positive, inclusive, successful, and growing community that abides by the Scikit-plots Community Code of Conduct.

For guidance on contributing to or submitting feedback for the Scikit-plots Project, see the contributions page. For contributing code specifically, the developer docs have a guide with a quickstart. There's also a summary of contribution guidelines.

Developing with Codespaces

GitHub Codespaces is a cloud development environment using Visual Studio Code in your browser. This is a convenient way to start developing Scikit-plots, using our dev container configured with the required packages. For help, see the GitHub Codespaces docs.

Acknowledging (Governance) and Citing Scikit-plots

See the Acknowledgement, Citation Guide and the CITATION.bib, CITATION.cff file.

  1. scikit-plots, โ€œscikit-plots: vlatestโ€. Zenodo, Aug. 23, 2024. DOI: 10.5281/zenodo.13367000.

  2. scikit-plots, โ€œscikit-plots: v0.3.8dev0โ€. Zenodo, Aug. 23, 2024. DOI: 10.5281/zenodo.13367001.

Supporting the Project (Upcoming)

Powered by NumFOCUS Donate

NumFOCUS, a 501(c)(3) nonprofit in the United States.

License

Scikit-plots is licensed under a 3-clause BSD style license - see the LICENSE file, and LICENSES files.


© 2025 Anaconda, Inc. All Rights Reserved. (v4.2.0) Legal | Privacy Policy