dai::Evidence Class Reference

Stores a data set consisting of multiple samples, where each sample is the observed joint state of some variables. More...

#include <dai/evidence.h>

List of all members.

Iterator interface

typedef std::vector
< Observation >::iterator 
iterator
 Iterator over the samples.
typedef std::vector
< Observation >
::const_iterator 
const_iterator
 Constant iterator over the samples.
iterator begin ()
 Returns iterator that points to the first sample.
const_iterator begin () const
 Returns constant iterator that points to the first sample.
iterator end ()
 Returns iterator that points beyond the last sample.
const_iterator end () const
 Returns constant iterator that points beyond the last sample.

Public Types

typedef std::map< Var, size_t > Observation
 Stores joint state of a set of variables.

Public Member Functions

 Evidence ()
 Default constructor.
 Evidence (std::vector< Observation > &samples)
 Construct from samples.
void addEvidenceTabFile (std::istream &is, FactorGraph &fg)
 Read in tabular data from a stream and add the read samples to *this.
size_t nrSamples () const
 Returns number of stored samples.

Private Member Functions

void addEvidenceTabFile (std::istream &is, std::map< std::string, Var > &varMap)
 Read in tabular data from a stream and add the read samples to *this.

Private Attributes

std::vector< Observation_samples
 Each sample is an observed joint state of some variables.


Detailed Description

Stores a data set consisting of multiple samples, where each sample is the observed joint state of some variables.

Note:
Each sample can describe the joint state of a different set of variables, in order to be able to deal with missing data.
Author:
Charles Vaske
Examples:

example_sprinkler_em.cpp.


Member Typedef Documentation

typedef std::map<Var, size_t> dai::Evidence::Observation

Stores joint state of a set of variables.

Iterator over the samples.

Constant iterator over the samples.


Constructor & Destructor Documentation

dai::Evidence::Evidence (  )  [inline]

Default constructor.

dai::Evidence::Evidence ( std::vector< Observation > &  samples  )  [inline]

Construct from samples.


Member Function Documentation

void dai::Evidence::addEvidenceTabFile ( std::istream &  is,
FactorGraph fg 
)

Read in tabular data from a stream and add the read samples to *this.

Parameters:
is Input stream in .tab file format, describing joint observations of variables in fg
fg Factor graph describing the corresponding variables
See also:
Evidence (.tab) file format
Exceptions:
INVALID_EVIDENCE_FILE if the input stream is not valid
Examples:
example_sprinkler_em.cpp.

size_t dai::Evidence::nrSamples (  )  const [inline]

Returns number of stored samples.

Examples:
example_sprinkler_em.cpp.

iterator dai::Evidence::begin (  )  [inline]

Returns iterator that points to the first sample.

const_iterator dai::Evidence::begin (  )  const [inline]

Returns constant iterator that points to the first sample.

iterator dai::Evidence::end (  )  [inline]

Returns iterator that points beyond the last sample.

const_iterator dai::Evidence::end (  )  const [inline]

Returns constant iterator that points beyond the last sample.

void dai::Evidence::addEvidenceTabFile ( std::istream &  is,
std::map< std::string, Var > &  varMap 
) [private]

Read in tabular data from a stream and add the read samples to *this.


Member Data Documentation

std::vector<Observation> dai::Evidence::_samples [private]

Each sample is an observed joint state of some variables.


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

Generated on Thu Aug 5 19:04:05 2010 for libDAI by  doxygen 1.5.5