Class QuantileNormalizeInPlaceTest
java.lang.Object
ubic.gemma.core.analysis.preprocess.QuantileNormalizeInPlaceTest
QuantileNormalizer.normalizeInPlace(double[][], boolean[]) must give exactly the values of
QuantileNormalizer.normalize(DoubleMatrix, boolean[]), with and without reference columns and with missing
values.
Exactly means bit for bit: the arrays are compared with Arrays.deepEquals(Object[], Object[]), which compares doubles
as Double.equals(Object), so a NaN must be a NaN, and -0.0 and 0.0 are different values. The in-place
implementation performs the same floating-point operations in the same order as the matrix one, so there is no
tolerance to justify.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe matrix path drops a row with no value from its result, and the caller used to leave such a vector as it was.voidMany small matrices of varied shape, tie density, missing-value density and reference subsets, including masked columns, rows with no value and signed zeros.voidMaster's version of this test pinned a divergence on columns mixing-0.0and0.0, which came from sorting withArrays.sort(double[])(which orders-0.0first) rather than with colt's sort.voidvoidThe outlier case the processed-vector pipeline produces: the outlier columns are masked (all NaN) and excluded from the reference, other cells are missing here and there, and one row has no value at all.voidvoidvoid
-
Constructor Details
-
QuantileNormalizeInPlaceTest
public QuantileNormalizeInPlaceTest()
-
-
Method Details
-
matchesTheMatrixNormalizerOnTheFixture
-
matchesTheMatrixNormalizerOnTheFixtureWithReferenceColumns
-
matchesTheMatrixNormalizerOnTheFixtureWithMaskedOutliersAndMissingValues
@Test public void matchesTheMatrixNormalizerOnTheFixtureWithMaskedOutliersAndMissingValues() throws ExceptionThe outlier case the processed-vector pipeline produces: the outlier columns are masked (all NaN) and excluded from the reference, other cells are missing here and there, and one row has no value at all.- Throws:
Exception
-
restoresMissingValuesAfterImputingThemForTheRanking
@Test public void restoresMissingValuesAfterImputingThemForTheRanking() -
leavesRowsWithNoValueUntouched
@Test public void leavesRowsWithNoValueUntouched()The matrix path drops a row with no value from its result, and the caller used to leave such a vector as it was. The in-place path must not touch it either. -
matchesTheMatrixNormalizerOnSignedZeros
@Test public void matchesTheMatrixNormalizerOnSignedZeros()Master's version of this test pinned a divergence on columns mixing-0.0and0.0, which came from sorting withArrays.sort(double[])(which orders-0.0first) rather than with colt's sort. Sorting the same way as the matrix path removes it. -
matchesTheMatrixNormalizerOnRandomInputs
@Test public void matchesTheMatrixNormalizerOnRandomInputs()Many small matrices of varied shape, tie density, missing-value density and reference subsets, including masked columns, rows with no value and signed zeros. -
rejectsTheSameReferenceColumnsAsTheMatrixNormalizer
@Test public void rejectsTheSameReferenceColumnsAsTheMatrixNormalizer()
-