eulerpi.core.data_transformations module
Data transformations can be used to improve the performance of the inference function by improving the quality of the kernel density estimate.
This subpackage contains all predefined data transformations and an abstract base class for custom data transformations.
- class AffineTransformation(A: Array, b: Array)[source]
Bases:
DataTransformationClass for applying an affine data transformation, y=Ax+b
- jacobian(data: Array) Array[source]
Calculate the jacobian of the transformation at the given data point(s).
- Parameters:
data (jnp.ndarray) – The data at which the jacobian should be evaluated.
- Raises:
NotImplementedError – Raised if the jacobian is not implemented in the subclass.
- Returns:
The jacobian of the transformation at the given data point(s).
- Return type:
jnp.ndarray
- transform(data: float64 | Array) float64 | Array[source]
Normalize the given data.
- Parameters:
data (Union[jnp.double, jnp.ndarray]) – The data to be normalized. Columns correspond to different dimensions. Rows correspond to different observations.
- Returns:
The normalized data.
- Return type:
Union[jnp.double, jnp.ndarray]
- class DataIdentity[source]
Bases:
DataTransformationThe identity transformation. Does not change the data.
- class DataNormalization(data: Array)[source]
Bases:
AffineTransformationClass for normalizing data. The data is normalized by subtracting the mean and multiplying by the inverse of the Cholesky decomposition of the covariance matrix.
- class DataPCA(data: Array, n_components: int | str)[source]
Bases:
DataTransformationThe DataPCA class can be used to transform the data using the Principal Component Analysis.
- jacobian(data: Array) Array[source]
Return the jacobian of the pca transformation at the given data point(s).
- Parameters:
data (jnp.ndarray) – The data point(s) at which the jacobian should be evaluated.
- Returns:
The jacobian of the pca transformation at the given data point(s).
- Return type:
jnp.ndarray
- class DataTransformation[source]
Bases:
ABCAbstract base class for all data transformations
Data transformations can be used to improve the performance of the
inferencefunction by improving the quality of thekernel density estimate.- abstractmethod jacobian(data: Array) Array[source]
Calculate the jacobian of the transformation at the given data point(s).
- Parameters:
data (jnp.ndarray) – The data at which the jacobian should be evaluated.
- Raises:
NotImplementedError – Raised if the jacobian is not implemented in the subclass.
- Returns:
The jacobian of the transformation at the given data point(s).
- Return type:
jnp.ndarray
- abstractmethod transform(data: Array) Array[source]
Transform the given data point(s)
- Parameters:
data (jnp.ndarray) – The data to be transformed. Columns correspond to different dimensions. Rows correspond to different observations.
- Raises:
NotImplementedError – Raised if the transform is not implemented in the subclass.
- Returns:
The transformed data point(s).
- Return type:
jnp.ndarray