aherbert commented on code in PR #215:
URL: https://github.com/apache/commons-math/pull/215#discussion_r1001117768
##########
commons-math-neuralnet/src/test/java/org/apache/commons/math4/neuralnet/MapRankingTest.java:
##########
@@ -94,15 +97,16 @@ public void testFindClosestNeuron() {
Assert.assertEquals(3, allBest.size());
}
- @Test(expected = IllegalArgumentException.class)
+ @Test
public void testRankPrecondition() {
final UniformRandomProvider rng = RandomSource.SPLIT_MIX_64.create();
final FeatureInitializer init
= new
OffsetFeatureInitializer(FeatureInitializerFactory.uniform(rng, -0.1, 0.1));
final FeatureInitializer[] initArray = {init};
- new MapRanking(new NeuronString(3, false, initArray).getNetwork(),
- new EuclideanDistance()).rank(new double[] {-1}, 0);
+ assertThrows(IllegalArgumentException.class, () ->
Review Comment:
Here is an example where the source of the exception is not clear. Can you
break this down to create the valid objects first and catch the exception from
I presume `MapRanking.rank`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]