NumpyOneHotConformalSet¶
- class probly.representation.conformal_set.numpy.NumpyOneHotConformalSet(array: ndarray)[source]¶
Bases:
NumpyAxisProtected[NumpyOneHotConformalSet,NumpyOneHotConformalSet,NumpyOneHotConformalSet,Never,NumpyOneHotConformalSet,NDArray[bool],NumpyOneHotConformalSet],OneHotConformalSet[ndarray]One-hot conformal set backed by a NumPy array.
- property T: ShapeResultT¶
The transposed version of the underlying array.
- array: np.ndarray¶
- astype(dtype: DTypeLike, order: Order = 'K', casting: Literal['no', 'equiv', 'safe', 'same_kind', 'unsafe'] = 'unsafe', subok: bool = True, copy: bool = True) OpResultT[source]¶
Cast each protected field using ndarray.astype’s casting and layout options.
- property flags: ArrayFlagsLike¶
The flags of the array.
- classmethod from_array(array: ndarray) Self[source]¶
Create a one-hot conformal set from a raw NumPy array.
- Parameters:
array – A one-hot encoded boolean or integer array.
- Returns:
The created conformal set.
- classmethod from_sample(sample: Sample[np.ndarray]) Self[source]¶
Create a one-hot conformal set from a sample.
- Parameters:
sample – A sample containing a one-hot encoded array.
- Returns:
The created conformal set.
- property mT: ShapeResultT¶
The transposed version of the underlying array.
- permitted_functions = {}¶
- permitted_ufuncs = {}¶
- primary_protected_name = 'array'¶
- protected_values(func: Callable | None = None, method: str | None = None) dict[str, NumpyProtectedValue] | None[source]¶
Read effective values, with optional NumPy function or ufunc permissions.
- reshape(*shape: int | tuple[int, ...], order: str = 'C', copy: bool | None = None) ShapeResultT[source]¶
Return a copy with reshaped protected values.
- property shape: tuple[int, ...]¶
Read the logical shape without collecting fields unless all broadcast.
- transpose(*axes: int | Sequence[int] | None) ShapeResultT[source]¶
Return a transposed version of the NumpySample.
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.
- Parameters:
axes – The axes to transpose.
- Returns:
A transposed version of the NumpySample.
- type = 'one_hot'¶
Examples using probly.representation.conformal_set.numpy.NumpyOneHotConformalSet¶
How Conformal Sets Change with the Score and with Alpha