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>
Actual implementation of Spectral Clustering.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.math3.ml.clustering.Clusterer<NodeEmbedding<V>>The underlying clustering algorithm.protected final List<NodeEmbedding<V>>The node embeddings.protected final org.jgrapht.util.VertexToIntegerMapping<V>The mapping of graph nodes to the columns of the graph Laplacian. -
Constructor Summary
ConstructorsConstructorDescriptionImplementation(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
-
Field Details
-
clusterer
The underlying clustering algorithm. -
mapping
The mapping of graph nodes to the columns of the graph Laplacian. -
embeddings
The node embeddings.
-
-
Constructor Details
-
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 Details
-
compute
Perform clustering with Spectral Clustering.- Returns:
- the clustering
-