Class Art2aEuclidResult
java.lang.Object
de.unijena.cheminf.clustering.art2a.Art2aEuclidResult
Result of an ART-2a-Euclid clustering process.
Note: Art2aEuclidResult is a read-only class, i.e. thread-safe. In addition, there are NO internal calculated values cached, i.e. each method call performs a full calculation procedure. An Art2aEuclidResult object may be distributed to several concurrent (parallelized) evaluation tasks without any mutual interference problems.
Note: Art2aEuclidResult is a read-only class, i.e. thread-safe. In addition, there are NO internal calculated values cached, i.e. each method call performs a full calculation procedure. An Art2aEuclidResult object may be distributed to several concurrent (parallelized) evaluation tasks without any mutual interference problems.
-
Constructor Summary
ConstructorsConstructorDescriptionArt2aEuclidResult(float aVigilance, float aThresholdForContrastEnhancement, int aNumberOfEpochs, int aNumberOfDetectedClusters, int[] aClusterIndexOfDataVector, float[][] aClusterMatrix, boolean[] aDataVectorZeroLengthFlags, boolean anIsClusterOverflow, boolean anIsConverged, PreprocessedData aPreprocessedArt2aEuclidData) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintgetClusterRepresentativeIndex(int aClusterIndex) Calculates index of representative data vector which is closest to the specified cluster vector with index aClusterIndex.int[]getClusterRepresentativeIndices(int aClusterIndex) Calculates array of indices of sorted representative data vectors of the specified cluster with index aClusterIndex.intgetClusterSize(int aClusterIndex) Returns size of the specified cluster with index aClusterIndex, i.e.float[]getClusterVector(int aClusterIndex) Returns specified cluster vector with index aClusterIndex in clusterMatrix.int[]getDataVectorIndicesOfCluster(int aClusterIndex) Returns indices of data vectors in original data matrix that belong to the specified cluster with index aClusterIndex.floatgetDistanceBetweenClusters(int aClusterIndex1, int aClusterIndex2) Return distance between specified clusters with aClusterIndex1 and aClusterIndex2.intNumber of detected clustersintNumber of epochsint[]Returns data vector indices which are closest to their cluster vectors.float[]getScaledClusterVector(int aClusterIndex) Returns specified cluster vector with index aClusterIndex in cluster matrix with components being scaled to interval [0,1].floatVigilance parameterint[]Returns all indices of (scaled) data vectors that have a length of zero.booleanReturns if cluster overflow occurred.booleanReturns if clustering process converged.
-
Constructor Details
-
Art2aEuclidResult
public Art2aEuclidResult(float aVigilance, float aThresholdForContrastEnhancement, int aNumberOfEpochs, int aNumberOfDetectedClusters, int[] aClusterIndexOfDataVector, float[][] aClusterMatrix, boolean[] aDataVectorZeroLengthFlags, boolean anIsClusterOverflow, boolean anIsConverged, PreprocessedData aPreprocessedArt2aEuclidData) Constructor. Note: No checks are performed.- Parameters:
aVigilance- Vigilance parameter in interval (0,1)aThresholdForContrastEnhancement- Threshold for contrast enhancementaNumberOfEpochs- Number of epochs used for clusteringaNumberOfDetectedClusters- Number of detected clustersaClusterIndexOfDataVector- Cluster index of data vectoraClusterMatrix- Cluster matrixaDataVectorZeroLengthFlags- Flags array that indicates if scaled data row vectors have a length of zero (i.e. where all components are equal to zero). True: Scaled data row vector has a length of zero (corresponding contrast enhanced unit vector is set to null in this case), false: Otherwise.anIsClusterOverflow- True: Cluster overflow occurred, false: OtherwiseanIsConverged- True: Clustering process converged, false: OtherwiseaPreprocessedArt2aEuclidData- PreprocessedData instance
-
-
Method Details
-
getClusterVector
Returns specified cluster vector with index aClusterIndex in clusterMatrix.- Parameters:
aClusterIndex- Index of cluster vector in clusterMatrix- Returns:
- Specified cluster vector
- Throws:
IllegalArgumentException- Thrown if argument is illegal.
-
getScaledClusterVector
Returns specified cluster vector with index aClusterIndex in cluster matrix with components being scaled to interval [0,1]. Note: Cluster matrix is NOT changed.- Parameters:
aClusterIndex- Index of cluster vector in cluster matrix- Returns:
- Specified scaled cluster vector
- Throws:
IllegalArgumentException- Thrown if argument is illegal.
-
getDataVectorIndicesOfCluster
Returns indices of data vectors in original data matrix that belong to the specified cluster with index aClusterIndex. Note: The returned indices are cached for successive fast usage.- Parameters:
aClusterIndex- Index of cluster in cluster matrix- Returns:
- Indices of data vectors in original data matrix that belong to the specified cluster with index aClusterIndex.
- Throws:
IllegalArgumentException- Thrown if argument is illegal.
-
getZeroLengthDataVectorIndices
public int[] getZeroLengthDataVectorIndices()Returns all indices of (scaled) data vectors that have a length of zero. The indices refer to the original data matrix. Note: The returned indices are cached for successive fast usage.- Returns:
- All indices of (scaled) data vectors that have a length of zero. The indices refer to the original data matrix.
-
getDistanceBetweenClusters
public float getDistanceBetweenClusters(int aClusterIndex1, int aClusterIndex2) throws IllegalArgumentException Return distance between specified clusters with aClusterIndex1 and aClusterIndex2.- Parameters:
aClusterIndex1- Index of cluster 1 in cluster matrixaClusterIndex2- Index of cluster 2 in cluster matrix- Returns:
- Distance between specified clusters with aClusterIndex1 and aClusterIndex2.
- Throws:
IllegalArgumentException- Thrown if an argument is illegal.
-
getClusterSize
Returns size of the specified cluster with index aClusterIndex, i.e. the number of data vectors of original data matrix that belong to the cluster. Note: The internally evaluated indices of data vectors that belong to the specified cluster are cached for successive fast usage.- Parameters:
aClusterIndex- Index of cluster in cluster matrix- Returns:
- Size of the specified cluster with index aClusterIndex, i.e. the number of data vectors of original data matrix that belong to the cluster.
- Throws:
IllegalArgumentException- Thrown if argument is illegal.
-
isClusterOverflow
public boolean isClusterOverflow()Returns if cluster overflow occurred.- Returns:
- True: Cluster overflow occurred, false: Otherwise
-
isConverged
public boolean isConverged()Returns if clustering process converged.- Returns:
- True: Clustering process converged, false: Otherwise
-
getClusterRepresentativeIndex
Calculates index of representative data vector which is closest to the specified cluster vector with index aClusterIndex.- Parameters:
aClusterIndex- Index of cluster vector in cluster matrix- Returns:
- Index of representative data vector which is closest to the specified cluster vector with index aClusterIndex
- Throws:
IllegalArgumentException- Thrown if argument is illegal
-
getClusterRepresentativeIndices
Calculates array of indices of sorted representative data vectors of the specified cluster with index aClusterIndex. The data vector with index 0 is closest to the cluster vector, the one with index 1 is the second closest etc.- Parameters:
aClusterIndex- Index of cluster vector in cluster matrix- Returns:
- Array of indices of sorted representative data vectors of the specified cluster
- Throws:
IllegalArgumentException- Thrown if argument is illegal
-
getRepresentativeIndicesOfClusters
public int[] getRepresentativeIndicesOfClusters()Returns data vector indices which are closest to their cluster vectors.- Returns:
- Data vector indices which are closest to their cluster vectors
-
getVigilance
public float getVigilance()Vigilance parameter- Returns:
- Vigilance parameter
-
getNumberOfEpochs
public int getNumberOfEpochs()Number of epochs- Returns:
- Number of epochs
-
getNumberOfDetectedClusters
public int getNumberOfDetectedClusters()Number of detected clusters- Returns:
- Number of detected clusters
-