DistributionSample

class probly.representation.distribution.DistributionSample(*args, **kwargs)[source]

Bases: RepresentationSample, Generic

Sample type for empirical second-order distributions.

concat(other: Sample[T]) → Self[source]

Append another sample to this sample.

abstractmethod classmethod from_iterable(samples: Iterable[T], weights: Iterable[float] | None = None, *, sample_axis: SampleAxis = 'auto') → Self[source]

Create an Sample from an iterable of samples.

Parameters:
  • samples – The predictions to create the sample from.

  • weights – The (optional) weights for each sample.

  • sample_axis – The dimension along which samples are organized.

Returns:

The created NumpySample.

classmethod from_sample(sample: Sample[T], *, sample_axis: SampleAxis = 'auto') → Self[source]

Create a new Sample from an existing Sample.

Parameters:
  • sample – The sample to create the new sample from.

  • sample_axis – The dimension along which samples are organized.

Returns:

The created Sample.

property is_weighted: bool

Return whether the samples are weighted.

sample_mean() → T[source]

Compute the (weighted) mean of the sample.

property sample_size: int

Return the number of samples.

sample_space[source]

alias of Distribution

sample_std(ddof: int = 0) → T[source]

Compute the standard deviation of the sample.

sample_var(ddof: int = 0) → T[source]

Compute the variance of the sample.

abstract property samples: Iterable[T]

Return an iterator over the samples.

abstract property weights: Iterable[float] | None

Return an iterator over the sample weights.

Examples using probly.representation.distribution.DistributionSample

Second order: a sample of distributions

Second order: a sample of distributions