Interface Clustering
- All Known Implementing Classes:
KMeansPlusPlusClustering,SingleLinkageClustering
public interface Clustering
Interface for a clustering algorithm.
Please note that this interface expects the clustering algorithm to construct a fixed number of clusters. Consider
using one of Apache Commons Math's Clusterer implementations directly
if this is too restrictive.
-
Method Summary
Modifier and TypeMethodDescriptioncluster(int size, Iterable<ClusterableSolution> solutions) Construct clusters using the points defined by the clusterable solutions.cluster(int size, ClusterableSolution[] solutions) Construct clusters using the points defined by the clusterable solutions.clusterObjectives(int size, Iterable<Solution> solutions) Construct clusters based on the objective values of the solutions.clusterObjectives(int size, Solution[] solutions) Construct clusters based on the objective values of the solutions.clusterVariables(int size, Iterable<Solution> solutions) Construct clusters based on the decision variables of the solutions.clusterVariables(int size, Solution[] solutions) Construct clusters based on the decision variables of the solutions.static ClusteringConstructs the k-means++ clustering algorithm using Euclidean distances.static ClusteringConstructs the single-linkage clustering algorithm using Euclidean distances.default voidtruncate(int size, Population population) Truncates a population to the given size by forming clusters based on the objective values and selecting the representative member from each cluster.
-
Method Details
-
cluster
Construct clusters using the points defined by the clusterable solutions.- Parameters:
size- the number of clusters to constructsolutions- the clusterable solutions- Returns:
- the clusters
-
cluster
Construct clusters using the points defined by the clusterable solutions.- Parameters:
size- the number of clusters to constructsolutions- the clusterable solutions- Returns:
- the clusters
-
clusterObjectives
Construct clusters based on the objective values of the solutions.- Parameters:
size- the number of clusters to constructsolutions- the solutions- Returns:
- the clusters
-
clusterObjectives
Construct clusters based on the objective values of the solutions.- Parameters:
size- the number of clusters to constructsolutions- the solutions- Returns:
- the clusters
-
clusterVariables
Construct clusters based on the decision variables of the solutions. SeeClusterableSolution.withVariables(Solution)for limitations of this method.- Parameters:
size- the number of clusters to constructsolutions- the solutions- Returns:
- the clusters
-
clusterVariables
Construct clusters based on the decision variables of the solutions. SeeClusterableSolution.withVariables(Solution)for limitations of this method.- Parameters:
size- the number of clusters to constructsolutions- the solutions- Returns:
- the clusters
-
truncate
Truncates a population to the given size by forming clusters based on the objective values and selecting the representative member from each cluster.- Parameters:
size- the resulting size of the populationpopulation- the population to truncate
-
singleLinkage
Constructs the single-linkage clustering algorithm using Euclidean distances.- Returns:
- the clustering algorithm
-
kMeansPlusPlus
Constructs the k-means++ clustering algorithm using Euclidean distances.- Returns:
- the clustering algorithm
-