Registry / ai-ml / yellowbrick

yellowbrick

JSON →
library1.5pypypi✓ verified 22d ago

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.

pip install yellowbrick
INSTALL
IMPORT
SIG · YELLOWBRICK
Y
yellowbrick
ai-mlpythonv1.5
Install
14.3s avg
Import
6108ms
Disk
372MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 14.3s · import 3.665s · 357MB
372MB installed
● package 372MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KElbowVisualizer
from yellowbrick.cluster import KElbowVisualizer
from yellowbrick.cluster.elbow 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
Debug
Known issues
breakingThe `poof()` method for rendering visualizers was deprecated in v1.0.1 and subsequently removed. It was replaced by `show()`.
fix
Replace all calls to `visualizer.poof()` with `visualizer.show()`.
affects: >=1.0.1
breakingYellowbrick dropped support for Python 2.x with the release of v1.0.
fix
Ensure your project uses Python 3.6 or higher (v1.5 requires >=3.4, <4).
affects: >=1.0
gotchaYellowbrick frequently updates to maintain compatibility with rapidly evolving upstream libraries like scikit-learn, NumPy, SciPy, and Matplotlib. Specific versions of these dependencies can be required.
fix
Always check Yellowbrick's `requirements.txt` or `setup.py` on its GitHub for exact dependency versions if encountering compatibility issues. Using `pip install --upgrade yellowbrick` often helps fetch compatible versions automatically.
affects: All versions
breakingThe internal `set_params` and `get_params` API for `ModelVisualizers` changed to align with `scikit-learn` v1.0+.
fix
If you have developed custom visualizers or integrations that directly interact with `ModelVisualizer`'s parameter handling, review the base class implementation in `yellowbrick.model_selection` to adapt to the new pattern.
affects: >=1.4
gotchaThe `nltk` library and its associated data are required for text-based visualizers (e.g., `FreqDistVisualizer`, `WordCorrelationPlot`) but are not installed by default with `pip install yellowbrick`.
fix
Install with `pip install yellowbrick[text]` or separately via `pip install nltk`. You may also need to download `nltk` data, e.g., `import nltk; nltk.download('stopwords')`.
affects: All versions using text visualizers
Upgrade
Version history
1.5latest on PyPI · released Aug 21, 2022
Audit
Dependencies
scikit-learnrequiredCore machine learning library, Yellowbrick extends its API.
numpyrequiredNumerical computing, fundamental dependency for ML.
scipyrequiredScientific computing, fundamental dependency for ML.
matplotlibrequiredPlotting and visualization, Yellowbrick's core output.
nltkoptionalNatural Language Toolkit, required for text-specific visualizers.
Agent activity
60 hits · last 30 days
node
52
OpenAI (training)
1
Resources
yellowbrick — pip install yellowbrick · libregistry