NumpyIntervalConformalSet

class probly.representation.conformal_set.numpy.NumpyIntervalConformalSet(array: ndarray)[source]

Bases: NumpyAxisProtected[NumpyIntervalConformalSet, NumpyIntervalConformalSet, NumpyIntervalConformalSet, Never, NumpyIntervalConformalSet, NDArray[bool], NumpyIntervalConformalSet], IntervalConformalSet[ndarray]

Interval conformal set backed by a NumPy array storing lower and upper bounds.

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.

copy(order: Order = 'C') → OwnerT[source]

Return a copy of the array.

property device: str

Device of the array.

property dtype: dtype

Data type of the array.

property flags: ArrayFlagsLike

The flags of the array.

classmethod from_arrays(lower: ndarray, upper: ndarray) → Self[source]

Create an interval conformal set from lower and upper bound arrays.

Parameters:
  • lower – The lower bound array.

  • upper – The upper bound array.

Returns:

The created interval conformal set.

classmethod from_samples(lower: NumpySample, upper: NumpySample) → Self[source]

Create an interval conformal set from two NumpySamples.

Parameters:
  • lower – The lower bound sample.

  • upper – The upper bound sample.

Returns:

The created interval conformal set.

property mT: ShapeResultT

The transposed version of the underlying array.

property ndim: int

Number of dimensions.

permitted_functions = {}
permitted_ufuncs = {}
primary_protected_name = 'array'
protected_axes: ClassVar[dict[str, int]] = {'array': 1}
property protected_shape: tuple[int, ...]

Protected trailing shape of the primary field.

protected_value() → NumpyProtectedValue[source]

Return the primary protected value.

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 set_size: ndarray

Return the sizes of the conformal sets.

property shape: tuple[int, ...]

Read the logical shape without collecting fields unless all broadcast.

property size: int

Number of elements in the array.

to_device(device: Any, /, *, stream: Any = None) → Self[source]

Move the array to a device.

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 = 'interval'
validate() → None[source]

Raise if effective fields have insufficient rank or incompatible batches.

Call explicitly, or from __post_init__ to check dataclass construction. Fields owned by initialization (init=False) are excluded.

with_protected_values(values: dict[str, NumpyProtectedValue], func: Callable | None = None) → OwnerT | OpResultT | ShapeResultT | CompResultT | SetResultT[source]

Return a copy with updated protected field values.

Examples using probly.representation.conformal_set.numpy.NumpyIntervalConformalSet

Adaptive Conformal Intervals on Heteroscedastic Data

Adaptive Conformal Intervals on Heteroscedastic Data

Quantile Regression Conformal Prediction — sklearn

Quantile Regression Conformal Prediction — sklearn

Regression Conformal Prediction — sklearn

Regression Conformal Prediction — sklearn

Cyclone forecast uncertainty with WeatherNext

Cyclone forecast uncertainty with WeatherNext

Sets of outcomes

Sets of outcomes