Class Art2aResult

java.lang.Object
de.unijena.cheminf.clustering.art2a.Art2aResult

public class Art2aResult extends Object
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.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Art2aResult(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 Type
    Method
    Description
    float
    getAngleBetweenClusters(int aClusterIndex1, int aClusterIndex2)
    Return angle in degree between specified clusters with aClusterIndex1 and aClusterIndex2.
    int
    getClusterRepresentativeIndex(int aClusterIndex)
    Calculates index of representative data vector which is closest to the specified cluster vector with index aClusterIndex.
    int[]
    Calculates an array of indices of sorted representative data vectors of the specified cluster with index aClusterIndex.
    int
    getClusterSize(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.
    int
    Number of detected clusters
    int
    Number of epochs
    int[]
    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.
    float
    Vigilance parameter
    int[]
    Returns all indices of (scaled) data vectors that have a length of zero.
    boolean
    Returns if cluster overflow occurred.
    boolean
    Returns if clustering process converged.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 enhancement
      aNumberOfEpochs - Number of epochs used for clustering
      aNumberOfDetectedClusters - Number of detected clusters
      aClusterIndexOfDataVector - Cluster index of data vector
      aClusterMatrix - Cluster matrix
      aDataVectorZeroLengthFlags - 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: Otherwise
      anIsConverged - True: The clustering process converged, false: Otherwise
      aPreprocessedArt2aData - PreprocessedData instance
  • Method Details

    • getClusterVector

      public float[] getClusterVector(int aClusterIndex) throws IllegalArgumentException
      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

      public float[] getScaledClusterVector(int aClusterIndex) throws IllegalArgumentException
      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

      public int[] getDataVectorIndicesOfCluster(int aClusterIndex) throws IllegalArgumentException
      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 matrix
      aClusterIndex2 - 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

      public int getClusterSize(int aClusterIndex) throws IllegalArgumentException
      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

      public int getClusterRepresentativeIndex(int aClusterIndex) throws IllegalArgumentException
      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

      public int[] getClusterRepresentativeIndices(int aClusterIndex) throws IllegalArgumentException
      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

      public int[][] getTrainingAndTestIndices(float aTrainingFraction) throws IllegalArgumentException
      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