From c82620053b2d92f474755eba5e15c76f96e166a9 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 5 Sep 2020 11:28:57 +1000 Subject: [PATCH] Fixed the problem with treeDepthOption, it should now work correctly. Also now you can't display more trees than exist in the forest. --- .../trees/SmoothPrivateForest.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/weka/classifiers/trees/SmoothPrivateForest.java b/src/weka/classifiers/trees/SmoothPrivateForest.java index d97e275..ad39caf 100644 --- a/src/weka/classifiers/trees/SmoothPrivateForest.java +++ b/src/weka/classifiers/trees/SmoothPrivateForest.java @@ -71,7 +71,7 @@ * * *
- * -T <tree depth>
+ * -R <tree depth>
  *  Tree depth option. If <= 0 will be equal to the tree depth
  *  calculation from the paper
  *  (default -1)
@@ -105,7 +105,7 @@
  *
  *
  * @author Michael Furner (mfurner@csu.edu.au)
- * @version $Revision: 1.0$
+ * @version $Revision: 1.2.1$
  */
 public class SmoothPrivateForest extends AbstractClassifier
         implements OptionHandler, Randomizable {
@@ -295,6 +295,8 @@ public Enumeration
* *
-     * -T <tree depth>
+     * -R <tree depth>
      *  Tree depth option. If <= 0 will be equal to the tree depth
      *  calculation from the paper
      *  (default -1)
@@ -1543,7 +1548,7 @@ public void setOptions(String[] options) throws Exception {
             setForestSize(10);
         }
         
-        String sTreeDepthOption = Utils.getOption('T', options);
+        String sTreeDepthOption = Utils.getOption('R', options);
         if (sNumberTrees.length() != 0) {
             setTreeDepthOption(Integer.parseInt(sTreeDepthOption));
         } else {
@@ -1614,10 +1619,8 @@ public String[] getOptions() {
         result.add("-D");
         result.add("" + getNumDisplayTrees());
         
-        if(m_treeDepthOption <= 0) {
-            result.add("-T");
-            result.add("" + getTreeDepthOption());
-        }
+        result.add("-R");
+        result.add("" + getTreeDepthOption());
 
         result.add("-E");
         result.add("" + getPrivacyBudget());