sharkpy.plotting

Attributes

available_fonts

SHARKPY_COLORS

Functions

validate_colors(→ Dict[str, str])

Validate color dictionary and fall back to defaults if invalid.

plot_model(model, X[, y, kind, show, save_path, ...])

Visualizes model behavior depending on the specified kind.

_plot_prediction(model, X, y, colors)

_plot_residuals(model, X, y, colors)

_plot_confusion_matrix(model, X, y, colors)

_plot_roc(model, X, y, colors)

_plot_pr_curve(model, X, y, colors)

_plot_proba_hist(model, X, y, colors)

_plot_feature_importance(model, feature_names, colors)

get_sharkpy_colors(→ Dict[str, str])

Returns the default SharkPy color scheme.

Module Contents

sharkpy.plotting.available_fonts[source]
sharkpy.plotting.SHARKPY_COLORS[source]
sharkpy.plotting.validate_colors(colors: Dict[str, str]) Dict[str, str][source]

Validate color dictionary and fall back to defaults if invalid.

Parameters:

colors – Dictionary of color specifications

Returns:

Validated color dictionary

sharkpy.plotting.plot_model(model, X, y=None, kind='prediction', show=True, save_path=None, feature_names=None, colors: Dict[str, str] | None = None)[source]

Visualizes model behavior depending on the specified kind.

Parameters:
  • model – trained model

  • X – array-like, shape (n_samples, n_features)

  • y – array-like, shape (n_samples,), optional

  • kind – str, one of {“prediction”, “residuals”, “confusion_matrix”, “roc”, “pr_curve”, “proba_hist”, “feature_importance”}

  • show – bool, whether to display the plot

  • save_path – str or None, path to save the plot

  • feature_names – list, optional, names of features for plotting

  • colors – dict, optional, custom color specifications

sharkpy.plotting._plot_prediction(model, X, y, colors)[source]
sharkpy.plotting._plot_residuals(model, X, y, colors)[source]
sharkpy.plotting._plot_confusion_matrix(model, X, y, colors)[source]
sharkpy.plotting._plot_roc(model, X, y, colors)[source]
sharkpy.plotting._plot_pr_curve(model, X, y, colors)[source]
sharkpy.plotting._plot_proba_hist(model, X, y, colors)[source]
sharkpy.plotting._plot_feature_importance(model, feature_names, colors)[source]
sharkpy.plotting.get_sharkpy_colors() Dict[str, str][source]

Returns the default SharkPy color scheme.

Returns:

Dictionary of color specifications