API reference

andrey.RegimeOutput#

class andrey.RegimeOutput[source]#

The result of a regime-dependent method: the regime of each time step and one graph per regime.

rpcmci returns this read-only result: regimes holds each step’s regime, weights the assigning process, and outputs[k] the StructureOutput of regime k, as from a single-regime temporal method. metadata holds run values such as the algorithm name. print(out) shows each regime’s time-step share and graph.

classmethod new(outputs, weights, *, metadata=None)[source]#

Build a result from the regimes’ results and the regime-assigning process.

Parameters:
Returns:

The result.

Return type:

RegimeOutput

Raises:
  • TypeError – If metadata has a value StructureOutput.new() refuses.

  • ValueError – If weights is not a 2-D array with one row per result, holds a value outside [0, 1], or has a column that does not sum to 1 within 1e-9.

property outputs: tuple[StructureOutput, ...]#

outputs[k] holds the graph of regime k.

Type:

One StructureOutput per regime

property n_regimes: int#

The number of regimes.

property weights: ndarray#

The (n_regimes, n_samples) weight of each regime at each time step, a new array.

property regimes: ndarray#

The regime of each time step, a new (n_samples,) integer array.

Step t takes the regime with the largest weight at t, first among ties to KEY_DP decimals (andrey.core.ties).

property metadata: Mapping[str, str | bool | int | float | None | list | dict]#

Run values such as algorithm, as a read-only mapping.