Skip to content

Commit 5d37806

Browse files
committed
add a test for fractionDistinctValuesNonNA
1 parent 7c88e10 commit 5d37806

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/ubic/basecode/math/TestStats.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ public final void testNumberOfDistinctValues() {
146146
actualReturn = Stats.numberofDistinctValues( new DoubleArrayList( new double[] { 1.0, 1.0, 3.0, 4.0, 4.00001,
147147
5.0, 6.0 } ), 0.00001 );
148148
assertEquals( 6, actualReturn );
149+
150+
double[] rowAsList = new double[]{8.6154, 8.0668, 8.3417, 6.4633, 9.2136, 8.5676, 7.2155, 7.1609, 8.4329, 8.7668, 8.2165, 7.237, 9.3366,
151+
6.8416, 8.2402, 7.4053, 6.8839, 7.5707, 6.9576, -2.0648, -2.0648, 0.0407, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648,
152+
-2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648, -2.0648};
153+
Double r = Stats.fractionDistinctValuesNonNA(new DoubleArrayList(rowAsList), 0.001);
154+
155+
assertEquals(0.552, r, 0.01);
156+
149157
}
150158

151159

0 commit comments

Comments
 (0)