Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

IdentityScaler

xlinear_scaler.IdentityScaler

No-op scaler (shift=0, scale=1). Matches neuralforecast's scaler_type='identity'.

stats(self, x: jnp.ndarray, axis: int = 1) -> tuple[jnp.ndarray, jnp.ndarray]

Calculates the shift (zeros) and scale (ones) statistics.

Parameter Type Default Description
x jnp.ndarray - (undocumented)
axis int 1 (undocumented)

transform(self, x: jnp.ndarray, shift: jnp.ndarray, scale: jnp.ndarray) -> jnp.ndarray

Applies the transformation (returns x unchanged).

Parameter Type Default Description
x jnp.ndarray - (undocumented)
shift jnp.ndarray - (undocumented)
scale jnp.ndarray - (undocumented)

inverse(self, z: jnp.ndarray, shift: jnp.ndarray, scale: jnp.ndarray) -> jnp.ndarray

Applies the inverse transformation (returns z unchanged).

Parameter Type Default Description
z jnp.ndarray - (undocumented)
shift jnp.ndarray - (undocumented)
scale jnp.ndarray - (undocumented)

RobustScaler

xlinear_scaler.RobustScaler

Median + MAD scaler with 0.6745*std fallback when MAD=0.

stats(self, x: jnp.ndarray, axis: int = 1) -> tuple[jnp.ndarray, jnp.ndarray]

Calculates the shift (median) and scale (MAD, with fallback) statistics.

Parameter Type Default Description
x jnp.ndarray - (undocumented)
axis int 1 (undocumented)

transform(self, x: jnp.ndarray, shift: jnp.ndarray, scale: jnp.ndarray) -> jnp.ndarray

Applies the transformation: (x - shift) / scale.

Parameter Type Default Description
x jnp.ndarray - (undocumented)
shift jnp.ndarray - (undocumented)
scale jnp.ndarray - (undocumented)

inverse(self, z: jnp.ndarray, shift: jnp.ndarray, scale: jnp.ndarray) -> jnp.ndarray

Applies the inverse transformation: z * scale + shift.

Parameter Type Default Description
z jnp.ndarray - (undocumented)
shift jnp.ndarray - (undocumented)
scale jnp.ndarray - (undocumented)

resolve_scaler

xlinear_scaler.resolve_scaler(scaler)

Resolve a scaler from a name ('identity'/'robust') or a Scaler instance.

Parameter Type Default Description
scaler str \| Scaler - (undocumented)

Raises: ValueError: If an unknown scaler name is provided.