Migrating from yellowbrick¶
Yellowbrick pioneered the idea of "visual diagnostics" — sklearn-protocol objects with .fit() / .score() / .show() that wrap matplotlib. Ferrum's visualizer classes follow the same lifecycle pattern, but produce grammar-of-graphics chart objects instead of matplotlib figures.
Visualizer mapping¶
The lifecycle pattern¶
Yellowbrick and Ferrum visualizers follow the same sklearn-style protocol:
# yellowbrick
from yellowbrick.classifier import ROCAUC
viz = ROCAUC(model)
viz.fit(X_train, y_train)
viz.score(X_test, y_test)
viz.show() # renders to matplotlib
# Ferrum
import ferrum as fm
viz = fm.ROCVisualizer(model)
viz.fit(X_train, y_train).score(X_test, y_test)
chart = viz.show() # returns a Chart
chart.save("roc.svg")
The difference is what .show() returns: yellowbrick renders to a matplotlib axes and calls plt.show(). Ferrum returns a Chart that you can theme, compose, and save.
Key differences¶
No matplotlib dependency¶
Yellowbrick requires matplotlib. Ferrum renders SVG directly from Rust. There is no plt.show(), no fig.savefig(), no ax parameter.
Output is a composable chart¶
Yellowbrick visualizers produce matplotlib figures that are difficult to combine. Ferrum visualizers produce regular chart objects that compose with the same operators as any other chart:
roc = fm.roc_chart(model, X_test, y_test)
cm = fm.confusion_matrix_chart(model, X_test, y_test)
importances = fm.importance_chart(model, X_test, y_test)
report = (roc | cm) & importances
report.save("model_report.svg")
Figure-level helpers as a fast path¶
Every yellowbrick visualizer also has a one-line helper in Ferrum (roc_chart, confusion_matrix_chart, etc.) that skips the .fit() / .score() ceremony. Pass a fitted model and held-out data, get a chart back.
ModelSource for efficiency¶
When computing multiple diagnostics on the same model, build a ModelSource once and pass it to each helper — predicted probabilities and derived tables are computed once and shared:
source = fm.ModelSource(model, X_test, y_test)
roc = fm.roc_chart(source)
cm = fm.confusion_matrix_chart(source)
Themes instead of rcParams¶
Yellowbrick inherits matplotlib's rcParams for styling. Ferrum uses immutable theme values:
Coverage comparison¶
| Category | yellowbrick | Ferrum |
|---|---|---|
| Classification | ROCAUC, PrecisionRecallCurve, ConfusionMatrix, ClassificationReport, ClassPredictionError, DiscriminationThreshold |
All covered — plus gain, lift, and multi-model calibration via ComparedModelSource. |
| Regression | ResidualsPlot, PredictionError, CooksDistance |
All covered. |
| Feature analysis | FeatureImportances, Rank1D, Rank2D |
All covered — plus SHAP (beeswarm, bar, waterfall) and partial dependence. |
| Model selection | LearningCurve, ValidationCurve, CVScores |
All covered — plus alpha selection. |
| Clustering | KElbow, Silhouette, InterclusterDistance |
All covered — plus parallel coordinates and decision boundary. |
| Manifold | Manifold (wraps sklearn TSNE/Isomap, optional UMAP) |
ManifoldVisualizer — t-SNE and UMAP run in pure Rust via manifolds-rs, no optional Python dependency. Also PCA. |
| Target | ClassBalance, FeatureCorrelation |
All covered — ClassBalanceVisualizer, plus rank1d_chart / rank2d_chart for feature correlation. |
| Text | FreqDistVisualizer, TSNEVisualizer for text data |
Not in scope. t-SNE is available via ManifoldVisualizer for general dimensionality reduction. |
Where to go next¶
- Model diagnostics for the full diagnostic surface.
- Figure-level helpers for the one-line helper pattern.
- Themes for styling diagnostics.