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

A class that represents a prediction result. More...

#include <Prediction.h>

+ Inheritance diagram for iCub::learningmachine::Prediction:

Public Member Functions

 Prediction ()
 Empty constructor. More...
 
 Prediction (const yarp::sig::Vector &prediction)
 Constructor for expected value prediction without predictive variance. More...
 
 Prediction (const yarp::sig::Vector &prediction, const yarp::sig::Vector &variance)
 Constructor for expected value prediction with predictive variance. More...
 
unsigned int size ()
 Returns the size of the prediction. More...
 
yarp::sig::Vector getPrediction ()
 Accessor for the expected value of the prediction. More...
 
void setPrediction (const yarp::sig::Vector &prediction)
 Mutator for the expected value of the prediction. More...
 
yarp::sig::Vector getVariance ()
 Accessor for the variance of the prediction. More...
 
void setVariance (const yarp::sig::Vector &variance)
 Mutator for the variance of the prediction. More...
 
bool hasVariance ()
 Indicator whether the prediction contains a predicted variance. More...
 
std::string toString ()
 Returns a string represenation of the prediction. More...
 
bool write (yarp::os::ConnectionWriter &connection) const
 
bool read (yarp::os::ConnectionReader &connection)
 
virtual void onCompletion ()
 

Protected Attributes

yarp::sig::Vector prediction
 Expected value of the prediction. More...
 
yarp::sig::Vector variance
 Optional variance of the prediction, measured as a unit standard deviation. More...
 
bool varianceSet
 Indicator whether prediction variance is available. More...
 

Detailed Description

A class that represents a prediction result.

The serialization of this class is compatible with PortablePair<Vector,Vector>, such that standard Yarp classes can be used to read a Prediction from the network.

Author
Arjan Gijsberts

Definition at line 44 of file Prediction.h.

Constructor & Destructor Documentation

◆ Prediction() [1/3]

iCub::learningmachine::Prediction::Prediction ( )
inline

Empty constructor.

Definition at line 65 of file Prediction.h.

◆ Prediction() [2/3]

iCub::learningmachine::Prediction::Prediction ( const yarp::sig::Vector &  prediction)
inline

Constructor for expected value prediction without predictive variance.

Parameters
predictionthe predicted expected value
variancethe predicted expected variance in terms of a unit standard deviation

Definition at line 77 of file Prediction.h.

◆ Prediction() [3/3]

iCub::learningmachine::Prediction::Prediction ( const yarp::sig::Vector &  prediction,
const yarp::sig::Vector &  variance 
)
inline

Constructor for expected value prediction with predictive variance.

Parameters
predictionthe predicted expected value

Definition at line 87 of file Prediction.h.

Member Function Documentation

◆ getPrediction()

yarp::sig::Vector iCub::learningmachine::Prediction::getPrediction ( )
inline

Accessor for the expected value of the prediction.

Returns
the predicted expected value

Definition at line 106 of file Prediction.h.

◆ getVariance()

yarp::sig::Vector iCub::learningmachine::Prediction::getVariance ( )
inline

Accessor for the variance of the prediction.

More precisely, this returns a predicted unit standard deviation.

Returns
the predicted variance

Definition at line 125 of file Prediction.h.

◆ hasVariance()

bool iCub::learningmachine::Prediction::hasVariance ( )
inline

Indicator whether the prediction contains a predicted variance.

Returns
true if variance is available

Definition at line 146 of file Prediction.h.

◆ onCompletion()

virtual void iCub::learningmachine::Prediction::onCompletion ( )
inlinevirtual

Definition at line 211 of file Prediction.h.

◆ read()

bool iCub::learningmachine::Prediction::read ( yarp::os::ConnectionReader &  connection)
inline

Definition at line 186 of file Prediction.h.

◆ setPrediction()

void iCub::learningmachine::Prediction::setPrediction ( const yarp::sig::Vector &  prediction)
inline

Mutator for the expected value of the prediction.

Parameters
predictionthe predicted expected value

Definition at line 115 of file Prediction.h.

◆ setVariance()

void iCub::learningmachine::Prediction::setVariance ( const yarp::sig::Vector &  variance)
inline

Mutator for the variance of the prediction.

Parameters
variancethe predicted expected variance in terms of a unit standard deviation

Definition at line 135 of file Prediction.h.

◆ size()

unsigned int iCub::learningmachine::Prediction::size ( )
inline

Returns the size of the prediction.

Returns
the size

Definition at line 97 of file Prediction.h.

◆ toString()

std::string iCub::learningmachine::Prediction::toString ( )
inline

Returns a string represenation of the prediction.

Returns
a string represenation of the prediction

Definition at line 155 of file Prediction.h.

◆ write()

bool iCub::learningmachine::Prediction::write ( yarp::os::ConnectionWriter &  connection) const
inline

Definition at line 166 of file Prediction.h.

Member Data Documentation

◆ prediction

yarp::sig::Vector iCub::learningmachine::Prediction::prediction
protected

Expected value of the prediction.

Definition at line 49 of file Prediction.h.

◆ variance

yarp::sig::Vector iCub::learningmachine::Prediction::variance
protected

Optional variance of the prediction, measured as a unit standard deviation.

Definition at line 54 of file Prediction.h.

◆ varianceSet

bool iCub::learningmachine::Prediction::varianceSet
protected

Indicator whether prediction variance is available.

Definition at line 59 of file Prediction.h.


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