Packageflare.analytics.cluster
Classpublic class HierarchicalCluster
InheritanceHierarchicalCluster Inheritance Operator
SubclassesAgglomerativeCluster, CommunityStructure

Base class for clustering operators that construct a hierarchical clustering tree. Provides methods for taking a sequence of merge operations by a clustering algorithm and constructing a resulting cluster tree.

Once a clustering has been computed, each node included in the analysis will be annotated with both its cluster membership using the name indicated by the clusterField property. By default, this class will attempt to pick an optimal level of the cluster tree at which to break up items into discrete clusters. However, clients can invoke the labelNodes method with a specific merge number which indicates the point at which to "cut" the cluster tree into discrete sub-clusters. This class also annotates nodes with a sequence number using the name indicated by the sequenceField property. The sequence number allows items to be sorted in a way that attempts to preserve the clustered structure. Additionally, the clusterTree property will return a flare.vis.data.Tree instance that can be used to visualize the structure of the cluster tree.



Public Properties
 PropertyDefined by
  clusterField : String
The property in which to store cluster indices.
HierarchicalCluster
  clusterTree : Tree
[read-only] The cluster tree of detected community structures.
HierarchicalCluster
  criteria : Array
[read-only] Computed criterion values for each merge in the cluster tree.
HierarchicalCluster
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
  group : String
The data group to cluster.
HierarchicalCluster
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  sequenceField : String
The property in which to store sequence indices.
HierarchicalCluster
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Public Methods
 MethodDefined by
  
Creates a new HierarchicalCluster instance.
HierarchicalCluster
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
  
labelNodes(merge:int = -1):void
Labels nodes with their cluster membership, determined by the given merge number.
HierarchicalCluster
 Inherited
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
Operator
 Inherited
setup():void
Setup method invoked whenever this operator's visualization property is set.
Operator
Property detail
clusterFieldproperty
clusterField:String  [read-write]

The property in which to store cluster indices. This property is used to annotate nodes with the community they belong to (indicated as an integer index). The default value is "props.cluster".

Implementation
    public function get clusterField():String
    public function set clusterField(value:String):void
clusterTreeproperty 
clusterTree:Tree  [read-only]

The cluster tree of detected community structures. The leaf nodes correspond to each of the nodes in the input graph, and include the same data property. Non-leaf nodes indicate merges made by the clustering algorithm, and have data properties that include the merge number (1 for the first merger, 2 for the second, etc), the criterion value computed for that merge, and the size of the cluster rooted at that node (the number of descendants in the cluster tree).

Implementation
    public function get clusterTree():Tree
criteriaproperty 
criteria:Array  [read-only]

Computed criterion values for each merge in the cluster tree.

Implementation
    public function get criteria():Array
groupproperty 
group:String  [read-write]

The data group to cluster.

Implementation
    public function get group():String
    public function set group(value:String):void
sequenceFieldproperty 
sequenceField:String  [read-write]

The property in which to store sequence indices. This property is used to annotate nodes with their sequence index along the computed cluster tree. This value can be used to sort the nodes in a way that best preserves community structure. The default value is "props.sequence".

Implementation
    public function get sequenceField():String
    public function set sequenceField(value:String):void
Constructor detail
HierarchicalCluster()constructor
public function HierarchicalCluster()

Creates a new HierarchicalCluster instance.

Method detail
labelNodes()method
public function labelNodes(merge:int = -1):void

Labels nodes with their cluster membership, determined by the given merge number. If the merge number is less than zero or unprovided, the merge number that maximizes the clustering criteria will be assumed.

Parameters
merge:int (default = -1) — the merge number at which to compute the clusters