k2
Class NIJValues

java.lang.Object
  |
  +--k2.NIJValues

public class NIJValues
extends java.lang.Object


Constructor Summary
NIJValues(int[][] originalData, Node node, java.util.Vector parents, BBN network)
          constructor sets up the node vector and other internal variables.
 
Method Summary
 int[][] getData()
          getData returns the data array
 int getIndex(int[] values)
          getIndex returns the CPT index value given the node state configuration.
 Node[] getNodes()
          getNodes returns all of the parents with the node appended at the end.
 int getNumberOfProbabilities()
          getNumberOfProbabilities returns the number of probabilities.
 int getValue(int[] values)
          getValue returns the number of times the given node state configuration appears in the data.
 int getValue(java.lang.Integer key)
          getValue returns the already-computed state configuration index instance count.
 int getValueForAllNodeStates(int[] parentConfiguration)
          Iterates through all node states and counts how many times it appears for the given parent configuration.
 java.util.Hashtable getValuesHash()
          getValuesHash gets the hash table for all of the node state instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NIJValues

public NIJValues(int[][] originalData,
                 Node node,
                 java.util.Vector parents,
                 BBN network)
constructor sets up the node vector and other internal variables.
Parameters:
originalData - - the original unmodified data set.
node - - the node that we're computing for.
parents - - the potential parents for this node
network - - used to build our own data array. (we simply copy n array indices, where n is the number of parents + 1.)
Method Detail

getNodes

public Node[] getNodes()
getNodes returns all of the parents with the node appended at the end.
Returns:
Vector - the nodes.

getNumberOfProbabilities

public int getNumberOfProbabilities()
getNumberOfProbabilities returns the number of probabilities.
Returns:
double - the number of probabilities.

getData

public int[][] getData()
getData returns the data array
Returns:
int[][] - the data array

getValuesHash

public java.util.Hashtable getValuesHash()
getValuesHash gets the hash table for all of the node state instances.
Returns:
Hashtable - the hashtable

getIndex

public int getIndex(int[] values)
getIndex returns the CPT index value given the node state configuration.
Parameters:
values - - the array of state values
Returns:
int - the index

getValue

public int getValue(int[] values)
getValue returns the number of times the given node state configuration appears in the data.
Parameters:
values - - the node state configuration.
Returns:
int - the number of times they appear.

getValue

public int getValue(java.lang.Integer key)
getValue returns the already-computed state configuration index instance count.
Parameters:
key- - the CPT index
Returns:
int - the number of times they appear.

getValueForAllNodeStates

public int getValueForAllNodeStates(int[] parentConfiguration)
Iterates through all node states and counts how many times it appears for the given parent configuration.
Parameters:
parentConfiguration - - the state indices for the parents.
Returns:
int - the number of times they appear.