iCub-main
|
A class that implements standardization as a preprocessing step. More...
#include <Standardizer.h>
Public Member Functions | |
Standardizer (double m=0., double s=1.) | |
Constructor. | |
virtual void | update (double val) |
Feeds a single sample into the scaler, so that it can use this sample to update the offset and scale. | |
virtual std::string | getInfo () |
Asks the learning machine to return a string containing statistics on its operation so far. | |
virtual bool | configure (yarp::os::Searchable &config) |
Standardizer * | clone () |
Asks the scaler to return a new object of its type. | |
virtual double | getDesiredMean () |
Accessor for the desired mean. | |
virtual void | setDesiredMean (double m) |
Mutator for the desired mean. | |
virtual double | getDesiredStd () |
Accessor for the desired standard deviation. | |
virtual void | setDesiredStd (double s) |
Mutator for the desired standard deviation. | |
Public Member Functions inherited from iCub::learningmachine::IScaler | |
IScaler (double s=1., double o=0.) | |
Constructor. | |
virtual | ~IScaler () |
Destructor (empty). | |
virtual double | transform (double val) |
Transforms a single sample value according to the state of the scaler. | |
virtual double | unTransform (double val) |
Untransforms a single sample value according to the state of the scaler. | |
std::string | getName () const |
Retrieve the name of this scaler. | |
void | setName (std::string name) |
Set the name of this machine learning technique. | |
virtual void | setUpdateEnabled (bool u) |
Mutator for the update state. | |
virtual bool | getUpdateEnabled () |
Accessor for the update state. | |
virtual std::string | toString () |
Asks the scaler to return a string serialization. | |
virtual bool | fromString (const std::string &str) |
Asks the scaler to initialize from a string serialization. | |
Protected Member Functions | |
virtual void | writeBottle (yarp::os::Bottle &bot) |
Writes a serialization of the scaler into a bottle. | |
virtual void | readBottle (yarp::os::Bottle &bot) |
Unserializes a scaler from a bottle. | |
Protected Attributes | |
int | noSamples |
The number of samples that have been received so far. | |
double | mean |
Desired mean for the output distribution. | |
double | std |
Desired standard deviation for the output distribution. | |
double | runningMean |
Running mean based on the samples seen so far. | |
double | runningStd |
Running standard deviation based on the samples seen so far. | |
double | squaredErrors |
Temporary variable that counts the sum of the squared errors. | |
Protected Attributes inherited from iCub::learningmachine::IScaler | |
double | offset |
The offset for the linear transformation. | |
double | scale |
The scale for the linear transformation. | |
std::string | name |
The name of this type of scaler. | |
bool | updateEnabled |
Boolean indicating whether the scaler has to update each sample. | |
A class that implements standardization as a preprocessing step.
Standardization is the process of converting all samples such that the set has a zero mean and unit standard deviation. In this particular implementation both the mean and standard deviation are calculated using a 'running' computation.
Definition at line 43 of file Standardizer.h.
iCub::learningmachine::Standardizer::Standardizer | ( | double | m = 0. , |
double | s = 1. |
||
) |
Constructor.
m | desired output mean |
s | desired output standard deviation |
Definition at line 32 of file Standardizer.cpp.
|
inlinevirtual |
Asks the scaler to return a new object of its type.
Implements iCub::learningmachine::IScaler.
Definition at line 112 of file Standardizer.h.
|
virtual |
Reimplemented from iCub::learningmachine::IScaler.
Definition at line 80 of file Standardizer.cpp.
|
inlinevirtual |
Accessor for the desired mean.
Definition at line 119 of file Standardizer.h.
|
inlinevirtual |
Accessor for the desired standard deviation.
Definition at line 131 of file Standardizer.h.
|
virtual |
Asks the learning machine to return a string containing statistics on its operation so far.
Reimplemented from iCub::learningmachine::IScaler.
Definition at line 56 of file Standardizer.cpp.
|
protectedvirtual |
Unserializes a scaler from a bottle.
bot | the bottle |
Reimplemented from iCub::learningmachine::IScaler.
Definition at line 72 of file Standardizer.cpp.
|
inlinevirtual |
Mutator for the desired mean.
m | the new mean |
Definition at line 126 of file Standardizer.h.
|
inlinevirtual |
Mutator for the desired standard deviation.
s | the new standard deviation |
Definition at line 138 of file Standardizer.h.
|
virtual |
Feeds a single sample into the scaler, so that it can use this sample to update the offset and scale.
value | the sample value |
Reimplemented from iCub::learningmachine::IScaler.
Definition at line 39 of file Standardizer.cpp.
|
protectedvirtual |
Writes a serialization of the scaler into a bottle.
bot | the bottle |
Reimplemented from iCub::learningmachine::IScaler.
Definition at line 64 of file Standardizer.cpp.
|
protected |
Desired mean for the output distribution.
Definition at line 53 of file Standardizer.h.
|
protected |
The number of samples that have been received so far.
Definition at line 48 of file Standardizer.h.
|
protected |
Running mean based on the samples seen so far.
Definition at line 63 of file Standardizer.h.
|
protected |
Running standard deviation based on the samples seen so far.
Definition at line 68 of file Standardizer.h.
|
protected |
Temporary variable that counts the sum of the squared errors.
Definition at line 73 of file Standardizer.h.
|
protected |
Desired standard deviation for the output distribution.
Definition at line 58 of file Standardizer.h.