jack06215
2/20/2019 - 6:38 AM

Feature Standardisation

Feature standardardzation is to makes the values of each feature in the data have zero-mean (when subtracting the mean in the numerator) and unit-variance

// declares a matrix with 2 rows and 1 column
typedef dlib::matrix<double, 2, 1> sample_type;
.
.
.
(some middle operations)
.
.
.
// here's how to declare a normalizer in dlib
dlib::vector_normalizer<sample_type> normalizer;

// let the normalizer learn the mean and standard deviation of the samples
normalizer.train(samples);

// now normalize each sample
for (unsigned long i = 0; i < samples.size(); ++i)
    samples[i] = normalizer(samples[i]); 

References: [Wikipedia] [Dlib]