Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:DistrictDataLabs Yellowbrick VisualPipeline

From Leeroopedia


Knowledge Sources
Domains Model_Selection, Visualization
Last Updated 2026-02-08 05:00 GMT

Overview

Extended scikit-learn Pipeline that integrates Yellowbrick visualizers into the pipeline workflow, enabling automatic rendering of all visual steps.

Description

The VisualPipeline subclasses scikit-learn's Pipeline and adds the ability to detect and render Yellowbrick Visualizer steps. The show method iterates over all visualizer steps and renders each one, optionally saving figures to disk. The visual_steps property provides a read-only dictionary of visualizer steps in the pipeline.

Usage

Import VisualPipeline when building machine learning pipelines that include Yellowbrick visualizers alongside sklearn transformers and estimators.

Code Reference

Source Location

Signature

class VisualPipeline(Pipeline):
    @property
    def visual_steps(self):
        """Read-only dict of visualizer steps."""

    def show(self, outdir=None, ext=".pdf", **kwargs):
        """Renders all visualizer steps."""

    def fit_transform_show(self, X, y=None, outpath=None, **kwargs):
        """Fit, transform, and show all visualizations."""

Import

from yellowbrick.pipeline import VisualPipeline

I/O Contract

Inputs

Name Type Required Description
steps list of (name, transform) Yes Pipeline steps (sklearn convention)
outdir str No Directory to save figures
ext str No Figure file extension (default: ".pdf")

Outputs

Name Type Description
visual_steps dict Dictionary of name: Visualizer pairs
show() None Renders all visualizers

Usage Examples

from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from yellowbrick.pipeline import VisualPipeline
from yellowbrick.features import RadViz

pipe = VisualPipeline([
    ("scaler", StandardScaler()),
    ("radviz", RadViz()),
    ("svc", SVC()),
])

pipe.fit(X, y)
pipe.show(outdir="./figures")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment