|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.recommender.algorithms.Experimental.DecisionTree
Helps parse a decision tree by processing begin/end element events. Stores a representation of the decision tree in memory.
Field Summary | |
(package private) org.recommender.algorithms.Experimental.DecisionTree.Branch |
currBranch
|
(package private) Multinomial |
currMultinomial
|
(package private) org.recommender.algorithms.Experimental.DecisionTree.Vertex |
currVertex
Keep track of current position in the tree, as it is built. |
(package private) org.recommender.algorithms.Experimental.DecisionTree.Vertex |
headVertex
Top level vertex, before any branches. |
(package private) java.util.ArrayList |
inputVars
ArrayList of input variable names |
(package private) java.util.HashMap |
inputVarStates
HashMap of LinkedLists of state indices for the input variables |
Constructor Summary | |
DecisionTree()
Construct a DecisionTree with the given input variables. |
Method Summary | |
void |
beginBranch()
Method called when a <Branch> tag is encountered. |
void |
beginMultinomial()
Method called when a <Multinomial> tag is encountered. |
void |
beginVertex(StartElementEvent vertex)
Method called when a <Vertex> tag is encountered. |
void |
endBranch()
Method called when a </Branch> tag is encountered. |
void |
endProbs(java.lang.String probs)
Method called when a </Probs> 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(int state,
int[] allStates)
Returns the probability that this variable is in a specified state, given the states of all other variables in the network. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.util.ArrayList inputVars
java.util.HashMap inputVarStates
org.recommender.algorithms.Experimental.DecisionTree.Vertex headVertex
org.recommender.algorithms.Experimental.DecisionTree.Vertex currVertex
org.recommender.algorithms.Experimental.DecisionTree.Branch currBranch
Multinomial currMultinomial
Constructor Detail |
public DecisionTree()
Method Detail |
public float getProb(int state, int[] allStates)
state
- the potential state of this decision tree's variable.allStates
- array of integers specifying the state of each
other variable. allStates[i] = the state of variable i.
public void beginVertex(StartElementEvent vertex)
vertex
- public void endVertex()
public void beginBranch()
public void endValues(java.lang.String values)
values
- public void endBranch()
public void beginMultinomial()
public void endProbs(java.lang.String probs)
probs
- pcdata contents of the <Probs> tag.
|
CFEngine API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |