Hi Fendi,
I will explain to you how to print only two decimals with
FPGrowth. I will explain for the
FPGrowth version that saves to file.
But it would be the same thing for any algorithms.
For FPGrowth that saves to file, you can open the file "
AlgoAgrawalFaster94_FPGrowth_version_saveToFile" in the package "
ca.pfv.spmf.associationrules.agrawal_FPGrowth_version_saveToFile"In this file, there is a method named "
saveToFile(RuleAgrawal rule)" that is used for writing a rule to the file.
If we want to change the format to two decimals, we need to modify this.
So we need to add this:
DecimalFormat df = new DecimalFormat("#.##"
and if you want the confidence with two decimals, you can replace this:
buffer.append(rule.getConfidence());
with this:
buffer.append(df.format(rule.getConfidence()));
You do the same thing for the lift and support.
By the way, to use DecimalFormat, you need to add this to your class
import java.text.DecimalFormat;
Hope this helps!
Philippe