CMP++: Uncertainty Quantification & Bayesian Calibration
Loading...
Searching...
No Matches
cmp::scaler::Scaler Class Referenceabstract

Template virtual base class for feature scaling and transformation. More...

#include <scaler.h>

Inheritance diagram for cmp::scaler::Scaler:

Public Member Functions

virtual Eigen::VectorXd transform (const Eigen::Ref< const Eigen::VectorXd > &data) const =0
 Transforms the input data from physical space to the scaled latent space.
 
virtual Eigen::VectorXd inverseTransform (const Eigen::Ref< const Eigen::VectorXd > &data) const =0
 Reconstructs the data from the scaled latent space back to physical space.
 
virtual Eigen::VectorXd getIntercept () const =0
 Retrieves the intercept vector \( \mu \) used in the transformation.
 
virtual Eigen::MatrixXd getScale () const =0
 Retrieves the scaling matrix \( S \) used in the transformation.
 
virtual void fit (const Eigen::Ref< const Eigen::MatrixXd > &data)=0
 Learns the scaling parameters (e.g., mean, variance) from the training data.
 
virtual Eigen::MatrixXd fit_transform (const Eigen::Ref< const Eigen::MatrixXd > &data)=0
 Fits the scaling parameters to the data and subsequently transforms the data.
 

Detailed Description

Template virtual base class for feature scaling and transformation.

Mathematical Formulation

Define a transformation mapping \( T: \mathbb{R}^d \to \mathbb{R}^d \) and its inverse \( T^{-1} \):

\[ y = T(x) \]

\[ x = T^{-1}(y) \]

Often represented linearly with intercept \( \mu \) and scaling factor/matrix \( S \):

\[ T(x) = S^{-1}(x - \mu) \]

\[ T^{-1}(y) = S y + \mu \]

  • ### Implementation Algorithm Pure virtual interface. Concrete implementations define the fitting, transforming, and inverse transforming steps.

Member Function Documentation

◆ fit()

virtual void cmp::scaler::Scaler::fit ( const Eigen::Ref< const Eigen::MatrixXd > &  data)
pure virtual

Learns the scaling parameters (e.g., mean, variance) from the training data.

Parameters
dataA matrix \( X \in \mathbb{R}^{n \times d} \) of training samples.

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.

◆ fit_transform()

virtual Eigen::MatrixXd cmp::scaler::Scaler::fit_transform ( const Eigen::Ref< const Eigen::MatrixXd > &  data)
pure virtual

Fits the scaling parameters to the data and subsequently transforms the data.

Parameters
dataA matrix \( X \in \mathbb{R}^{n \times d} \) of training samples.
Returns
The transformed dataset matrix \( Y \).

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.

◆ getIntercept()

virtual Eigen::VectorXd cmp::scaler::Scaler::getIntercept ( ) const
pure virtual

Retrieves the intercept vector \( \mu \) used in the transformation.

Returns
The intercept vector.

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.

◆ getScale()

virtual Eigen::MatrixXd cmp::scaler::Scaler::getScale ( ) const
pure virtual

Retrieves the scaling matrix \( S \) used in the transformation.

Returns
The scaling matrix.

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.

◆ inverseTransform()

virtual Eigen::VectorXd cmp::scaler::Scaler::inverseTransform ( const Eigen::Ref< const Eigen::VectorXd > &  data) const
pure virtual

Reconstructs the data from the scaled latent space back to physical space.

Parameters
dataA column vector \( y \) in the scaled space.
Returns
The unscaled physical data vector \( x \).

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.

◆ transform()

virtual Eigen::VectorXd cmp::scaler::Scaler::transform ( const Eigen::Ref< const Eigen::VectorXd > &  data) const
pure virtual

Transforms the input data from physical space to the scaled latent space.

Parameters
dataA column vector \( x \) representing a single data point in physical space.
Returns
The scaled data vector \( y \).

Implemented in cmp::scaler::StandardScaler, cmp::scaler::PCA, cmp::scaler::DummyScaler, cmp::scaler::EllipticScaler, and cmp::scaler::MinMaxScaler.


The documentation for this class was generated from the following file: