|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.classifiers.aggregators.SharedNodeInfo
public final class SharedNodeInfo
The SharedNodeInfo class is used to cache aggregation statistics for a given node such that multiple aggregators can use the same statistics without having to calculate them more than once.
Currently, it is assumed that aggregators for a specific node is called in a succession before aggregation for a different node in the graph is done. Therefore, I only cache things as long is we are aggregating on the same node. This saves a lot of memory.
Method Summary | |
---|---|
double[] |
countNeighbors(Node n,
Estimate prior)
Count, for all relevant neighbors, how many of the neighboring attributes took on each of the possible values (weighted by the edge weight). |
static int |
getAttributeIndex(java.lang.String nodeType,
Attribute attrib)
|
static java.lang.String |
getDestinationNodeType(java.lang.String edgeType)
Helper function to get the node type at the other end of the given edgeType |
HistogramDiscrete |
getHistogram(Node n)
Get the histogram of observed values (of the neighbors of the source node) of the discrete attribute that is being aggregated over. |
static SharedNodeInfo |
getInfo(java.lang.String nodeType,
int attribIdx,
EdgeType edgeType)
Get a SharedNodeInfo instance for a given node type, attribute and edge type. |
double |
getMax(Node n)
Get the maximum observed value (of the neighbors of the source node) of the discrete or continuous attribute that is being aggregated over. |
double |
getMean(Node n)
Get the mean observed value (of the neighbors of the source node) of the discrete or continuous attribute that is being aggregated over. |
double |
getMin(Node n)
Get the minium observed value (of the neighbors of the source node) of the discrete or continuous attribute that is being aggregated over. |
double |
getSum(Node n,
Estimate prior)
Get the (weighted) sum of all relevant neighbors. |
static void |
initialize(Graph g)
Assume that we will be doing aggregation over this particular graph until further notice |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void initialize(Graph g)
g
- The graph being aggregated overpublic static int getAttributeIndex(java.lang.String nodeType, Attribute attrib)
public static SharedNodeInfo getInfo(java.lang.String nodeType, int attribIdx, EdgeType edgeType)
nodeType
- The node type of the neighbor nodes that will be aggregated over
(for example, if I want to create an aggregate result on node X of type XType
and I want to aggregate over attribute A on X's neighbors that are of type
YType, then nodeType is 'YType')attribIdx
- What is the attribute index of the attribute to be aggregated over.edgeType
- What is the edge that is used to get from the source node (XType) to the
destination node (YType). This is used to get the neighbors of a given
source node when computing the aggregation statistics.
public static java.lang.String getDestinationNodeType(java.lang.String edgeType)
edgeType
- The edgetype whose destination node type is requested
public double[] countNeighbors(Node n, Estimate prior)
n
- The source node from which to find neighboring nodesprior
- The prior estimations of the values of the attribute to be aggregated on (works only for categorical attributes)
getNeighborEdges(netkit.graph.Node)
public double getSum(Node n, Estimate prior)
n
- The source node for the aggregationprior
- The estimated priors of the attribute to be aggregated on
countNeighbors(netkit.graph.Node, netkit.classifiers.Estimate)
public double getMin(Node n)
n
- The source node to aggregate from
public double getMax(Node n)
n
- The source node to aggregate from
public double getMean(Node n)
n
- The source node to aggregate from
public HistogramDiscrete getHistogram(Node n)
n
- The source node to aggregate from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |