gulps.analysis.coverage.SampledCost

class gulps.analysis.coverage.SampledCost(costs)[source]

Bases: object

Costs of the selected sentences over a finite target sample.

Parameters:

costs (tuple[float, ...]) – The selected cost for each target.

property total_cost: float

The cost summed over the sample.

property expected_cost: float

The mean cost per target.

percentile(q)

The smallest sampled cost with at least a q fraction of samples at or below it.

Returns 0.0 for an empty sample.

Parameters:

q (float)

Return type:

float

plot(ax=None)

Plot the sampled cost histogram on ax, or on new axes.

Parameters:

ax (matplotlib.axes.Axes | None)

Return type:

matplotlib.axes.Axes