Package org.nlpub.watset.graph
Class SpectralClustering.Implementation<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.SpectralClustering.Implementation<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
- Enclosing class:
- SpectralClustering<V,E>
public static class SpectralClustering.Implementation<V,E> extends Object
Actual implementation of Spectral Clustering.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>>clustererThe underlying clustering algorithm.protected List<NodeEmbedding<V>>embeddingsThe node embeddings.protected org.jgrapht.util.VertexToIntegerMapping<V>mappingThe mapping of graph nodes to the columns of the graph Laplacian.
-
Constructor Summary
Constructors Constructor Description Implementation(org.jgrapht.Graph<V,E> graph, org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>> clusterer, int k)Create an instance of the Spectral Clustering algorithm implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V>compute()Perform clustering with Spectral Clustering.
-
-
-
Field Detail
-
clusterer
protected final org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>> clusterer
The underlying clustering algorithm.
-
mapping
protected final org.jgrapht.util.VertexToIntegerMapping<V> mapping
The mapping of graph nodes to the columns of the graph Laplacian.
-
embeddings
protected final List<NodeEmbedding<V>> embeddings
The node embeddings.
-
-
Constructor Detail
-
Implementation
public Implementation(org.jgrapht.Graph<V,E> graph, org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>> clusterer, int k)
Create an instance of the Spectral Clustering algorithm implementation.- Parameters:
graph- the graphclusterer- the clustering algorithmk- the number of clusters
-
-
Method Detail
-
compute
public org.jgrapht.alg.interfaces.ClusteringAlgorithm.Clustering<V> compute()
Perform clustering with Spectral Clustering.- Returns:
- the clustering
-
-