probly.representation.sampling.array_sample¶
Numpy-based sample representation.
Classes
|
A sample of predictions stored in a numpy array. |
- class probly.representation.sampling.array_sample.ArraySample(array, sample_axis)[source]¶
Bases:
Sample,NDArrayOperatorsMixin,GenericA sample of predictions stored in a numpy array.
- Parameters:
array (NDArray)
sample_axis (int)
- classmethod from_iterable(samples, sample_axis='auto', dtype=None)[source]¶
Create an ArraySample from a sequence of samples.
- Parameters:
samples (Iterable[D]) – The predictions to create the sample from.
sample_axis (SampleAxis) – The dimension along which samples are organized.
dtype (DTypeLike) – Desired data type of the array.
- Returns:
The created ArraySample.
- Return type:
Self
- classmethod from_sample(sample, sample_axis='auto', dtype=None)[source]¶
- Parameters:
sample (Sample[D])
sample_axis (SampleAxis)
dtype (DTypeLike)
- Return type:
Self
- move_sample_axis(new_sample_axis)[source]¶
Return a new ArraySample with the sample dimension moved to new_sample_axis.
- Parameters:
new_sample_axis (int) – The new sample dimension.
- Returns:
A new ArraySample with the sample dimension moved.
- Return type:
ArraySample[D]
- sample_std(ddof=1)[source]¶
Compute the standard deviation of the sample.
- Parameters:
ddof (int)
- Return type:
D
- sample_var(ddof=1)[source]¶
Compute the variance of the sample.
- Parameters:
ddof (int)
- Return type:
D
- transpose(*axes)[source]¶
Return a transposed version of the ArraySample.
This method implicitly also provides full axis tracking support for - np.moveaxis - np.rollaxis Those functions call out to transpose methods for custom array types.
- array: NDArray¶
- property dtype: DTypeLike¶
The data type of the underlying array.