Class PreprocessedData
java.lang.Object
de.unijena.cheminf.clustering.art2a.PreprocessedData
- Direct Known Subclasses:
PreprocessedArt2aData,PreprocessedArt2aEuclidData
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.
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 Summary
ConstructorsModifierConstructorDescriptionprotectedPreprocessedData(float[][] aPreprocessedMatrix, boolean[] aDataVectorZeroLengthFlags, Utils.MinMaxValue[] aMinMaxComponentsOfDataMatrix, float anOffsetForContrastEnhancement) ConstructorprotectedPreprocessedData(float[][] aDataMatrix, Utils.MinMaxValue[] aMinMaxComponentsOfDataMatrix, float anOffsetForContrastEnhancement) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected float[][]Original data matrix with data row vectorsprotected boolean[]Flags array that indicates if scaled data row vectors have a length of zero (i.e.protected Utils.MinMaxValue[]Min-max components of original data matrix (see method Utils.getMinMaxComponents() for data structure)protected floatReturns offset for contrast enhancementprotected float[][]Matrix of contrast enhanced unit vectorsprotected booleanReturns if Art2aData object has preprocessed data, i.e.
-
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 matrixanOffsetForContrastEnhancement- 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 matrixanOffsetForContrastEnhancement- 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
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
-