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:
You do the same thing for the lift and support.
By the way, to use DecimalFormat, you need to add this to your class
Hope this helps!