|
| | MinMaxScaler (const double min=0, const double max=1) |
| | Default constructor. More...
|
| |
| template<typename MatType > |
| void | Fit (const MatType &input) |
| | Function to fit features, to find out the min max and scale. More...
|
| |
| template<typename MatType > |
| void | Transform (const MatType &input, MatType &output) |
| | Function to scale features. More...
|
| |
| template<typename MatType > |
| void | InverseTransform (const MatType &input, MatType &output) |
| | Function to retrieve original dataset. More...
|
| |
|
const arma::vec & | ItemMin () const |
| | Get the Min row vector.
|
| |
|
const arma::vec & | ItemMax () const |
| | Get the Max row vector.
|
| |
|
const arma::vec & | Scale () const |
| | Get the Scale row vector.
|
| |
|
double | ScaleMax () const |
| | Get the upper range parameter.
|
| |
|
double | ScaleMin () const |
| | Get the lower range parameter.
|
| |
|
template<typename Archive > |
| void | serialize (Archive &ar, const uint32_t) |
| |
A simple MinMax Scaler class.
Given an input dataset this class helps you to scale each feature to a given range.
[z = scale * x + scaleMin - min(x) * scale] [scale = (scaleMax - scaleMin) / (max(x) - min(x))]
where scaleMin, scaleMax = feature_range and min(x), max(x) are the minimum and maximum value of x respectively.
arma::mat input;
Load(
"train.csv", input);
arma::mat output;
scale.Fit(input)
scale.Transform(input, output);
scale.InverseTransform(output, input);