|
|
@@ -4,6 +4,9 @@ package de.jplag.clustering;
|
|
|
import de.jplag.clustering.algorithm.AgglomerativeClustering;
|
|
|
import de.jplag.options.SimilarityMetric;
|
|
|
|
|
|
+/**
|
|
|
+ * Collection of all possible parameters that describe how a clustering should be performed.
|
|
|
+ */
|
|
|
public class ClusteringOptions {
|
|
|
|
|
|
public static final ClusteringOptions DEFAULTS = new Builder().build();
|
|
|
@@ -22,54 +25,116 @@ public class ClusteringOptions {
|
|
|
private final float preprocessorThreshold;
|
|
|
private final float preprocessorPercentile;
|
|
|
|
|
|
+ /**
|
|
|
+ * @return The similarity metric is used for clustering
|
|
|
+ */
|
|
|
public SimilarityMetric getSimilarityMetric() {
|
|
|
return similarityMetric;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * The kernel bandwidth for the matern kernel used in the gaussian process for the automatic search for the number of clusters in spectral clustering.
|
|
|
+ * Affects the runtime and results of the spectral clustering.
|
|
|
+ *
|
|
|
+ * @return kernel bandwidth for spectral clustering
|
|
|
+ */
|
|
|
public float getSpectralKernelBandwidth() {
|
|
|
return spectralKernelBandwidth;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * This is the assumed level of noise in the evaluation results of a spectral clustering.
|
|
|
+ * Acts as normalization parameter for the Gaussian Process.
|
|
|
+ * The default setting works well with similarity scores in the range between zero and one.
|
|
|
+ * Affects the results of the spectral clustering.
|
|
|
+ *
|
|
|
+ * @return assumed variance of noise in Gaussian Process during spectral clustering.
|
|
|
+ */
|
|
|
public float getSpectralGaussianProcessVariance() {
|
|
|
return spectralGaussianProcessVariance;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * The minimal number of times the kMeans algorithm is run for the spectral clustering.
|
|
|
+ * These runs will use predefined numbers of clusters and will not use the bayesian optimization to determine the number of clusters.
|
|
|
+ * @return minimal kMeans runs during spectral clustering
|
|
|
+ */
|
|
|
public int getSpectralMinRuns() {
|
|
|
return spectralMinRuns;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * The maximal number of times the kMeans algorithm is run during the bayesian optimization for spectral clustering.
|
|
|
+ * The bayesian optimization may be stopped before, when no more maxima of the acquisition-function are found.
|
|
|
+ *
|
|
|
+ * @return maximal kMeans runs during spectral clustering
|
|
|
+ */
|
|
|
public int getSpectralMaxRuns() {
|
|
|
return spectralMaxRuns;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Maximum number of iterations of the kMeans clustering per run during spectral clustering.
|
|
|
+ *
|
|
|
+ * @return maximal kMeans iterations
|
|
|
+ */
|
|
|
public int getSpectralMaxKMeansIterationPerRun() {
|
|
|
return spectralMaxKMeansIterationPerRun;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Agglomerative clustering will merge clusters that have a similarity higher than this threshold.
|
|
|
+ *
|
|
|
+ * @return merging threshold for agglomerative clustering
|
|
|
+ */
|
|
|
public float getAgglomerativeThreshold() {
|
|
|
return agglomerativeThreshold;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * Preprocessing for the similarity values before clustering.
|
|
|
+ * Preprocessing is mandatory for spectral clustering and optional for agglomerative clustering.
|
|
|
+ *
|
|
|
+ * @return preprocessor
|
|
|
+ */
|
|
|
public Preprocessors getPreprocessor() {
|
|
|
return preprocessor;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return whether clustering should be performed
|
|
|
+ */
|
|
|
public boolean isEnabled() {
|
|
|
return enabled;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return the clustering algorithm to use
|
|
|
+ */
|
|
|
public ClusteringAlgorithm getAlgorithm() {
|
|
|
return algorithm;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Similarity measure between clusters in agglomerative clustering.
|
|
|
+ *
|
|
|
+ * @return similarity measure
|
|
|
+ */
|
|
|
public AgglomerativeClustering.InterClusterSimilarity getAgglomerativeInterClusterSimilarity() {
|
|
|
return agglomerativeInterClusterSimilarity;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return up to which similarity the threshold-preprocessor zeroes out the similarities
|
|
|
+ */
|
|
|
public float getPreprocessorThreshold() {
|
|
|
return preprocessorThreshold;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return up to which percentile of similarities the percentile-preprocessor zeroes out the similarities
|
|
|
+ */
|
|
|
public float getPreprocessorPercentile() {
|
|
|
return preprocessorPercentile;
|
|
|
}
|