Can anyone explain the purpose of "numDecimalPlaces" parameter in J48 WEKA classifier ? Its default value is 2 and its description is given as follows:

The number of decimal places to be used for the output of numbers in the model.

However, I can't understand how it going to affect the results. For example, if my feature values are something like this (0.00123 or 0.00234 etc). Does it means that the trained model will only consider these values up to 2 decimal points ? The documentation also says:

In the documentation, its mentioned in the summary fields section: Field Summary

Fields inherited from class weka.classifiers.AbstractClassifier BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
The number of decimal places used when printing numbers in the model.

It means that changing this decimal point should change the decimal points in the printed output of the trained classifier in WEKA explorer. However, when I try to change it (1,2,3,4,5 etc decimal points), it doesn't affect the number of decimals in the decision tree conditional statements in the printed output. A snapshot:

k1 <= 0.12544
|   k4 <= 4.504
|   |   k22 <= 0.24044: Class1 (179.0)


  • $\begingroup$ I am using Weka 3.8.0... I can see that I can specify the number of decimals places on each classifier used, but nothing happens when I change from the default 2 to any other number... the output is always given to 3 decimal places. Why? $\endgroup$ Mar 12, 2017 at 15:14

1 Answer 1


The short answer is: nothing. The numDecimalPlaces option, like debug and doNotCheckCapabilities, is part of the base class that all classifiers in WEKA inherit from. However, it is up to the implementation of the actual classifier to use this value to change the way the model is printed. There are no mentions of numDecimalPlaces anywhere in the source code for J48, which suggests to me that it does nothing in this case.

It looks like the only classifier in WEKA that does anything with the value entered into numDecimalPlaces is LinearRegression.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.