Class Art2aEuclidResult

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

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

    Constructors
    Constructor
    Description
    Art2aEuclidResult(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 Type
    Method
    Description
    int
    getClusterRepresentativeIndex(int aClusterIndex)
    Calculates index of representative data vector which is closest to the specified cluster vector with index aClusterIndex.
    int[]
    Calculates 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.
    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.
    float
    getDistanceBetweenClusters(int aClusterIndex1, int aClusterIndex2)
    Return distance between specified clusters with aClusterIndex1 and aClusterIndex2.
    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].
    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

    • 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 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: Clustering process converged, false: Otherwise
      aPreprocessedArt2aEuclidData - 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 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 matrix
      aClusterIndex2 - 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

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

      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 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