public void init(ConfigHolder config) {
    for (Entry<Object, Object> entry : config.getEntries()) {
      String key = ((String) entry.getKey()).toLowerCase();
      String value = (String) entry.getValue();

      if (key.equals(MAX_LEAF_OUTPUT)) {
        maxLeafOutput = Integer.parseInt(value);
      }
    }
  }
示例#2
0
  public void init(ConfigHolder config) {
    for (Entry<Object, Object> entry : config.getEntries()) {
      String key = ((String) entry.getKey()).toLowerCase();
      String value = (String) entry.getValue();

      if (key.equals(SPLIT_SAMPLING)) {
        featureSamplingPerSplit = Double.parseDouble(value);
      } else if (key.equals(RANDOMIZED_SPLITS)) {
        randomizedSplits = value.equals("true");
      } else if (key.equals(NUM_LEAVES)) {
        numLeaves = Integer.parseInt(value);
      } else if (key.equals(MIN_INSTANCE_PERCENTAGE_PER_LEAF)) {
        minInstancePercentagePerLeaf = Double.parseDouble(value);
      } else if (key.equals(FEATURES_TO_DISCARD)) {
        featuresToDiscard = value;
      } else if (key.equals(FEATURES_TO_INCLUDE)) {
        featuresToInclude = value;
      }
    }
  }