Skip to content

ResultSeriesDelta

Returned by subtracting two series (series_a - series_b). See the Result Time-Series & Version Comparison guide for usage.

ml_debugger.result.series.comparison.ResultSeriesDelta

Aligned per-epoch metric differences of two :class:ResultSeries.

Attributes:

Name Type Description
a_label str

Legend label of the left (a) series.

b_label str

Legend label of the right (b) series.

model_name str

Shared model name of both series.

metrics(metric=None, dataset_type=None)

Return the aligned delta rows in long form.

Parameters:

Name Type Description Default

metric

Optional[str]

Keep only this metric when given.

None

dataset_type

Optional[str]

Keep only this dataset_type when given.

None

Returns:

Type Description
DataFrame

pd.DataFrame: Columns ``[n_epoch, metric, dataset_type, delta, a_value,

DataFrame

b_value]``.

issues(by='category', metric='counts_ratio', dataset_type=None, epochs=None)

Return per-group issue-metric differences (a - b) per epoch.

Mirrors :meth:metrics, but for issues. Both series are aligned on the intersection of their epochs (a's epoch order preserved); groups (category or error_code) are outer-joined (sorted union of both sides' groups). For each (group, epoch):

  • For count-like metrics (counts / counts_ratio) a group absent at an epoch (or NaN from the groupby sum) is treated as 0 occurrences, so a group present only on side a reads as a positive delta (newly appearing) and one present only on side b as a negative delta (disappeared). For other (quality) metrics a missing group is left as None and its delta is None (zero-filling would be wrong).
  • delta = a_value - b_value when both are not None; None otherwise.
  • status is "both" when both sides have the group at that epoch, else "a_only" / "b_only".

Rows where both sides are missing the group at an epoch are dropped.

Each call fetches issues from the server (one call per epoch per side, no caching) — consistent with :meth:ResultSeries.issues.

Parameters:

Name Type Description Default

by

str

Group column — "category" (default) or "error_code".

'category'

metric

str

Issue column to difference (e.g. "counts_ratio", "counts", "accuracy", "average_iou").

'counts_ratio'

dataset_type

Optional[str]

Issue dataset_type filter passed to the server.

None

epochs

Optional[List[Optional[int]]]

Restrict to these epochs (None = all).

None

Returns:

Type Description
DataFrame

pd.DataFrame: Columns ``[n_epoch, , delta, a_value, b_value,

DataFrame

status]whereis literally theby`` column name (e.g.

DataFrame

"category"). Empty DataFrame with those columns when there is no

DataFrame

aligned data.

plot(metric=None, dataset_type=None, figsize=(8, 5), show=True)

Plot the delta over epochs with a horizontal 0 reference line.

One line per (metric, dataset_type) group; None deltas render as gaps (NaN).

Parameters:

Name Type Description Default

metric

Optional[str]

Restrict to this metric (None = all).

None

dataset_type

Optional[str]

Restrict to this dataset_type (None = all).

None

figsize

Tuple[float, float]

(width, height) in inches.

(8, 5)

show

bool

Call plt.show() when True.

True

Returns:

Type Description
Figure

matplotlib.figure.Figure: The created figure.

plot_issues(by='category', metric='counts_ratio', dataset_type=None, figsize=(8, 5), show=True)

Plot per-group issue deltas over epochs with a horizontal 0 reference.

One line per group (category or error_code); None deltas render as gaps (NaN). The frame comes from :meth:issues, so each call fetches issues from the server.

Parameters:

Name Type Description Default

by

str

Group column — "category" (default) or "error_code".

'category'

metric

str

Issue column to difference (e.g. "counts_ratio").

'counts_ratio'

dataset_type

Optional[str]

Issue dataset_type filter passed to the server.

None

figsize

Tuple[float, float]

(width, height) in inches.

(8, 5)

show

bool

Call plt.show() when True.

True

Returns:

Type Description
Figure

matplotlib.figure.Figure: The created figure.