Transforms
Normalising-flow transforms for OAK input preprocessing.
Provides a :class:SinhArcsinhTransform (a NumPyro Transform
subclass) and convenience functions for fitting per-feature normalising
flows that map raw inputs to approximately standard normal.
SinhArcsinhTransform
Bases: Transform
Jones & Pewsey (2009) sinh-arcsinh bijector.
.. math:: y = \sinh\bigl(\tau\,\operatorname{arcsinh}(x) - \varepsilon\bigr)
where :math:\varepsilon (skewness) is unconstrained and
:math:\tau (tailweight) is strictly positive.
Parameters:
-
skewnessβSkewness parameter :math:
\varepsilon. -
tailweightβTailweight parameter :math:
\tau > 0.
fit_normalising_flow
Fit a per-feature normalising flow mapping raw values to ~N(0,1).
The bijector chain is Shift -> Log -> Standardise -> SinhArcsinh. Only the SinhArcsinh skewness and tailweight are optimised (via BFGS); the first three steps are determined by summary statistics of x_col.
Parameters:
-
x_col(Array) β1-D array of feature values (training data only).
Returns:
-
A(ComposeTransform) βclass:
~numpyro.distributions.transforms.ComposeTransform -
ComposeTransformβmapping raw feature values to approximately standard normal.
fit_all_normalising_flows
Fit independent normalising flows for each column of X.
Parameters:
-
X(Array) βArray of shape
(N, D).
Returns:
-
list[ComposeTransform]βList of D :class:
~numpyro.distributions.transforms.ComposeTransform -
list[ComposeTransform]βinstances, one per feature.