You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/10/21 06:44:09 UTC
[GitHub] [commons-math] nhojpatrick commented on a diff in pull request #215: JUnit5 assertThrows MapRankingTest
nhojpatrick commented on code in PR #215:
URL: https://github.com/apache/commons-math/pull/215#discussion_r1001424394
##########
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:
extracted setup, so only rank is checked.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org