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.