Scikit-plots APIs
0.5.dev0+git.20260216.503625b - February 16, 2026 17:01 UTC

APIs Reference#

This is the class and function reference of scikit-plots. Please refer to the full user guide for further details, as the raw specifications of classes and functions may not be enough to give full guidelines on their uses. For reference on concepts repeated across the APIs, see scikit-plots Glossary.

Object

Description

__version__

str(object=’’) -> str

__version_iso_8601__

str(object=’’) -> str

online_help

Open the online documentation search page.

config_context

Context manager for global scikit-plots configuration.

get_config

Retrieve current values for configuration set by set_config.

set_config

Set global scikit-plots configuration.

show_config

Show libraries and system information on which SciPy was built

show_versions

Print or return debugging information about the system, Python, dependencies, and hardware.

get_logger

Return SP (scikitplot) logger instance.

logger

logging (alias, logger) module provide unified both Python logging and logging.Logger utilities.

Index

Annoy Approximate Nearest Neighbors Index.

scikitplot.annoy._annoy

Annoy

Compiled with GCC/Clang. Using 512-bit AVX instructions.

AnnoyIndex

Compiled with GCC/Clang. Using 512-bit AVX instructions.

Index

High-level ANNoy index composed from mixins.

CompressMode

Compression used for "byte" pickling by PickleMixin.

IndexIOMixin

Mixin adding explicit Annoy-native persistence helpers.

MetaMixin

Mixin that exports and restores index metadata.

NDArrayMixin

NumPy / SciPy / pandas interoperability for Annoy-like indexes.

PickleMixin

Mixin adding pickle support.

PickleMode

Persistence strategy used by PickleMixin.

PlottingMixin

Mixin that adds convenient plotting methods to high-level Annoy wrappers.

VectorOpsMixin

User-facing neighbor queries for Annoy-like backends.

plot_pca_2d_projection

Plots the 2-dimensional projection of PCA on a given dataset.

plot_pca_component_variance

Plots PCA components’ explained variance ratios. (new in v0.2.2)

plot_feature_importances

Generate a plot of a sklearn model’s feature importances.

plot_learning_curve

Generates a plot of the train and test learning curves for a classifier.

plot_elbow

Plot the elbow curve for different values of K in KMeans clustering.

plot_residuals_distribution

Plot residuals and fit various distributions to assess their goodness of fit.

plot_classifier_eval

Generates various evaluation plots for a classifier, including confusion matrix,

plot_confusion_matrix

Generates a confusion matrix plot from predictions and true labels.

plot_precision_recall

Generates the Precision-Recall AUC Curves from labels and predicted scores/probabilities.

plot_roc

Generates the ROC AUC curves from labels and predicted scores/probabilities.

plot_calibration

Plot calibration curves for a set of classifier probability estimates.

plot_silhouette

Plots silhouette analysis of clusters provided.

validate_labels

Validates the labels passed into arguments such as true_labels or pred_labels

scikitplot.api._utils

cumulative_gain_curve

Generate the data points necessary to plot the Cumulative Gain curve for binary classification tasks.

scikitplot.api._utils

binary_ks_curve

Generate the data points necessary to plot the Kolmogorov-Smirnov (KS)

scikitplot.api._utils

validate_plotting_kwargs

Validate the provided axes and figure or create new ones if needed.

scikitplot.api._utils

expit

Compute the sigmoid (expit) of a scalar input.

log_expit

Compute the natural logarithm of the sigmoid (expit) of a scalar input.

logit

Compute the logit (inverse sigmoid) of a scalar input.

py_print

py_print(message: str = ‘Hello, from Pybind11 C++!’) -> None

sigmoid

Compute the sigmoid function for the input array x.

softmax

Compute the softmax function.

logsumexp

Compute the log of the sum of exponentials of input elements.

log_softmax

Compute the logarithm of the softmax function.

_annoy

High-level Python interface for the C++ ANNoy backend.

annoylib

Compiled with GCC/Clang. Using 512-bit AVX instructions.

Annoy

Compiled with GCC/Clang. Using 512-bit AVX instructions.

AnnoyIndex

Compiled with GCC/Clang. Using 512-bit AVX instructions.

_astropy

Astropy is a package intended to contain core functionality and some

stats

This subpackage contains statistical tools provided for or used by Astropy.

_f2py

Fortran to Python Interface Generator.

get_include

Return the directory that contains the fortranobject.c and .h files.

_numcpp

__bibtex__

str(object=’’) -> str

__citation__

str(object=’’) -> str

compile_and_load

Compile and import a Cython extension module and return the loaded module.

compile_and_load_result

Compile and import a Cython extension module from source text.

cython_import

Compile/import a Cython module from a .pyx file and return the loaded module.

cython_import_result

Compile/import a Cython module from a .pyx file.

cython_import_all

Compile and import all .pyx files in a directory.

build_package_from_code

Build and import a multi-module extension package and return loaded modules.

build_package_from_code_result

Build and import a multi-module extension package from code strings.

build_package_from_paths

Build and import a multi-module extension package and return loaded modules.

build_package_from_paths_result

Build and import a multi-module extension package from .pyx file paths.

import_cached

Import a cached module entry and return the loaded module.

import_cached_result

Import a cached module entry by cache key.

import_cached_by_name

Import the newest cached module entry matching module_name.

import_cached_package

Import a cached package and return the loaded modules.

import_cached_package_result

Import a cached package entry by cache key.

register_cached_artifact_path

Register an existing compiled extension artifact on disk, then import it.

register_cached_artifact_bytes

Register a compiled extension artifact from bytes and import it.

import_artifact_path

Import a compiled extension artifact from a path.

import_artifact_bytes

Import a compiled extension artifact from raw bytes.

export_cached

Export a cache entry directory to a destination folder.

get_cache_dir

Resolve (and create) the cache root directory.

list_cached

List cached module entries.

list_cached_packages

List cached package entries.

cache_stats

Return cache statistics for the given cache root.

gc_cache

Garbage-collect cached builds deterministically.

purge_cache

Delete the entire cache directory.

pin

Pin a cache key under a human-friendly alias.

unpin

Remove a pinned alias.

list_pins

List alias→key mappings in the pin registry.

import_pinned

Import a pinned alias and return the loaded module(s).

import_pinned_result

Import a pinned alias.

check_build_prereqs

Check whether build prerequisites are importable.

BuildResult

Result of compiling/importing a single Cython extension module.

PackageBuildResult

Result of compiling/importing a package of extension modules.

CacheStats

Cache statistics for the compiled-artifact cache root.

CacheGCResult

Result of a cache garbage-collection operation.

CacheEntry

A compiled module cache entry.

PackageCacheEntry

A compiled package cache entry (multi-module build).

TemplateInfo

Structured metadata for a template.

template_root

Return the on-disk template root directory.

list_templates

List available templates.

get_template_path

Resolve a template ID to an on-disk path.

read_template

Read template source text.

read_template_info

Read metadata for a template and return a TemplateInfo.

load_template_metadata

Load template metadata from an adjacent *.meta.json file.

compile_template

Compile and import a Cython template and return the loaded module.

compile_template_result

Compile and import a Cython template and return a structured result.

list_package_examples

List available multi-module package examples.

get_package_example_path

Resolve a package example name to its on-disk folder path.

load_package_example_metadata

Load package example metadata from package.meta.json.

build_package_example_result

Build and import a multi-module package example and return a structured result.

build_package_example

Build and import a multi-module package example and return loaded modules.

list_workflows

List available workflow template folders.

get_workflow_path

Resolve a workflow name to its on-disk folder path.

workflow_cli_template_path

Return the workflow CLI template path.

copy_workflow

Copy a workflow template folder to a destination directory.

generate_sphinx_template_docs

Generate Sphinx .rst pages listing templates and their usage.

get_data_home

Return a path to the cache directory for example datasets.

get_dataset_names

Report available example datasets, useful for reporting issues.

load_dataset

Load an example dataset from the online repository (requires internet).

print_labels

Display a legend for the abbreviations of decile table column names.

decile_table

Generate the Decile Table from labels and probabilities.

plot_cumulative_gain

Generate the Decile-wise Lift Plot from labels and probabilities.

plot_lift

Generate the Decile based cumulative Lift Plot from labels and probabilities.

plot_lift_decile_wise

Generate the Decile-wise Lift Plot from labels and probabilities.

plot_ks_statistic

Generate the KS Statistic Plot from labels and probabilities.

report

Generate a decile table and four plots.

ModelPlotPy

ModelPlotPy decile analysis.

ModelPlotPy

Decile/ntile analysis for sklearn classifiers.

plot_response

Plot response curve.

plot_cumresponse

Plot cumulative response curve.

plot_cumlift

Plot cumulative lift curve.

plot_cumgains

Plot cumulative gains curve.

plot_all

Plot response, cumulative response, cumulative lift, and cumulative gains as a 2x2 panel.

plot_costsrevs

Plot costs and revenues curves.

plot_profit

Plot profit curve.

plot_roi

Plot ROI (return on investment) curve.

ModuleDeprecationWarning

Module deprecation warning.

ScikitplotException

Generic exception thrown to surface failure information about external-facing operations.

VisibleDeprecationWarning

Visible deprecation warning.

enable_ann_imputer

Enables ANNImputer

pipeline

ENVELOPES

Mapping of envelope types to amplitude-modulation functions.

compose_as_waveform

Generate a concatenated waveform from a musical composition input.

play_waveform

Play audio from a NumPy array using either IPython (for Jupyter) or sounddevice.

plot_waveform

Plot the waveform of mono or multi-channel audio data.

save_waveform

Save waveform to an audio file using specified or auto-selected backend.

save_waveform_as_mp3

Save waveform as an MP3 file using pydub and ffmpeg, with support for mono or stereo.

sheet_to_note

Convert input sheet (str/list/dict) to a list of (note, octave, duration).

sheet_converter

Display parsed notes or note frequencies from a musical sheet.

serialize_sheet

Serialize sheet notes to JSON or YAML string.

export_sheet

Enable serialization of compositions or note sheets.

LLM_PROVIDER_CONFIG_MAP

LLM_PROVIDER_ENV_CONNECTOR_MAP

get_response

Get response from LLM provider.

load_mlflow_gateway_config

Load MLflow Gateway model configuration from a YAML file.

array_api_compat

NumPy Array API compatibility library

array_api_extra

Extra array functions built on top of the array API standard.

ProbScale

A probability scale for matplotlib Axes.

probplot

Probability, percentile, and quantile plots.

plot_pos

Compute the plotting positions for a dataset. Heavily borrows from

fit_line

Fits a line to x-y data in various forms (linear, log, prob scales).

_seaborn

_sphinxext

figmpl_directive

Add a figure-mpl directive that is a responsive version of figure.

mathmpl

A role and directive to display mathtext in Sphinx.

plot_directive

A directive for including a Matplotlib plot in a Sphinx document.

roles

Custom roles for the Matplotlib documentation.

sphinx_tabs_patch

Sphinx compatibility shim for docutils backrefs.

_tweedie

Tweedie Distribution Module.

tweedie

An instance of tweedie_gen, providing Tweedie distribution functionality.

tweedie_gen

A Tweedie continuous random variable inherited scipy.stats.rv_continuous.

ANNImputer

Approximate K-nearest-neighbours (KNN) imputer with pluggable ANN backends.

CRITICAL

int([x]) -> integer

DEBUG

int([x]) -> integer

ERROR

int([x]) -> integer

FATAL

int([x]) -> integer

INFO

int([x]) -> integer

NOTSET

int([x]) -> integer

WARN

int([x]) -> integer

WARNING

int([x]) -> integer

AlwaysStdErrHandler

A custom logging handler inherited from StreamHandler.

GoogleLogFormatter

A custom logging formatter inherited from Formatter.

getEffectiveLevel

Return the effective level for the scikit-plots logger.

get_logger

Return SP (scikitplot) logger instance.

get_verbosity

Return the current verbosity level.

setLevel

Set the logger’s level.

set_verbosity

Set the verbosity level.

log

Log a message at the specified log level.

log_every_n

Log once per n calls from the same call site.

log_first_n

Log only for the first n calls from the same call site.

log_if

Log only if a condition is True.

vlog

Log a message at the specified log level.

debug

Log a message at the DEBUG log level.

info

Log a message at the INFO log level.

warning

Log a message at the WARNING log level.

warn

Log a message at the WARN -> WARNING log level.

error

Log a message at the ERROR log level.

error_log

Log an error-like message at a specified level.

exception

Log a message with severity ‘ERROR’ on the root logger.

TaskLevelStatusMessage

Compatibility wrapper for legacy call sites.

critical

Log a message at the CRITICAL log level.

fatal

Log a message at the FATAL -> CRITICAL log level.

MemoryMap

Memory-mapped region with automatic resource management.

mmap_region

mmap_region(int size: int, int prot: int = PROT_READ | PROT_WRITE, int flags: int = MAP_PRIVATE | MAP_ANONYMOUS, int fd: int = -1, int offset: int = 0) -> MemoryMap

MlflowHandle

A handle that proxies the upstream mlflow module while adding session context.

session

Create a strict, context-managed MLflow session.

session_from_file

Create an MLflow session using a shared project config file (TOML or YAML).

session_from_toml

Create an MLflow session using a shared project TOML config.

DEFAULT_PROJECT_MARKERS

Built-in immutable sequence.

find_project_root

Find a project root directory deterministically.

load_project_config

Load project MLflow config from TOML or YAML based on file extension.

load_project_config_toml

Load project MLflow config from a TOML file.

dump_project_config_yaml

Write a ProjectConfig to a YAML file.

ServerConfig

Configuration that maps directly to mlflow server CLI flags.

SessionConfig

Session-level configuration for scikitplot.mlflow.session.

ProjectConfig

Project-level configuration for MLflow usage across multiple scripts.

MlflowIntegrationError

Base exception for scikitplot.mlflow errors.

MlflowNotInstalledError

Raised when MLflow is required but not installed.

MlflowCliIncompatibleError

Raised when a requested mlflow server option is not supported by the installed MLflow.

MlflowServerStartError

Raised when the managed MLflow server fails to start or exits prematurely.

workflow

Run the built-in end-to-end MLflow workflow demo.

builtin_config_path

Return the path to the built-in demo config shipped with the package.

export_builtin_config

Export the built-in demo config into the current project.

default_project_paths

Compute standard config file paths for a project.

get_include

Return the absolute path to the NumCpp C++ headers include directory.

dot

dot(a: numpy.ndarray, b: numpy.ndarray) -> numpy.ndarray

DummyCodeEncoder

Encode categorical features into dummy/indicator 0/1 variables.

GetDummies

Multi-column multi-label string column one-hot encoder [Rbcee2ffc57f9-1].

Kiss32Random

32-bit KISS RNG with complete serialization support.

Kiss64Random

Low-level 64-bit KISS RNG with context manager support.

KissRandom

Factory function for auto-detecting 32-bit vs 64-bit RNG.

KissSeedSequence

Seed sequence compatible with numpy.random.SeedSequence.

KissBitGenerator

NumPy-compatible BitGenerator using KISS algorithm with complete serialization.

KissGenerator

High-level random number generator using KISS algorithm.

KissRandomState

NumPy RandomState-compatible interface with complete serialization.

default_rng

Create default KISS random number generator.

kiss_context

Context manager for temporary RNG.

choice

Random sample from array.

integers

Random integers in [low, high) or [low, high].

normal

Normal distribution (Box-Muller transform).

permutation

Randomly permute sequence or return permuted range.

random

Random floats in [0, 1).

shuffle

Shuffle array in-place (Fisher-Yates algorithm).

uniform

Uniform distribution in [low, high).

aucplot

Plot PR or ROC curves with a seaborn-like API.

evalplot

Visualization of the Confusion Matrix [Ra7e29df24177-1] alongside a text report showing key classification metrics.

decileplot

Given binary labels y_true (0/1) and probabilities y_score 1d array, compute/plot a decile [Rd1ed195c7ca1-2] table.

print_labels

Pretty-print the legend of decile table column names.

Events

Bayesian blocks fitness for binned or unbinned events.

FitnessFunc

Base class for bayesian blocks fitness functions.

PointMeasures

Bayesian blocks fitness for point measures.

RegularEvents

Bayesian blocks fitness for regular events.

bayesian_blocks

Compute optimal segmentation of data with Scargle’s Bayesian Blocks.

binned_binom_proportion

Binomial proportion and confidence interval in bins of a continuous

binom_conf_interval

Binomial proportion confidence interval given k successes,

bootstrap

Performs bootstrap resampling on numpy arrays.

cdf_from_intervals

Construct a callable piecewise-linear CDF from a pair of arrays.

fold_intervals

Fold the weighted intervals to the interval (0,1).

gaussian_fwhm_to_sigma

Convert a string or number to a floating point number, if possible.

gaussian_sigma_to_fwhm

Convert a string or number to a floating point number, if possible.

histogram_intervals

Histogram of a piecewise-constant weight function.

interval_overlap_length

Compute the length of overlap of two intervals.

kuiper

Compute the Kuiper statistic.

kuiper_false_positive_probability

Compute the false positive probability for the Kuiper statistic.

kuiper_two

Compute the Kuiper statistic to compare two samples.

mad_std

Calculate a robust standard deviation using the median absolute deviation (MAD).

median_absolute_deviation

Calculate the median absolute deviation (MAD).

poisson_conf_interval

Poisson parameter confidence interval given observed counts.

signal_to_noise_oir_ccd

Computes the signal to noise ratio for source being observed in the

calculate_bin_edges

Calculate histogram bin edges like numpy.histogram_bin_edges.

freedman_bin_width

Return the optimal histogram bin width using the Freedman-Diaconis rule.

histogram

Enhanced histogram function, providing adaptive binnings.

knuth_bin_width

Return the optimal histogram bin width using Knuth’s rule.

scott_bin_width

Return the optimal histogram bin width using Scott’s rule.

akaike_info_criterion

Computes the Akaike Information Criterion (AIC).

akaike_info_criterion_lsq

Computes the Akaike Information Criterion assuming that the observations

bayesian_info_criterion

Computes the Bayesian Information Criterion (BIC) given the log of the

bayesian_info_criterion_lsq

Computes the Bayesian Information Criterion (BIC) assuming that the

tweedie_gen

A Tweedie continuous random variable inherited scipy.stats.rv_continuous.

tweedie

An instance of tweedie_gen, providing Tweedie distribution functionality.

Timer

Lightweight ⏱ timing context manager with logger support.

PathNamer

Generate portable, collision-resistant filenames and paths.

make_path

Make Convenience wrapper to build a unique path (callable with zero args).

graph_view

Generates an architectural visualization for a given linear Keras

layered_view

Generates an architectural visualization for a given linear Keras

SpacingDummyLayer

A factory class for dynamically generating a dummy Keras layer with custom spacing.

_factory_api

Scikit-plots Factory API module.

plot_roc_curve

Generates the ROC curves from labels and predicted scores/probabilities

plot_precision_recall_curve

Generates the Precision Recall Curve from labels and probabilities