Dakota
Version 6.19
Explore and Predict with Confidence
|
The DataScaler class computes the scaling coefficients and scales a 2D data matrix with dimensions num_samples by num_features. More...
Public Types | |
enum | SCALER_TYPE { NONE, STANDARDIZATION, MEAN_NORMALIZATION, MINMAX_NORMALIZATION } |
Enumeration for supported types of DataScalers. | |
Public Member Functions | |
void | scale_samples (const MatrixXd &unscaled_samples, MatrixXd &scaled_samples) |
Apply scaling to a set of unscaled samples. More... | |
MatrixXd | scale_samples (const MatrixXd &unscaled_samples) |
Apply scaling to a set of unscaled samples. More... | |
const VectorXd & | get_scaler_features_offsets () const |
Get the vector of offsets. More... | |
const VectorXd & | get_scaler_features_scale_factors () const |
Get the vector of scaling factors. More... | |
bool | check_for_zero_scaler_factor (int index) |
Checks an individual scaler feature scale factor for being close to zero; If it is near zero, we can potentially run into a divide-by-zero error if not handled appropriately. More... | |
Static Public Member Functions | |
static SCALER_TYPE | scaler_type (const std::string &scaler_name) |
Convert scaler name to enum type. More... | |
Protected Attributes | |
bool | hasScaling |
Bool for whether or not the the scaling coefficients have been computed. | |
RowVectorXd | scaledSample |
Vector for a single scaled sample - (num_features); avoids resize memory allocs. | |
VectorXd | scalerFeaturesOffsets |
Vector of offsets - (num_features) | |
VectorXd | scalerFeaturesScaleFactors |
Vector of scaling factors - (num_features) | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Serializer for base class data (call from dervied with base_object) | |
Friends | |
class | boost::serialization::access |
Allow serializers access to private class data. | |
The DataScaler class computes the scaling coefficients and scales a 2D data matrix with dimensions num_samples by num_features.
There are currently 3 scaling options for the DataScaler class:
Apply scaling to a set of unscaled samples.
[in] | unscaled_samples | Unscaled matrix of samples |
[out] | scaled_samples | Scaled matrix of samples |
References DataScaler::check_for_zero_scaler_factor(), DataScaler::scalerFeaturesOffsets, and DataScaler::scalerFeaturesScaleFactors.
Referenced by GaussianProcess::build(), PolynomialRegression::build(), GaussianProcess::covariance(), GaussianProcess::gradient(), PolynomialRegression::gradient(), GaussianProcess::hessian(), PolynomialRegression::hessian(), DataScaler::scale_samples(), GaussianProcess::value(), and PolynomialRegression::value().
Apply scaling to a set of unscaled samples.
[in] | unscaled_samples | Unscaled matrix of samples |
References DataScaler::scale_samples().
|
inline |
Get the vector of offsets.
References DataScaler::scalerFeaturesOffsets.
|
inline |
Get the vector of scaling factors.
References DataScaler::scalerFeaturesScaleFactors.
Referenced by dakota::surrogates::fd_check_gradient(), and dakota::surrogates::fd_check_hessian().
bool check_for_zero_scaler_factor | ( | int | index | ) |
Checks an individual scaler feature scale factor for being close to zero; If it is near zero, we can potentially run into a divide-by-zero error if not handled appropriately.
[in] | index | The scaler feature index to check |
References dakota::near_zero, and DataScaler::scalerFeaturesScaleFactors.
Referenced by DataScaler::scale_samples().
|
static |
Convert scaler name to enum type.
[in] | scaler_name | DataScaler name to map |
References dakota::util::type_name_bimap.
Referenced by GaussianProcess::build(), and PolynomialRegression::build().