MutualInformationTest.testMutualInformationFeatureSelection() is failed

11 views
Skip to first unread message

Majid Laali

unread,
Mar 24, 2015, 9:05:55 AM3/24/15
to cleart...@googlegroups.com
Hi, 

I clone the ClearTK repository and run tests with the following command:
mvn test -Dcleartk.skipTests=all

However, one of a test in 'ClearTK ML' module is failed:
MutualInformationTest.testMutualInformationFeatureSelection

with the following message:
Failed tests: 
  MutualInformationTest.testMutualInformationFeatureSelection:135 expected:<Bag_Covered:[wolf]> but was:<Bag_Covered:[pig]>

I am wondering if this is related to my system configuration or it is indeed a failing test.

Thanks, 
Majid

/*******************************************
 *   Majid Laali, Ph.D. Candidate, 
 *   Computer Science & Software Engineering Department
 *   Concordia University
*******************************************/

Miller, Timothy

unread,
Mar 24, 2015, 9:44:03 AM3/24/15
to cleart...@googlegroups.com
Yes, this is a known issue -- seems to be related to the version of java. Here's the snippet from a message on the developers list:

mm. It passed for me on OS X Mavericks with java 1.7.0_45, but failed
with 1.8.0_25. Not sure what Java 8 changed, but something it's doing
is apparently causing that test to fail.

Steve

On Thu, Jan 15, 2015 at 10:47 AM, Miller, Timothy
<Timothy...@childrens.harvard.edu> wrote:
That was from Mac OS yosemite with java 1.8. I was running the junit
tests from within eclipse because I hadn't yet installed command line
maven. I can try again from the terminal once I get mvn installed.
Tim
--
You received this message because you are subscribed to the Google Groups "cleartk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cleartk-user...@googlegroups.com.
To post to this group, send email to cleart...@googlegroups.com.
Visit this group at http://groups.google.com/group/cleartk-users.
For more options, visit https://groups.google.com/d/optout.

Majid Laali

unread,
Mar 24, 2015, 10:41:53 AM3/24/15
to cleart...@googlegroups.com
Hi, 

I debuged the issue and find out what is the problem:

both 'wolf' and 'pig' have the same mutual information and hence their order can be changed in sorting. However, I checked the code and see the instances are sorted by com.google.common.collect.Ordering.immutableSortedCopy and according to the javadoc this sort should be stable: 

"Unlike Sets.newTreeSet(Iterable), this method does not discard elements that are duplicates according to the comparator. The sort performed is stable, meaning that such elements will appear in the returned list in the same order they appeared in elements."

In oder words, as the instances are sorted based on alphabetic order of their name (i.e. 'pig' appears before 'wolf'), 'pig' should appear before 'wolf'. Therefore, I believe the test should be changed accordingly. 

Can I create a patch and change the test with the above explanation?

By the way, can I join to cleartk-developer forum? I am not sure if sending these type of question in this forum is right.

Thanks, 
Majid 

On Tuesday, March 24, 2015 at 9:44:03 AM UTC-4, Tim Miller wrote:
Yes, this is a known issue -- seems to be related to the version of java. Here's the snippet from a message on the developers list:

mm. It passed for me on OS X Mavericks with java 1.7.0_45, but failed
with 1.8.0_25. Not sure what Java 8 changed, but something it's doing
is apparently causing that test to fail.

Steve

On Thu, Jan 15, 2015 at 10:47 AM, Miller, Timothy

Steven Bethard

unread,
Mar 24, 2015, 11:37:23 AM3/24/15
to cleart...@googlegroups.com
On Tue, Mar 24, 2015 at 10:41 AM, Majid Laali <mjl...@gmail.com> wrote:
> I debuged the issue and find out what is the problem:
>
> both 'wolf' and 'pig' have the same mutual information and hence their order
> can be changed in sorting. However, I checked the code and see the instances
> are sorted by com.google.common.collect.Ordering.immutableSortedCopy and
> according to the javadoc this sort should be stable:
>
> "Unlike Sets.newTreeSet(Iterable), this method does not discard elements
> that are duplicates according to the comparator. The sort performed is
> stable, meaning that such elements will appear in the returned list in the
> same order they appeared in elements."
>
> In oder words, as the instances are sorted based on alphabetic order of
> their name (i.e. 'pig' appears before 'wolf'), 'pig' should appear before
> 'wolf'. Therefore, I believe the test should be changed accordingly.
>
> Can I create a patch and change the test with the above explanation?

Thanks for the debugging. Yes, please create a patch with the above
explanation. Please verify that it works with both Java 7 and Java 8
when you do so.

> By the way, can I join to cleartk-developer forum? I am not sure if sending
> these type of question in this forum is right.

Added. Yeah, anything that's about running the test suite is probably
better suited for cleartk-developers.

Steve
Reply all
Reply to author
Forward
0 new messages