Yellowbrick is a Python library that extends the scikit-learn API with a suite of visual analysis and diagnostic tools for machine learning. It allows users to visualize model performance, feature relationships, and evaluate model selection processes directly within their existing scikit-learn workflows. The library is currently at version 1.5 and historically has had a release cadence of several major updates per year, though the latest release (v1.5) is from August 2022.
Install & Compatibility
Where this runs
tested against v1.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.940 runs
build_error
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 13.4s · import 3.611s · 357MB
372MB installed
● package 372MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from yellowbrick.cluster import KElbowVisualizer
This example demonstrates how to use the `KElbowVisualizer` to determine the optimal number of clusters for a KMeans model using synthetic data. It fits the visualizer to the data and then displays the resulting elbow plot.
from yellowbrick.cluster import KElbowVisualizer
from sklearn.cluster import KMeans
from sklearn.datasets import make_blobs
# Generate synthetic dataset
X, y = make_blobs(n_samples=1000, n_features=12, centers=8, random_state=42)
# Instantiate the clustering model and visualizer
model = KMeans(random_state=42, n_init=10) # n_init added for KMeans > sklearn 1.2
visualizer = KElbowVisualizer(model, k=(2,12))
visualizer.fit(X) # Fit the data to the visualizer
visualizer.show() # Finalize and render the figure
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.