CFEngine API

org.recommender.algorithms.Experimental
Class ContinuousDecisionTree

java.lang.Object
  |
  +--org.recommender.algorithms.Experimental.ContinuousDecisionTree

public class ContinuousDecisionTree
extends java.lang.Object

Helps parse a decision tree by processing begin/end element events. Works with continuous probability distributions, represented as binary Gaussians, rather than multinomials. Stores a representation of the decision tree in memory.

Author:
Daniel Lowd <dlowd@cs.orst.edu>

Field Summary
(package private)  BinGaussian currBinGaussian
           
(package private)  org.recommender.algorithms.Experimental.ContinuousDecisionTree.Branch currBranch
           
(package private)  float currMean
           
(package private)  float currProbMissing
           
(package private)  float currSD
           
(package private)  org.recommender.algorithms.Experimental.ContinuousDecisionTree.Vertex currVertex
           
(package private)  org.recommender.algorithms.Experimental.ContinuousDecisionTree.Vertex headVertex
           
(package private)  java.util.ArrayList inputVars
           
(package private)  java.util.HashMap inputVarStates
           
(package private)  int printIndent
           
 
Constructor Summary
ContinuousDecisionTree()
          Construct a ContinuousDecisionTree with the given input variables.
 
Method Summary
 void beginBranch()
          Method called when a <Branch> tag is encountered.
 void beginVertex(StartElementEvent vertex)
          Method called when a <Vertex> tag is encountered.
 void endBinGaussian()
          Method called when a <BinGaussian> tag is encountered.
 void endBranch()
          Method called when a </Branch> tag is encountered.
 void endMean(java.lang.String contents)
          Method called when a </Mean> tag is encountered.
 void endProbMissing(java.lang.String contents)
          Method called when a </ProbMissing> tag is encountered.
 void endSD(java.lang.String contents)
          Method called when a </SD> tag is encountered.
 void endValues(java.lang.String values)
          Method called when a </Values> tag is encountered.
 void endVertex()
          Method called when a </Vertex> tag is encountered.
 float getProb(float state, float[] allStates)
          Returns the relative probability that this variable is in a specified state, given the states of all other variables in the network.
protected  java.lang.String tabs()
           
 java.lang.String toString()
          Convert this object to a String representation, in XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inputVars

java.util.ArrayList inputVars

inputVarStates

java.util.HashMap inputVarStates

headVertex

org.recommender.algorithms.Experimental.ContinuousDecisionTree.Vertex headVertex

currVertex

org.recommender.algorithms.Experimental.ContinuousDecisionTree.Vertex currVertex

currBranch

org.recommender.algorithms.Experimental.ContinuousDecisionTree.Branch currBranch

currBinGaussian

BinGaussian currBinGaussian

currMean

float currMean

currSD

float currSD

currProbMissing

float currProbMissing

printIndent

int printIndent
Constructor Detail

ContinuousDecisionTree

public ContinuousDecisionTree()
Construct a ContinuousDecisionTree with the given input variables.

Method Detail

getProb

public float getProb(float state,
                     float[] allStates)
Returns the relative probability that this variable is in a specified state, given the states of all other variables in the network. If the state is NaN, this is the probability that the variable is missing. Otherwise, it is the probability density function of the distribution evaluated at the target value. prob state the potential state of this decision tree's variable. prob allStates array of integers specifying the state of each other variable. allStates[i] = the state of variable i.


beginVertex

public void beginVertex(StartElementEvent vertex)
Method called when a <Vertex> tag is encountered. Creates a new vertex as the child of the current branch.


endVertex

public void endVertex()
Method called when a </Vertex> tag is encountered. Ends the current vertex and moves up in the tree.


beginBranch

public void beginBranch()
Method called when a <Branch> tag is encountered. Creates a new branch as the child of the current vertex.


endValues

public void endValues(java.lang.String values)
Method called when a </Values> tag is encountered. Sets the values of the current branch to those provided.

Parameters:
values - contents of the <Values> tag

endBranch

public void endBranch()
Method called when a </Branch> tag is encountered.


endMean

public void endMean(java.lang.String contents)
Method called when a </Mean> tag is encountered.


endSD

public void endSD(java.lang.String contents)
Method called when a </SD> tag is encountered.


endProbMissing

public void endProbMissing(java.lang.String contents)
Method called when a </ProbMissing> tag is encountered.


endBinGaussian

public void endBinGaussian()
Method called when a <BinGaussian> tag is encountered.


toString

public java.lang.String toString()
Convert this object to a String representation, in XML. Contains all information necessary to reconstruct a complete decision tree.

Overrides:
toString in class java.lang.Object

tabs

protected java.lang.String tabs()

CFEngine API

Copyright © 2003 - Oregon State University www.orst.edu