{"id":5556,"library":"yellowbrick","title":"Yellowbrick","description":"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.","status":"active","version":"1.5","language":"en","source_language":"en","source_url":"https://github.com/DistrictDataLabs/yellowbrick","tags":["machine-learning","visualization","scikit-learn","data-science","model-evaluation"],"install":[{"cmd":"pip install yellowbrick","lang":"bash","label":"Install base package"},{"cmd":"pip install yellowbrick[text]","lang":"bash","label":"Install with text processing dependencies (e.g., NLTK)"}],"dependencies":[{"reason":"Core machine learning library, Yellowbrick extends its API.","package":"scikit-learn"},{"reason":"Numerical computing, fundamental dependency for ML.","package":"numpy"},{"reason":"Scientific computing, fundamental dependency for ML.","package":"scipy"},{"reason":"Plotting and visualization, Yellowbrick's core output.","package":"matplotlib"},{"reason":"Natural Language Toolkit, required for text-specific visualizers.","package":"nltk","optional":true}],"imports":[{"symbol":"KElbowVisualizer","correct":"from yellowbrick.cluster import KElbowVisualizer"},{"symbol":"ROCAUC","correct":"from yellowbrick.classifier import ROCAUC"},{"symbol":"ResidualsPlot","correct":"from yellowbrick.regressor import ResidualsPlot"},{"symbol":"FeatureImportances","correct":"from yellowbrick.model_selection import FeatureImportances"},{"note":"The `poof()` method was deprecated in v1.0.1 and removed in later versions; use `show()` instead.","wrong":"visualizer.poof()","symbol":"show","correct":"visualizer.show()"}],"quickstart":{"code":"from yellowbrick.cluster import KElbowVisualizer\nfrom sklearn.cluster import KMeans\nfrom sklearn.datasets import make_blobs\n\n# Generate synthetic dataset\nX, y = make_blobs(n_samples=1000, n_features=12, centers=8, random_state=42)\n\n# Instantiate the clustering model and visualizer\nmodel = KMeans(random_state=42, n_init=10) # n_init added for KMeans > sklearn 1.2\nvisualizer = KElbowVisualizer(model, k=(2,12))\n\nvisualizer.fit(X)        # Fit the data to the visualizer\nvisualizer.show()        # Finalize and render the figure","lang":"python","description":"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."},"warnings":[{"fix":"Replace all calls to `visualizer.poof()` with `visualizer.show()`.","message":"The `poof()` method for rendering visualizers was deprecated in v1.0.1 and subsequently removed. It was replaced by `show()`.","severity":"breaking","affected_versions":">=1.0.1"},{"fix":"Ensure your project uses Python 3.6 or higher (v1.5 requires >=3.4, <4).","message":"Yellowbrick dropped support for Python 2.x with the release of v1.0.","severity":"breaking","affected_versions":">=1.0"},{"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.","message":"Yellowbrick 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The internal `set_params` and `get_params` API for `ModelVisualizers` changed to align with `scikit-learn` v1.0+.","severity":"breaking","affected_versions":">=1.4"},{"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')`.","message":"The `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`.","severity":"gotcha","affected_versions":"All versions using text visualizers"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}