 | ClusterAnalysis Class |
Class ClusterAnalysis perform hierarchical cluster analysis.
Inheritance Hierarchy Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntaxpublic class ClusterAnalysis : ICloneable
Public Class ClusterAnalysis
Implements ICloneable
public ref class ClusterAnalysis : ICloneable
type ClusterAnalysis =
class
interface ICloneable
end
The ClusterAnalysis type exposes the following members.
Constructors | Name | Description |
---|
 | ClusterAnalysis |
Default constructor. Constructs an empty ClusterAnalysis instance.
|
 | ClusterAnalysis(DataFrame) |
Default constructor. Constructs a ClusterAnalysis instance from the
given data, using the current default distance and linkage delegates.
|
 | ClusterAnalysis(DoubleMatrix) |
Constructs a ClusterAnalysis instance from the given data, using the
current default distance and linkage delegates.
|
 | ClusterAnalysis(DataFrame, DistanceFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance delegates.
|
 | ClusterAnalysis(DataFrame, LinkageFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance delegates.
|
 | ClusterAnalysis(DoubleMatrix, DistanceFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance delegates.
|
 | ClusterAnalysis(DoubleMatrix, LinkageFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance delegates.
|
 | ClusterAnalysis(DataFrame, DistanceFunction, LinkageFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance and linkage delegates.
|
 | ClusterAnalysis(DoubleMatrix, DistanceFunction, LinkageFunction) |
Constructs a ClusterAnalysis instance from the given data,
using the given distance and linkage delegates.
|
Top
Properties | Name | Description |
---|
 | CopheneticDistances |
Gets the vector of cophenetic distances between all possible object
pairs.
|
  | DefaultDistanceFunction |
Gets and sets the default distance delegate associated with
ClusterAnalysis objects.
|
  | DefaultLinkageFunction |
Gets and sets the default linkage delegate associated with
ClusterAnalysis objects.
|
 | DistanceFunction |
Gets and sets the distance measurement delegate used by this
ClusterAnalysis instance to determine the distance between individual
objects.
|
 | Distances |
Gets the vector of distances between all possible object
pairs, computed using the current distance delegate.
|
 | LinkageFunction |
Gets and sets the linkage measurement delegate used by this ClusterAnalysis
instance to determine the distance between clusters.
|
 | Linkages |
Gets the complete hierarchical linkage tree, computed from Distances
using the current linkage delegate.
|
 | N |
Gets the total number of objects.
|
Top
Methods | Name | Description |
---|
 | Clone |
Creates a deep copy of this cluster analysis.
|
 | CutTree(Double) |
Constructs a set of clusters by cutting the hierarchical
linkage tree at the specified height.
|
 | CutTree(Int32) |
Constructs the specified number of clusters from the hierarchical
linkage tree.
|
 | GetDistances |
Computes the vector of distances between all possible object
pairs, using the current distance delegate.
|
 | GetLinkages |
Computes the complete hierarchical linkage tree, using the
current distance vector and linkage delegate.
|
 | Update(DataFrame) |
Clusters the given data, using the current Distance and
Linkage delegates.
|
 | Update(DoubleMatrix) |
Clusters the given data, using the current Distance and
Linkage delegates.
|
 | Update(DataFrame, DistanceFunction) |
Clusters the given data, using the given distance delegate and the
current linkage delegate.
|
 | Update(DataFrame, LinkageFunction) |
Clusters the given data, using the current distance delegate and the
given linkage delegate.
|
 | Update(DoubleMatrix, DistanceFunction) |
Clusters the given data, using the given distance delegate and the
current linkage delegate.
|
 | Update(DoubleMatrix, LinkageFunction) |
Clusters the given data, using the current distance delegate and the
given linkage delegate.
|
 | Update(DataFrame, DistanceFunction, LinkageFunction) |
Clusters the given data, using the given distance and linkage
delegates.
|
 | Update(DoubleMatrix, DistanceFunction, LinkageFunction) |
Clusters the given data, using the given distance and linkage
delegates.
|
Top
Fields
Remarks
Instances of class ClusterAnalysis are constructed from a matrix of
data, where each row in the matrix represents an object to be clustered.
Initially, each object is assigned to its own singleton cluster and
then the analysis proceeds iteratively, at each stage joining the two
most similar clusters into a new cluster, continuing until there is one
overall cluster.
Distances between objects are computed using a Distance.Function delegate.
Delegates are provided as static variables on class Distance for
euclidean, squared euclidean, city-block (Manhattan), maximum (Chebychev),
and power distance functions. You can also create your own distance function
delegate. Property Distances gets the vector of distances between
all possible object pairs, computed using the current distance delegate.
Distances between clusters of objects are computed using a Linkage.Function
delegate. Delegates are provided as static variables on class Linkage
for single, complete, unweighted average, weighted average, centroid, median,
and Ward's linkage functions. Again, you can also create your own linkage
function delegate. The Linkages property gets the complete hierarchical
linkage tree, computed from Distances using the current linkage
delegate.
The CutTree() method constructs a set of clusters by cutting the
hierarchical linkage tree either at the specified height, or into the
specified number of clusters.
Example
DoubleMatrix data = new DoubleMatrix( 8, 3, new RandGenUniform() );
ClusterAnalysis ca = new ClusterAnalysis( data,
Distance.SquaredEuclideanFunction, Linkage.CompleteFunction );
Console.WriteLine( ca.Distances );
Console.WriteLine( ca.Linkages );
Console.WriteLine( ca.CutTree( 3 ) );
Console.WriteLine( ca.CutTree( 0.75 ) );
See Also