Waikato / moa

MOA is an open source framework for Big Data stream mining. It includes a collection of machine learning algorithms (classification, regression, clustering, outlier detection, concept drift detection and recommender systems) and tools for evaluation.
http://moa.cms.waikato.ac.nz/
GNU General Public License v3.0
614 stars 355 forks source link

The regression test on AdaHoeffdingOptionTree is failing #303

Closed justinuliu closed 1 month ago

justinuliu commented 4 months ago
%TESTC  2 v2
%TSTTREE1,moa.classifiers.trees.AdaHoeffdingOptionTreeTest,true,2,false,-1,moa.classifiers.trees.AdaHoeffdingOptionTreeTest,,
%TSTTREE2,testRegression(moa.classifiers.trees.AdaHoeffdingOptionTreeTest),false,1,false,-1,testRegression(moa.classifiers.trees.AdaHoeffdingOptionTreeTest),,
%TSTTREE3,testSerializable(moa.classifiers.trees.AdaHoeffdingOptionTreeTest),false,1,false,-1,testSerializable(moa.classifiers.trees.AdaHoeffdingOptionTreeTest),,
%TESTS  2,testRegression(moa.classifiers.trees.AdaHoeffdingOptionTreeTest)

%FAILED 2,testRegression(moa.classifiers.trees.AdaHoeffdingOptionTreeTest)
%TRACES 
junit.framework.AssertionFailedError: Output differs:
52c52
<   1: 1.24768970176524544E17
---
>   1: 1.2476897017652454E17

        at junit.framework.Assert.fail(Assert.java:57)
        at junit.framework.Assert.assertTrue(Assert.java:22)
        at junit.framework.Assert.assertNull(Assert.java:277)
        at junit.framework.TestCase.assertNull(TestCase.java:418)
        at moa.classifiers.AbstractClassifierTestCase.testRegression(AbstractClassifierTestCase.java:350)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at junit.framework.TestCase.runTest(TestCase.java:177)
        at moa.test.MoaTestCase.runTest(MoaTestCase.java:137)
        at junit.framework.TestCase.runBare(TestCase.java:142)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:130)
        at junit.framework.TestSuite.runTest(TestSuite.java:241)
        at junit.framework.TestSuite.run(TestSuite.java:236)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:757)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

%TRACEE 

%TESTE  2,testRegression(moa.classifiers.trees.AdaHoeffdingOptionTreeTest)
%TESTS  3,testSerializable(moa.classifiers.trees.AdaHoeffdingOptionTreeTest)

%TESTE  3,testSerializable(moa.classifiers.trees.AdaHoeffdingOptionTreeTest)

%RUNTIME872
nuwangunasekara commented 4 months ago

Same test seems to be passing on

(base) ng98@MacBook-Pro-2 justinuliu % git remote -v 
origin  https://github.com/justinuliu/moa.git (fetch)
origin  https://github.com/justinuliu/moa.git (push)
(base) ng98@MacBook-Pro-2 justinuliu % git branch 
* master
(base) ng98@MacBook-Pro-2 justinuliu % git reflog
5168fda (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: clone: from https://github.com/justinuliu/moa.git
(base) ng98@MacBook-Pro-2 justinuliu % java --version 
openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
(base) ng98@MacBook-Pro-2 justinuliu % mvn clean package -Dmaven.javadoc.skip=true -Dskip.pdf=true -Dtest="AdaHoeffdingOptionTreeTest"
:
:
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.013 sec - in moa.classifiers.trees.AdaHoeffdingOptionTreeTest
justinuliu commented 4 months ago

The test passes with Oracle-JDK-17 but fails with OpenJDK-22 and Oracle-JDK-22. It seems a matter of JVM version. The error is a difference in the length of the decimal. JDK-22 is one decimal less than JDK-17.

hmgomes commented 1 month ago

It seems this bug has been solved by #302