The Data Mining Forum                             open-source data mining software data mining conferences Data Science for Social and Behavioral Analytics DSSBA 2022 data science journal
IMPORTANT: This is the old Data Mining forum.
I keep it online so that you can read the old messages.

Please post your new messages in the new forum: https://forum2.philippe-fournier-viger.com/index.php
 
Question on confidence with compareTo(Rule)
Posted by: leetcat
Date: September 18, 2014 11:51AM

I think there may be a bug in Rule found in
package ca.pfv.spmf.algorithms.sequential_rules.topseqrules_and_tns;

The compareTo function of Rule compares two doubles incorrectly.
Confidence is a number that does not go above 1.0 and the two are subtracted, then converted to an int. That number will always be 0.

int compare4 = (int)(this.confidence  - o.confidence);
if(compare !=0){
	return compare4;
}

It should be changed to:

Double obj1 = new Double(this.confidence);
Double obj2 = new Double(o.confidence);
int compare4 = obj1.compareTo(obj2);
if (compare4 != 0) {
	return compare4;
}



Edited 1 time(s). Last edit at 09/18/2014 11:52AM by leetcat.

Options: ReplyQuote
Re: Question on confidence with compareTo(Rule)
Date: September 18, 2014 03:45PM

Hi,

Thanks a lot for reporting this bug! :-)

It was indeed a bug. I have fixed it as follows:

int compare4 = Double.compare(this.confidence, o.confidence);
if(compare4 !=0){
return compare4;
}

which is a little bit shorter.

Since you have contributed a bug report, do you want that I add your name to the list of contributors of SPMF on the website? If so, you can tell me your name and I will add it under the section "bug report".

Thanks a lot!

Philippe

Options: ReplyQuote
Re: Question on confidence with compareTo(Rule)
Posted by: leetcat
Date: September 19, 2014 08:41AM

I'm C. Albert Thompson. A previous contributor. ^_^ thanks for your awesome product.



Edited 1 time(s). Last edit at 09/19/2014 08:41AM by leetcat.

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.