plot_score_summary¶
yohou.plotting.evaluation.plot_score_summary(scorer, y_truth, y_pred, *, color_palette=None, show_legend=True, title=None, x_label=None, y_label=None, width=None, height=None, bar_opacity=0.85, sort_ascending=None, text_auto=True)
¶
Plot a grouped bar chart comparing aggregate scores across models and scorers.
For each combination of scorer and model, compute a single aggregate score and display the results as a grouped bar chart. This is useful for quick model comparison without the per-step detail.
Parameters¶
| Name | Type | Description | Default |
|---|---|---|---|
scorer
|
BaseScorer or dict[str, BaseScorer]
|
Yohou scorer instance.
|
required |
y_truth
|
DataFrame
|
Ground truth with |
required |
y_pred
|
DataFrame or dict[str, DataFrame]
|
Predictions with
|
required |
color_palette
|
list[str] | None
|
Custom colour palette. |
None
|
show_legend
|
bool
|
Whether to show the legend. |
True
|
title
|
str | None
|
Plot title. Defaults to |
None
|
x_label
|
str | None
|
X-axis label. Defaults to |
None
|
y_label
|
str | None
|
Y-axis label. Defaults to |
None
|
width
|
int | None
|
Plot width in pixels. |
None
|
height
|
int | None
|
Plot height in pixels. |
None
|
bar_opacity
|
float
|
Opacity of bars. |
0.85
|
sort_ascending
|
bool or None
|
Sort bars by score value. |
None
|
text_auto
|
bool
|
Annotate bars with their values. |
True
|
Returns¶
| Type | Description |
|---|---|
Figure
|
Plotly figure object. |
Raises¶
| Type | Description |
|---|---|
TypeError
|
If y_truth or y_pred is not a Polars DataFrame. |
Examples¶
>>> import polars as pl
>>> from datetime import datetime
>>> from yohou.metrics import MeanAbsoluteError
>>> from yohou.plotting import plot_score_summary
>>> y_truth = pl.DataFrame({
... "time": [datetime(2020, 1, i) for i in range(1, 6)],
... "value": [10.0, 20.0, 30.0, 40.0, 50.0],
... })
>>> y_pred = pl.DataFrame({
... "vintage_time": [datetime(2019, 12, 31)] * 5,
... "time": [datetime(2020, 1, i) for i in range(1, 6)],
... "value": [12.0, 19.0, 28.0, 42.0, 48.0],
... })
See Also¶
plot_score_per_step : Per-step score line/bar chart.
plot_score_time_series : Score values over time.
Source Code¶
Show/Hide source
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 | |
Tutorials¶
The following example notebooks use this component:
-
How to Use Point Forecast Metrics
Evaluation-Search
Compare MAE, MAPE, MASE, RMSE, and other point metrics across multiple forecasters with componentwise and groupwise aggregation.
-
How to Apply Time-Weighted Training
Forecasting-Models
Use time_weight and sample_weight_alignment to emphasise recent or seasonal training samples in PointReductionForecaster, with visualisation of weight curves and alignment strategy comparison.
-
How to Combine Forecasters with VotingPointForecaster
Forecasting-Models
Build point ensembles with VotingPointForecaster using mean, weighted, and median aggregation strategies.
-
Forecasting Workflow
Getting-Started
Evaluate forecasters with cross-validation, search hyperparameters with GridSearchCV, and inspect residuals to diagnose model weaknesses.
-
Direct, Recursive, and MIMO Strategies
Getting-Started
Compare direct, recursive, and MIMO reduction strategies across forecasting horizons to understand the trade-offs for your use case.
-
How to Visualize Forecast Evaluation Results
Visualization
Use plot_calibration, plot_score_per_step, and plot_forecast to diagnose forecast accuracy and interval calibration visually.