Examples#

This is the gallery of examples that showcase how scikit-plots can be used. Some examples demonstrate the use of the APIs Reference in general and some demonstrate specific applications in tutorial form. Also check out our user guide for more detailed illustrations.

This page contains example plots. Click on any image to see the full image and source code.

Tagging!

You can also browse the example gallery by tags.

blog#

jupyter notebooks#

Sample Notebooks.

ANNoy Vector Index DB#

Examples related to the annoy and _annoy submodule instance.

annoy.Annoy legacy c-api with examples

annoy.Annoy legacy c-api with examples

annoy.Index python-api with examples

annoy.Index python-api with examples

annoy.Index to NPY or CSV with examples

annoy.Index to NPY or CSV with examples

Index (cython) python-api with examples

Index (cython) python-api with examples

Mmap annoy.AnnoyIndex with examples

Mmap annoy.AnnoyIndex with examples

Precision annoy.AnnoyIndex with examples

Precision annoy.AnnoyIndex with examples

Simple annoy.AnnoyIndex with examples

Simple annoy.AnnoyIndex with examples

Compile and run the C++ Annoy with examples

Compile and run the C++ Annoy with examples

Array API support#

Examples related to the _lib submodule with e.g. LogisticRegression instance.

Calibration#

Examples related to the metrics submodule with e.g. LogisticRegression instance.

plot_calibration with examples

plot_calibration with examples

Classification#

Examples related to the estimators submodule with e.g. LogisticRegression instance.

plot_classifier_eval with examples

plot_classifier_eval with examples

plot_confusion_matrix with examples

plot_confusion_matrix with examples

plot_feature_importances with examples

plot_feature_importances with examples

plot_learning_curve with examples

plot_learning_curve with examples

plot_precision_recall with examples

plot_precision_recall with examples

plot_roc_curve with examples

plot_roc_curve with examples

Clustering#

Examples related to the estimators submodule with e.g. LogisticRegression instance.

plot_elbow with examples

plot_elbow with examples

plot_silhouette with examples

plot_silhouette with examples

Cython#

Examples related to the cython submodule.

# 💡cython Need cython and setuptools
pip install scikitplot[build] setuptools

# (Recommended)
# !pip install cython setuptools

Cython quickstart: compile_and_load

Cython quickstart: compile_and_load

Browse and compile templates

Browse and compile templates

Build profiles: fast-debug, release, annotate

Build profiles: fast-debug, release, annotate

Cache and restart reuse

Cache and restart reuse

Pin/Alias: stable handles for cached builds

Pin/Alias: stable handles for cached builds

Multi-module package builds (5 package examples)

Multi-module package builds (5 package examples)

Multi-file builds: .pxi includes and external headers

Multi-file builds: .pxi includes and external headers

C++ mode basics: cppclass and libcpp containers

C++ mode basics: cppclass and libcpp containers

Vector ops without NumPy: array(‘d’) + memoryviews

Vector ops without NumPy: array('d') + memoryviews

Workflow templates (train / hpo / predict) + CLI entry template

Workflow templates (train / hpo / predict) + CLI entry template

Cython: Realtime compile_and_load (.pyx)

Cython: Realtime compile_and_load (.pyx)

Decile#

Examples related to the decile submodule with e.g. LogisticRegression instance.

See also

  • Seaborn-style decile analysis (Lift / Gain / KS) decileplot

plot_cumulative_gain with examples

plot_cumulative_gain with examples

plot_ks_statistic with examples

plot_ks_statistic with examples

plot_lift with examples

plot_lift with examples

Introduction to modelplotpy (legacy)

Introduction to modelplotpy (legacy)

Introduction to modelplotpy

Introduction to modelplotpy

plot_report with examples

plot_report with examples

Decomposition#

Examples related to the decomposition submodule with e.g. PCA instance.

plot_pca_2d_projection with examples

plot_pca_2d_projection with examples

plot_pca_component_variance with examples

plot_pca_component_variance with examples

Impute#

Examples related to the impute submodule with a scikit-learn regressor (e.g., LinearRegression) instance.

# 💡impute may need voyager
pip install scikitplot[core]

# (Optionally)
# !pip install voyager

annoy impute with examples

annoy impute with examples

MemMap#

Examples related to the memmap submodule.

Memory-Mapping Showcase – Basic / Medium / Advanced

Memory-Mapping Showcase – Basic / Medium / Advanced

MLflow#

Examples related to the mlflow submodule with a scikit-learn regressor (e.g., LinearRegression) instance.

# 💡mlflow Need mlflow
pip install scikitplot[mlflow]

# (Recommended)
# !pip install mlflow

MLflow

MLflow

Nc (NumCpp)#

Examples related to the nc submodule.

nc with examples

nc with examples

Preprocessing#

Examples related to the preprocessing submodule with e.g., DummyCodeEncoder, GetDummies instance.

Comparing DummyCode Encoder with Other Encoders

Comparing DummyCode Encoder with Other Encoders

Random#

Examples related to the random submodule.

Enhanced KISS Random Generator - Complete Usage Examples

Enhanced KISS Random Generator - Complete Usage Examples

Regression#

Examples related to the metrics submodule with e.g., LinearRegression instance.

plot_residuals_distribution with examples

plot_residuals_distribution with examples

Seaborn#

Examples related to the seaborn submodule with a scikit-learn regressor (e.g., LinearRegression) instance.

plot_aucplot_script with examples

plot_aucplot_script with examples

plot_decileplot_script with examples

plot_decileplot_script with examples

plot_evalplot_script with examples

plot_evalplot_script with examples

Stats#

Examples related to the stats submodule with e.g. LinearRegression instance.

plot_residuals_distribution with examples

plot_residuals_distribution with examples

Visualkeras#

Examples related to the visualkeras submodule with e.g. a DL (ANN, CNN, NLP) tf.keras.Model model instance.

Important

# 💡visualkeras Need aggdraw tensorflow or tensorflow-cpu
pip install scikitplot[core, cpu]

# (Recommended)
# !pip install aggdraw
# !pip install tensorflow

python -c "import tensorflow as tf, google.protobuf as pb; print('tf', tf.__version__); print('protobuf', pb.__version__)"
python -m pip check

# If Needed
# pip install -U "protobuf<6"
# pip install protobuf==5.29.4
import tensorflow as tf

Visualkeras: Spam Classification Conv1D Dense Example

Visualkeras: Spam Classification Conv1D Dense Example

visualkeras: Spam Dense example

visualkeras: Spam Dense example

visualkeras: autoencoder example

visualkeras: autoencoder example

visualkeras: custom vgg16 example

visualkeras: custom vgg16 example

visualkeras: custom vgg16 show dimension example

visualkeras: custom vgg16 show dimension example

visualkeras: EfficientNetV2 example

visualkeras: EfficientNetV2 example

visualkeras: ResNetV2 example

visualkeras: ResNetV2 example

visualkeras: custom VGG example

visualkeras: custom VGG example

visualkeras: Vector Index DB

visualkeras: Vector Index DB

Gallery generated by Sphinx-Gallery