sharkpy.plotting
Attributes
Functions
|
Validate color dictionary and fall back to defaults if invalid. |
|
Visualizes model behavior depending on the specified kind. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the default SharkPy color scheme. |
Module Contents
- 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