chronax.stemgnn_scaler
Per-window scalers for StemGNN: robust (NF's StemGNN default) and identity.
IdentityScaler
chronax.stemgnn_scaler.IdentityScaler
No-op scaler (shift=0, scale=1). Matches neuralforecast's scaler_type='identity'.
stats(self, x, axis=1)
Calculates shift (0) and scale (1).
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
jnp.ndarray |
- | (undocumented) |
axis |
int |
1 |
(undocumented) |
Returns: tuple[jnp.ndarray, jnp.ndarray] (shift, scale).
transform(self, x, shift, scale)
Returns x unchanged.
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
jnp.ndarray |
- | (undocumented) |
shift |
jnp.ndarray |
- | (undocumented) |
scale |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (transformed array).
inverse(self, z, shift, scale)
Returns z unchanged.
| Parameter | Type | Default | Description |
|---|---|---|---|
z |
jnp.ndarray |
- | (undocumented) |
shift |
jnp.ndarray |
- | (undocumented) |
scale |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (inversely transformed array).
RobustScaler
chronax.stemgnn_scaler.RobustScaler
Median + median-absolute-deviation (MAD) scaler, mirroring neuralforecast's robust_statistics.
Shift is the median; scale is the MAD, with three guards applied in order: fall back to 0.6745 * std where MAD is 0, pin any remaining exact zeros to 1.0, then add eps. At n_series=1 the network's forecast is a learned constant in scaled space, so this median/MAD pair is the only data-dependent part of the forecast.
stats(self, x, axis=1)
Calculates shift (median) and robust scale (MAD, guarded).
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
jnp.ndarray |
- | (undocumented) |
axis |
int |
1 |
(undocumented) |
Returns: tuple[jnp.ndarray, jnp.ndarray] (shift, scale).
transform(self, x, shift, scale)
Standard robust transformation: (x - shift) / scale.
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
jnp.ndarray |
- | (undocumented) |
shift |
jnp.ndarray |
- | (undocumented) |
scale |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (transformed array).
inverse(self, z, shift, scale)
Standard robust inverse transformation: z * scale + shift.
| Parameter | Type | Default | Description |
|---|---|---|---|
z |
jnp.ndarray |
- | (undocumented) |
shift |
jnp.ndarray |
- | (undocumented) |
scale |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (inversely transformed array).
resolve_scaler(scaler)
chronax.stemgnn_scaler.resolve_scaler
Resolve a scaler from a name ('identity'/'robust') or a Scaler instance.
| Parameter | Type | Default | Description |
|---|---|---|---|
scaler |
str | Scaler |
- | (undocumented) |
Returns: Scaler (The resolved scaler instance).
Raises: ValueError (If an unknown scaler name is provided).