Class PreprocessedData

java.lang.Object
de.unijena.cheminf.clustering.art2a.PreprocessedData
Direct Known Subclasses:
PreprocessedArt2aData, PreprocessedArt2aEuclidData

public class PreprocessedData extends Object
Class for preprocessed data.

Note: PreprocessedData instances are to be generated with static getPreprocessedData() methods to obtain preprocessed data for faster clustering.

Note: PreprocessedData is also used for internal data preprocessing, i.e. it may not necessarily contain preprocessed data. A private constructor ensures that original dataMatrix and preprocessedMatrix/dataVectorZeroLengthFlags are mutually exclusive. Use method hasPreprocessedData() to check whether preprocessed preprocessedMatrix/dataVectorZeroLengthFlags are available.

Note: PreprocessedData is a read-only class, i.e. thread-safe. The same PreprocessedData object may be distributed to several concurrently working clustering tasks without any mutual interference problems.
  • Constructor Details

    • PreprocessedData

      protected PreprocessedData(float[][] aDataMatrix, Utils.MinMaxValue[] aMinMaxComponentsOfDataMatrix, float anOffsetForContrastEnhancement)
      Constructor
      Parameters:
      aDataMatrix - Original data matrix with data row vectors (NOT allowed to be null)
      aMinMaxComponentsOfDataMatrix - Min-max components of original data matrix
      anOffsetForContrastEnhancement - Offset for contrast enhancement (must be greater zero)
      Throws:
      IllegalArgumentException - Thrown if an argument is illegal
    • PreprocessedData

      protected PreprocessedData(float[][] aPreprocessedMatrix, boolean[] aDataVectorZeroLengthFlags, Utils.MinMaxValue[] aMinMaxComponentsOfDataMatrix, float anOffsetForContrastEnhancement)
      Constructor
      Parameters:
      aPreprocessedMatrix - Preprocessed matrix (NOT allowed to be null)
      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 preprocessed vector is set to null in this case), false: Otherwise.
      aMinMaxComponentsOfDataMatrix - Min-max components of original data matrix
      anOffsetForContrastEnhancement - Offset for contrast enhancement (must be greater zero)
      Throws:
      IllegalArgumentException - Thrown if an argument is illegal
  • Method Details

    • getDataMatrix

      protected float[][] getDataMatrix()
      Original data matrix with data row vectors
      Returns:
      Original data matrix with data row vectors or null if hasPreprocessedData() returns true
    • getPreprocessedMatrix

      protected float[][] getPreprocessedMatrix()
      Matrix of contrast enhanced unit vectors
      Returns:
      Matrix of contrast enhanced unit vectors or null if hasPreprocessedData() returns false
    • getDataVectorZeroLengthFlags

      protected boolean[] getDataVectorZeroLengthFlags()
      Flags array that indicates if scaled data row vectors have a length of zero (i.e. where all components are equal to zero, the corresponding contrast enhanced unit vector is set to null in this case). True: Scaled data row vector has a length of zero, false: Otherwise.
      Returns:
      Array with flags or null if hasPreprocessedData() returns false
    • getMinMaxComponentsOfDataMatrix

      protected Utils.MinMaxValue[] getMinMaxComponentsOfDataMatrix()
      Min-max components of original data matrix (see method Utils.getMinMaxComponents() for data structure)
      Returns:
      Min-max components of original data matrix
    • hasPreprocessedData

      protected boolean hasPreprocessedData()
      Returns if Art2aData object has preprocessed data, i.e. contrastEnhancedUnitMatrix and dataVectorZeroLengthFlags are defined.
      Returns:
      True: Art2aData object has preprocessed data, false: Otherwise
    • getOffsetForContrastEnhancement

      protected float getOffsetForContrastEnhancement()
      Returns offset for contrast enhancement
      Returns:
      Offset for contrast enhancement