plot_score_summary¶
yohou.plotting.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 ¶
Source code in src/yohou/plotting/evaluation.py
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 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 | |
Tutorials¶
The following example notebooks use this component:
-
Direct, Recursive, and MIMO Strategies
Compare direct, recursive, and MIMO reduction strategies across forecasting horizons to understand the trade-offs for your use case.
-
Forecasting Workflow
Evaluate forecasters with cross-validation, search hyperparameters with GridSearchCV, and inspect residuals to diagnose model weaknesses.
-
How to Apply Time-Weighted Training
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
Build point ensembles with VotingPointForecaster using mean, weighted, and median aggregation strategies.
-
How to Search with Multiple Metrics
Evaluate hyperparameter configurations against multiple metrics simultaneously with dict-of-scorers, refit strategies, and Pareto-optimal selection.
-
How to Use Point Forecast Metrics
Compare MAE, MAPE, MASE, RMSE, and other point metrics across multiple forecasters with componentwise and groupwise aggregation.