The Data Mining Forum                             open-source data mining software open-source data mining software data science journal data mining conferences
This forum is about data mining, data science and big data: algorithms, source code, datasets, implementations, optimizations, etc. You are welcome to post call for papers, data mining job ads, link to source code of data mining algorithms or anything else related to data mining. The forum is hosted by P. Fournier-Viger. No registration is required to use this forum!.  
BUG: ItemValued Class
Posted by: Dana
Date: February 01, 2013 08:50AM

Your Item Valued class has a bug where the min and max values to do not display if the min OR max values in the cluster are zero. Why would zero not be a valid item value? I'm using grade-based data and an F has a value of zero. I could easily alter my data, but why? Like your sequenceID, I would suggest instead, initializing min and max to -1 and then testing against that value. I've put this fix in my own code and it works perfectly, displaying all of the min/max values:

// Data members:
private double min = -1;
private double max = -1;

// toString method:
public String toString(){
StringBuffer temp = new StringBuffer();
temp.append(getId());
temp.append(" ("winking smiley;
temp.append(getValue());
if(min != -1 && max != -1){
temp.append(", min="winking smiley;
temp.append(getMin());
temp.append(" max=" );
temp.append(getMax());
}
temp.append(')');
if(getCluster() != null){
temp.append('[');
temp.append(getCluster().getMedian());
temp.append(']');
}
return temp.toString();
}

Options: ReplyQuote
Re: BUG: ItemValued Class
Date: February 04, 2013 07:53PM

Hi Dana,

Thanks for reporting this issue.

Actually, I had done this purposely in previous version of SPMF because I had a sequential pattern mining algorithm that was using the clustering algorithm and I did not want to show the min and max for items without values (In my code, an item without value, was an item with a value of 0). But you are right, it can be interesting to show the value 0.

I take note of this and will fix this in the next release.

Best,

Philippe

Options: ReplyQuote


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