smile.clustering
Class SpectralClustering
- java.lang.Object
-
- smile.clustering.SpectralClustering
-
- All Implemented Interfaces:
- java.io.Serializable
public class SpectralClustering extends java.lang.Object implements java.io.SerializableSpectral Clustering. Given a set of data points, the similarity matrix may be defined as a matrix S where Sij represents a measure of the similarity between points. Spectral clustering techniques make use of the spectrum of the similarity matrix of the data to perform dimensionality reduction for clustering in fewer dimensions. Then the clustering will be performed in the dimension-reduce space, in which clusters of non-convex shape may become tight. There are some intriguing similarities between spectral clustering methods and kernel PCA, which has been empirically observed to perform clustering.References
- A.Y. Ng, M.I. Jordan, and Y. Weiss. On Spectral Clustering: Analysis and an algorithm. NIPS, 2001.
- Marina Maila and Jianbo Shi. Learning segmentation by random walks. NIPS, 2000.
- Deepak Verma and Marina Meila. A Comparison of Spectral Clustering Algorithms. 2003.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SpectralClustering(double[][] W, int k)Constructor.SpectralClustering(double[][] data, int k, double sigma)Constructor.SpectralClustering(double[][] data, int k, int l, double sigma)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubledistortion()Returns the distortion in feature space.int[]getClusterLabel()Returns the cluster labels of data.int[]getClusterSize()Returns the size of clusters.doublegetGaussianKernelWidth()Returns the width of Gaussian kernel.intgetNumClusters()Returns the number of clusters.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SpectralClustering
public SpectralClustering(double[][] W, int k)Constructor. Spectral graph clustering.- Parameters:
W- the adjacency matrix of graph.k- the number of clusters.
-
SpectralClustering
public SpectralClustering(double[][] data, int k, double sigma)Constructor. Spectral clustering the data.- Parameters:
data- the dataset for clustering.k- the number of clusters.sigma- the smooth/width parameter of Gaussian kernel, which is a somewhat sensitive parameter. To search for the best setting, one may pick the value that gives the tightest clusters (smallest distortion, seedistortion()) in feature space.
-
SpectralClustering
public SpectralClustering(double[][] data, int k, int l, double sigma)Constructor. Spectral clustering with Nystrom approximation.- Parameters:
data- the dataset for clustering.l- the number of random samples for Nystrom approximation.k- the number of clusters.sigma- the smooth/width parameter of Gaussian kernel, which is a somewhat sensitive parameter. To search for the best setting, one may pick the value that gives the tightest clusters (smallest distortion, seedistortion()) in feature space.
-
-
Method Detail
-
getNumClusters
public int getNumClusters()
Returns the number of clusters.
-
getClusterLabel
public int[] getClusterLabel()
Returns the cluster labels of data.
-
getClusterSize
public int[] getClusterSize()
Returns the size of clusters.
-
getGaussianKernelWidth
public double getGaussianKernelWidth()
Returns the width of Gaussian kernel.
-
distortion
public double distortion()
Returns the distortion in feature space.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG