Skip to content

Python API reference

Hedgehogs configures scientific figures and presents results in notebooks and terminals. Examples use import hedgehogs as hdg; Matplotlib retains ownership of figures and artists.

Public namespace

Configure shared defaults with set_style() and figsize(). Draw, adjust, display and save individual figures through plots. Align separate comparison figures with figures.align(figures=[...]).

Group Public names Purpose
Figure settings set_style, reset_style, figsize, figures.align Configure style and read canvas dimensions
Figure helpers plots.label, plots.square, plots.grid, plots.minor_ticks Label and adjust existing axes and panels
General plots plots.tree, plots.pairplot, plots.decision_regions, plots.legend, plots.show, plots.save Draw, finish and save figures
SHAP visualisation plots.force_plot, plots.summary_plot, plots.waterfall_plot, plots.dependence_plot, plots.decision_plot Draw supplied feature attributions
Palettes Palette, get_palette, build_color_map, build_style_map, register_palette, save_palette, load_palette Select and map colours
Tables Table Format, display and export rows
Terminal output Progress, echo, rule, info Report activity and inspect package versions
Numerical support EPS Read floating-point machine epsilon

Reference map

Task Reference Main API
Configure figure defaults Figures set_style, reset_style, figsize, figures.align
Draw, label and output plots Plots plots.label, plots.square, plots.legend, plots.show, plots.save
Draw or finish SHAP explanations SHAP visualisation plots.force_plot, plots.summary_plot, plots.waterfall_plot, plots.dependence_plot, plots.decision_plot
Select colours or define series styles Palettes get_palette, build_style_map, register_palette
Format and export results Tables Table
Report progress and status Terminal output Progress, echo, rule

Reference conventions

API indices summarise purpose and return values. Signatures show keyword-only options after *; parameter tables describe defaults and constraints. None requests the documented inference or disables an optional behaviour. Paths accept str and os.PathLike.

Figures remain editable. set_style() affects Matplotlib until reset_style() restores it. EPS equals sys.float_info.epsilon.

Read the documentation roadmap for guides and tutorials, and implementation ownership for lifecycle and extension rules.

For changes to names and arguments in existing notebooks, see Migrating to 0.1.0.