edu.ucla.belief.learn
Class LearningDataOld

Object
  extended by LearningDataOld

public class LearningDataOld
extends Object

A structure that contains a list of evidence mappings.


Constructor Summary
LearningDataOld(Collection vars)
          Creates an empty LearningDataOld list.
 
Method Summary
 boolean add(Map record)
          Adds an evidence record to the list.
static String canonical(Object o)
           
 FiniteVariable getDebugVariable()
           
 boolean isComplete()
          Determines if every evidence map in list contains an instantiation of every variable.
 boolean isComplete(Set vars)
          Determines if every evidence map in list contains an instantiation of every variable in subset "vars".
 boolean isEmpty()
          Determines if list is empty.
 Iterator iterator()
          Returns an iterator over the evidence in the list.
 int numRecords()
          Returns the number of evidence Maps in list.
 void readData(File infile, BeliefNetwork bn)
          Reads data from a Hugin-style plain text "case" file.
 int removeIncomplete()
          Removes all records that do not contain a complete instantiation of the variables.
 int removeIncomplete(Set vars)
          Removes all records that do not contain a complete instantiation of the subset "vars".
 String valuesToString(Map map)
           
 Set variables()
          Returns the set of variables.
 void writeData(File outfile)
          Writes data to a Hugin-style plain text "case" file.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LearningDataOld

public LearningDataOld(Collection vars)
Creates an empty LearningDataOld list.

Parameters:
vars - The set of FiniteVariables that the data will contain evidence about.
Method Detail

valuesToString

public String valuesToString(Map map)

canonical

public static String canonical(Object o)

getDebugVariable

public FiniteVariable getDebugVariable()

readData

public void readData(File infile,
                     BeliefNetwork bn)
              throws IOException,
                     RuntimeException
Reads data from a Hugin-style plain text "case" file. The variables listed in the file must contain all of the variables in LearningDataOld. Erroneous records are ignored.

Throws:
IOException
RuntimeException

writeData

public void writeData(File outfile)
               throws IOException
Writes data to a Hugin-style plain text "case" file.

Throws:
IOException

variables

public Set variables()
Returns the set of variables.


iterator

public Iterator iterator()
Returns an iterator over the evidence in the list.


add

public boolean add(Map record)
Adds an evidence record to the list.


numRecords

public int numRecords()
Returns the number of evidence Maps in list.


isEmpty

public boolean isEmpty()
Determines if list is empty.


isComplete

public boolean isComplete()
Determines if every evidence map in list contains an instantiation of every variable.


isComplete

public boolean isComplete(Set vars)
Determines if every evidence map in list contains an instantiation of every variable in subset "vars".

Parameters:
vars - A subset of LearningDataOld's variables.

removeIncomplete

public int removeIncomplete()
Removes all records that do not contain a complete instantiation of the variables.


removeIncomplete

public int removeIncomplete(Set vars)
Removes all records that do not contain a complete instantiation of the subset "vars".

Parameters:
vars - A subset of LearningDataOld's variables.


Copyright 2010 UCLA Automated Reasoning Group