Class Art2aResult
java.lang.Object
de.unijena.cheminf.clustering.art2a.Art2aResult
Result of an ART-2a clustering process.
Note: Art2aResult is a read-only class, i.e., thread-safe. In addition, there are NO internally calculated values cached, i.e., each method call performs a full calculation procedure. An Art2aResult object may be distributed to several concurrent (parallelized) evaluation tasks without any mutual interference problems.
Note: Art2aResult is a read-only class, i.e., thread-safe. In addition, there are NO internally calculated values cached, i.e., each method call performs a full calculation procedure. An Art2aResult object may be distributed to several concurrent (parallelized) evaluation tasks without any mutual interference problems.
-
Constructor Summary
ConstructorsConstructorDescriptionArt2aResult(float aVigilance, float aThresholdForContrastEnhancement, int aNumberOfEpochs, int aNumberOfDetectedClusters, int[] aClusterIndexOfDataVector, float[][] aClusterMatrix, boolean[] aDataVectorZeroLengthFlags, boolean anIsClusterOverflow, boolean anIsConverged, PreprocessedData aPreprocessedArt2aData) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAngleBetweenClusters(int aClusterIndex1, int aClusterIndex2) Return angle in degree between specified clusters with aClusterIndex1 and aClusterIndex2.intgetClusterRepresentativeIndex(int aClusterIndex) Calculates index of representative data vector which is closest to the specified cluster vector with index aClusterIndex.int[]getClusterRepresentativeIndices(int aClusterIndex) Calculates an 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., the number of data vectors of the original data matrix that belong to the cluster.float[]getClusterVector(int aClusterIndex) Returns specified cluster vector with index aClusterIndex in clusterMatrix.int[]getDataVectorIndicesOfCluster(int aClusterIndex) Returns indices of data vectors in the original data matrix that belong to the specified cluster with index aClusterIndex.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].int[][]getTrainingAndTestIndices(float aTrainingFraction) Creates clustering-based training and test data vector indices that cover a similar space.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
-
Art2aResult
public Art2aResult(float aVigilance, float aThresholdForContrastEnhancement, int aNumberOfEpochs, int aNumberOfDetectedClusters, int[] aClusterIndexOfDataVector, float[][] aClusterMatrix, boolean[] aDataVectorZeroLengthFlags, boolean anIsClusterOverflow, boolean anIsConverged, PreprocessedData aPreprocessedArt2aData) 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: The clustering process converged, false: OtherwiseaPreprocessedArt2aData- 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 the original data matrix that belong to the specified cluster with index aClusterIndex.- Parameters:
aClusterIndex- Index of cluster in cluster matrix- Returns:
- Indices of data vectors in the 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.
-
getAngleBetweenClusters
public float getAngleBetweenClusters(int aClusterIndex1, int aClusterIndex2) throws IllegalArgumentException Return angle in degree between specified clusters with aClusterIndex1 and aClusterIndex2.- Parameters:
aClusterIndex1- Index of cluster 1 in cluster matrixaClusterIndex2- Index of cluster 2 in cluster matrix- Returns:
- Angle in degree 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 the 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 the 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: The 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 an 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
-
getTrainingAndTestIndices
Creates clustering-based training and test data vector indices that cover a similar space. Returns a 2-dimensional jagged integer array where index 0 is the array of training data vector indices and index 1 is the array of test data vector indices.- Parameters:
aTrainingFraction- Fraction of data vector indices for training (i.e., a value of 0.7 means that 70% are used for training and 30% for test)- Returns:
- 2-dimensional jagged integer array where index 0 is the array of training data vector indices and index 1 is the array of test data vector indices.
- Throws:
IllegalArgumentException- Thrown if argument is illegal
-
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
-