算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
feature-target-visualizers【设计与创意】Use Yellowbrick feature and target visualizers for feature ranking, projection diagnostics, class balance, target binning, and feature-target correlation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to diagnose raw features, projected feature space, or the target variable before or alongside modeling with Yellowbrick. It covers Rank1D, Rank2D, RadialVisualizer, ParallelCoordinates, PCA, Manifold, JointPlot, ClassBalance, BalancedBinningReference, and FeatureCorrelation.
fit/transform/show, Matplotlib backend, style, axes, and headless saving patterns, read shared visualizer patterns.Rank1D for univariate distribution scoring; Rank2D for pairwise correlation/covariance-style structure.RadialVisualizer/RadViz and ParallelCoordinates.PCA for fast linear projections; Manifold for non-linear embeddings when the cost and algorithm limitations are acceptable.JointPlot.ClassBalance, BalancedBinningReference, and FeatureCorrelation.scripts/feature_target_smoke.py.ClassBalance; cross-link to classifier visualizers when the user proceeds from target imbalance to model diagnostics.Before giving code or debugging advice, identify:
X features, y target, or both.X.shape == (n_samples, n_features); target-only visualizers need a one-dimensional y.features, labels, or classes lists when arrays are used or when optional pandas support is unavailable.y is classification-like or continuous; force target_type="discrete" or target_type="continuous" for projection visualizers when automatic inference is ambiguous.visualizer.show(outpath=..., clear_figure=True).import matplotlib
matplotlib.use("Agg") # set before pyplot in headless jobs
import matplotlib.pyplot as plt
from yellowbrick.features import Rank2D
fig, ax = plt.subplots(figsize=(7, 6))
viz = Rank2D(ax=ax, features=feature_names, algorithm="pearson")
viz.fit(X, y)
viz.transform(X)
viz.show(outpath="rank2d.png", clear_figure=True)
plt.close(fig)
Use fit_transform(X, y) for PCA and for Manifold algorithms that do not support a separate transform() step. Use separate target visualizers outside sklearn prediction pipelines because they fit directly on y rather than on (X, y) estimator data.