1#ifndef FSTDATASCALERTO01_H
2#define FSTDATASCALERTO01_H
100template<
typename DATATYPE>
110 virtual void learn(
const DATATYPE& value)
override;
112 virtual DATATYPE
scale(
const DATATYPE& value)
override;
132template<
typename DATATYPE>
145template<
typename DATATYPE>
158template<
typename DATATYPE>
Implements data normalization (of all feature values) to interval [0,1].
Definition data_scaler_to01.hpp:101
bool first_learn
true until the first learn() call of the current pass has initialized min/max
Definition data_scaler_to01.hpp:120
virtual bool startNextLoop() override
one pass is always enough
Definition data_scaler_to01.hpp:109
virtual int learn_loops() const override
one pass suffices: min, max and the mean are all accumulated together
Definition data_scaler_to01.hpp:107
Data_Scaler_to01(const DATATYPE missing_val_code, const int dims)
values equal to missing_val_code are substituted by the per-feature mean; dims must be 1
Definition data_scaler_to01.hpp:104
virtual std::ostream & print(std::ostream &os) const override
writes a human-readable identification of the scaler and its configuration; base default writes nothi...
Definition data_scaler_to01.hpp:117
virtual void scale_inplace(DATATYPE &value) override
the in-place form of scale()
Definition data_scaler_to01.hpp:159
Data_Scaler_to01(const int dims=1)
no missing-value substitution; dims must be 1
Definition data_scaler_to01.hpp:103
DATATYPE sum
running sum of non-missing values, used to derive avg
Definition data_scaler_to01.hpp:128
long count
number of non-missing values fed to learn() for the current feature
Definition data_scaler_to01.hpp:127
const DATATYPE _missing_val_code
the numerical code that marks a missing value (only meaningful when missing_values is true)
Definition data_scaler_to01.hpp:126
virtual Data_Scaler_to01 * duplicate() const override
Definition data_scaler_to01.hpp:115
DATATYPE min
minimum non-missing value seen for the current feature
Definition data_scaler_to01.hpp:121
virtual DATATYPE scale(const DATATYPE &value) override
returns (value-min)/(max-min); the mean's scaled position for a missing value; 0 if the feature is co...
Definition data_scaler_to01.hpp:146
Data_Scaler_to01(const Data_Scaler_to01 &ds)
copies configuration and any already-learned statistics
Definition data_scaler_to01.hpp:105
virtual void learn(const DATATYPE &value) override
accumulates value into the per-feature min, max and mean, unless it is the missing-value code
Definition data_scaler_to01.hpp:133
DATATYPE max
maximum non-missing value seen for the current feature
Definition data_scaler_to01.hpp:122
bool missing_values
whether values equal to _missing_val_code are substituted rather than learned/scaled normally
Definition data_scaler_to01.hpp:125
DATATYPE avg
running mean of non-missing values (sum/count); substituted, then scaled, for missing entries
Definition data_scaler_to01.hpp:129
virtual bool startFirstLoop() override
resets the per-feature accumulators and requests the single pass
Definition data_scaler_to01.hpp:108
Data_Scaler(const int dims=1)
Definition data_scaler.hpp:97
FST4 specific error passing class.
Definition error.hpp:61
Defines interface for data scaling implementations (for use in data accessors).
FST4 specific error passing class.
The Feature Selection Toolbox 4 library: every library component – data access, criteria and classifi...
Definition data_accessor.hpp:80
void notify(const std::string msg)
Prints msg followed by a newline via syncout::print(); a no-op unless the preprocessor macro DEBUG is...
Definition global.hpp:112