iCub-main
Public Member Functions | Protected Member Functions | List of all members
iCub::learningmachine::LinearScaler Class Reference

A class that implements linear scaling as a preprocessing step. More...

#include <LinearScaler.h>

+ Inheritance diagram for iCub::learningmachine::LinearScaler:

Public Member Functions

 LinearScaler (double s=1, double o=0)
 Constructor. More...
 
virtual std::string getInfo ()
 Asks the learning machine to return a string containing statistics on its operation so far. More...
 
virtual bool configure (yarp::os::Searchable &config)
 
LinearScalerclone ()
 Asks the scaler to return a new object of its type. More...
 
virtual double getScale ()
 Accessor for the scaling factor. More...
 
virtual void setScale (double s)
 Mutator for the scaling factor. More...
 
virtual double getOffset ()
 Accessor for the offset. More...
 
virtual void setOffset (double o)
 Mutator for the offset. More...
 
- Public Member Functions inherited from iCub::learningmachine::IScaler
 IScaler (double s=1., double o=0.)
 Constructor. More...
 
virtual ~IScaler ()
 Destructor (empty). More...
 
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. More...
 
virtual double transform (double val)
 Transforms a single sample value according to the state of the scaler. More...
 
virtual double unTransform (double val)
 Untransforms a single sample value according to the state of the scaler. More...
 
std::string getName () const
 Retrieve the name of this scaler. More...
 
void setName (std::string name)
 Set the name of this machine learning technique. More...
 
virtual void setUpdateEnabled (bool u)
 Mutator for the update state. More...
 
virtual bool getUpdateEnabled ()
 Accessor for the update state. More...
 
virtual std::string toString ()
 Asks the scaler to return a string serialization. More...
 
virtual bool fromString (const std::string &str)
 Asks the scaler to initialize from a string serialization. More...
 

Protected Member Functions

virtual void writeBottle (yarp::os::Bottle &bot)
 Writes a serialization of the scaler into a bottle. More...
 
virtual void readBottle (yarp::os::Bottle &bot)
 Unserializes a scaler from a bottle. More...
 

Additional Inherited Members

- Protected Attributes inherited from iCub::learningmachine::IScaler
double offset
 The offset for the linear transformation. More...
 
double scale
 The scale for the linear transformation. More...
 
std::string name
 The name of this type of scaler. More...
 
bool updateEnabled
 Boolean indicating whether the scaler has to update each sample. More...
 

Detailed Description

A class that implements linear scaling as a preprocessing step.

See also
iCub::learningmachine::IScaler
Author
Arjan Gijsberts

Definition at line 38 of file LinearScaler.h.

Constructor & Destructor Documentation

◆ LinearScaler()

iCub::learningmachine::LinearScaler::LinearScaler ( double  s = 1,
double  o = 0 
)

Constructor.

Parameters
sthe scale for the linear transformation
othe offset for the linear transformation

Definition at line 29 of file LinearScaler.cpp.

Member Function Documentation

◆ clone()

LinearScaler* iCub::learningmachine::LinearScaler::clone ( )
inlinevirtual

Asks the scaler to return a new object of its type.

Returns
a fresh instance of the specified type

Implements iCub::learningmachine::IScaler.

Definition at line 72 of file LinearScaler.h.

◆ configure()

bool iCub::learningmachine::LinearScaler::configure ( yarp::os::Searchable &  config)
virtual

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 50 of file LinearScaler.cpp.

◆ getInfo()

std::string iCub::learningmachine::LinearScaler::getInfo ( )
virtual

Asks the learning machine to return a string containing statistics on its operation so far.

Returns
the statistics of the machine

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 34 of file LinearScaler.cpp.

◆ getOffset()

virtual double iCub::learningmachine::LinearScaler::getOffset ( )
inlinevirtual

Accessor for the offset.

Definition at line 91 of file LinearScaler.h.

◆ getScale()

virtual double iCub::learningmachine::LinearScaler::getScale ( )
inlinevirtual

Accessor for the scaling factor.

Definition at line 79 of file LinearScaler.h.

◆ readBottle()

void iCub::learningmachine::LinearScaler::readBottle ( yarp::os::Bottle &  bot)
protectedvirtual

Unserializes a scaler from a bottle.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 45 of file LinearScaler.cpp.

◆ setOffset()

virtual void iCub::learningmachine::LinearScaler::setOffset ( double  o)
inlinevirtual

Mutator for the offset.

Parameters
othe new offset

Definition at line 98 of file LinearScaler.h.

◆ setScale()

virtual void iCub::learningmachine::LinearScaler::setScale ( double  s)
inlinevirtual

Mutator for the scaling factor.

Parameters
sthe new scaling factor

Definition at line 86 of file LinearScaler.h.

◆ writeBottle()

void iCub::learningmachine::LinearScaler::writeBottle ( yarp::os::Bottle &  bot)
protectedvirtual

Writes a serialization of the scaler into a bottle.

Parameters
botthe bottle

Reimplemented from iCub::learningmachine::IScaler.

Definition at line 40 of file LinearScaler.cpp.


The documentation for this class was generated from the following files: