Package weka.classifiers.bayes.net
Class ADNode
- java.lang.Object
-
- weka.classifiers.bayes.net.ADNode
-
- All Implemented Interfaces:
java.io.Serializable,RevisionHandler,TechnicalInformationHandler
public class ADNode extends java.lang.Object implements java.io.Serializable, TechnicalInformationHandler, RevisionHandler
The ADNode class implements the ADTree datastructure which increases the speed with which sub-contingency tables can be constructed from a data set in an Instances object. For details, see: Andrew W. Moore, Mary S. Lee (1998). Cached Sufficient Statistics for Efficient Machine Learning with Large Datasets. Journal of Artificial Intelligence Research. 8:67-91. BibTeX:@article{Moore1998, author = {Andrew W. Moore and Mary S. Lee}, journal = {Journal of Artificial Intelligence Research}, pages = {67-91}, title = {Cached Sufficient Statistics for Efficient Machine Learning with Large Datasets}, volume = {8}, year = {1998} }- Version:
- $Revision: 10153 $
- Author:
- Remco Bouckaert (rrb@xm.co.nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description Instance[]m_Instanceslist of Instance children (either m_Instances or m_VaryNodes is instantiated)intm_nCountcountintm_nStartNodefirst node in VaryNode arrayVaryNode[]m_VaryNodeslist of VaryNode children
-
Constructor Summary
Constructors Constructor Description ADNode()Creates new ADNode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgetCounts(int[] nCounts, int[] nNodes, int[] nOffsets, int iNode, int iOffset, boolean bSubstract)get counts for specific instantiation of a set of nodesjava.lang.StringgetRevision()Returns the revision string.TechnicalInformationgetTechnicalInformation()Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.static voidmain(java.lang.String[] argv)for testing onlystatic ADNodemakeADTree(int iNode, java.util.ArrayList<java.lang.Integer> nRecords, Instances instances)create sub treestatic ADNodemakeADTree(Instances instances)create AD tree from set of instancesstatic VaryNodemakeVaryNode(int iNode, java.util.ArrayList<java.lang.Integer> nRecords, Instances instances)create sub treevoidprint()print is used for debugging only and shows the ADTree in ASCII graphics
-
-
-
Field Detail
-
m_VaryNodes
public VaryNode[] m_VaryNodes
list of VaryNode children
-
m_Instances
public Instance[] m_Instances
list of Instance children (either m_Instances or m_VaryNodes is instantiated)
-
m_nCount
public int m_nCount
count
-
m_nStartNode
public int m_nStartNode
first node in VaryNode array
-
-
Method Detail
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.- Specified by:
getTechnicalInformationin interfaceTechnicalInformationHandler- Returns:
- the technical information about this class
-
makeVaryNode
public static VaryNode makeVaryNode(int iNode, java.util.ArrayList<java.lang.Integer> nRecords, Instances instances)
create sub tree- Parameters:
iNode- index of the lowest node in the treenRecords- set of records in instances to be consideredinstances- data set- Returns:
- VaryNode representing part of an ADTree
-
makeADTree
public static ADNode makeADTree(int iNode, java.util.ArrayList<java.lang.Integer> nRecords, Instances instances)
create sub tree- Parameters:
iNode- index of the lowest node in the treenRecords- set of records in instances to be consideredinstances- data set- Returns:
- ADNode representing an ADTree
-
makeADTree
public static ADNode makeADTree(Instances instances)
create AD tree from set of instances- Parameters:
instances- data set- Returns:
- ADNode representing an ADTree
-
getCounts
public void getCounts(int[] nCounts, int[] nNodes, int[] nOffsets, int iNode, int iOffset, boolean bSubstract)get counts for specific instantiation of a set of nodes- Parameters:
nCounts- - array for storing countsnNodes- - array of node indexesnOffsets- - offset for nodes in nNodes in nCountsiNode- - index into nNode indicating current nodeiOffset- - Offset into nCounts due to nodes below iNodebSubstract- - indicate whether counts should be added or substracted
-
print
public void print()
print is used for debugging only and shows the ADTree in ASCII graphics
-
main
public static void main(java.lang.String[] argv)
for testing only- Parameters:
argv- the commandline options
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-