Package edu.pitt.isp.sverchkov.data
Class AdTree<A,V>
java.lang.Object
edu.pitt.isp.sverchkov.data.AdTree<A,V>
- Type Parameters:
A
- Attribute typeV
- Value type
- All Implemented Interfaces:
Serializable
An implementation of a static AD tree based on Moore and Lee 1998 (mostly)
Indexing of the variables works backwards: (a_i can't have children a_i ... a_m) ... not that that difference is visible in the API.
- Author:
- jdramsey
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
count
(int[] assignment, edu.pitt.isp.sverchkov.data.AdTreeHelper.CountNode ptr) Constructs an AD tree helper for the given data set.int
Returns the number of rows in the data set.Returns the number of rows in the data set.toXML()
Converts to XML.toXML
(DocumentBuilder builder) Converts to XML.Returns the number of rows in the data set.
-
Field Details
-
m
protected final int mThe number of attributes. -
airities
protected final int[] airitiesThe airities of the attributes. The i-th element of this array is the airity of the i-th attribute.
-
-
Constructor Details
-
AdTree
Constructs an AD tree for the given data set.- Parameters:
data
- The data set.
-
-
Method Details
-
values
Returns the number of rows in the data set.- Parameters:
attribute
- The attribute to count.- Returns:
- The number of rows in the data set.
-
count
Returns the number of rows in the data set.- Parameters:
assignment
- The assignment to count.- Returns:
- The number of rows in the data set.
-
counts
Returns the number of rows in the data set.- Parameters:
attribute
- The attribute to count.assignment
- The assignment to count.- Returns:
- The number of rows in the data set.
-
toXML
Converts to XML.- Returns:
- The XML document.
- Throws:
ParserConfigurationException
- if something goes wrong
-
toXML
Converts to XML.- Parameters:
builder
- The builder.- Returns:
- The XML document.
-
count
protected int count(int[] assignment, edu.pitt.isp.sverchkov.data.AdTreeHelper.CountNode ptr) Constructs an AD tree helper for the given data set.- Parameters:
assignment
- The assignment of values to attributes.ptr
- The root of the AD tree.- Returns:
- The number of instances in the data set that match the given assignment.
-