Program: 31730
Project: 31730
Buggy source:
/** 
 * Check the setting for model training. It will make sure (num_of_layers > 0 && num_of_layers = hidden_nodes_size && num_of_layse = active_func_size)
 * @param train - @ModelTrainConf to check
 * @return @ValidateResult
 */
@SuppressWarnings("String_Node_Str") private ValidateResult checkTrainSetting(ModelConfig modelConfig,ModelTrainConf train){
  ValidateResult result=new ValidateResult(true);
  if (train.getBaggingNum() == null || train.getBaggingNum() < 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getNumKFold() != null && train.getNumKFold() > 20) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getBaggingSampleRate() == null || train.getBaggingSampleRate().compareTo(Double.valueOf(0)) <= 0 || train.getBaggingSampleRate().compareTo(Double.valueOf(1)) > 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getValidSetRate() == null || train.getValidSetRate().compareTo(Double.valueOf(0)) < 0 || train.getValidSetRate().compareTo(Double.valueOf(1)) >= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getNumTrainEpochs() == null || train.getNumTrainEpochs() <= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getEpochsPerIteration() != null && train.getEpochsPerIteration() <= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getWorkerThreadCount() != null && (train.getWorkerThreadCount() <= 0 || train.getWorkerThreadCount() > 32)) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getConvergenceThreshold() != null && train.getConvergenceThreshold().compareTo(0.0) < 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (modelConfig.isClassification() && train.isOneVsAll() && !CommonUtils.isTreeModel(train.getAlgorithm())&& !train.getAlgorithm().equalsIgnoreCase("String_Node_Str")) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (modelConfig.isClassification() && train.getMultiClassifyMethod() == MultipleClassification.NATIVE && train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
    Object impurity=train.getParams().get("String_Node_Str");
    if (impurity != null && !"String_Node_Str".equalsIgnoreCase(impurity.toString()) && !"String_Node_Str".equalsIgnoreCase(impurity.toString())) {
      ValidateResult tmpResult=new ValidateResult(true);
      tmpResult.setStatus(false);
      tmpResult.getCauses().add("String_Node_Str");
      result=ValidateResult.mergeResult(result,tmpResult);
    }
  }
  GridSearch gs=new GridSearch(train.getParams());
  if (modelConfig.isRegression() && !gs.hasHyperParam()) {
    if (train.getAlgorithm().equalsIgnoreCase("String_Node_Str")) {
      Map<String,Object> params=train.getParams();
      int layerCnt=(Integer)params.get(CommonConstants.NUM_HIDDEN_LAYERS);
      if (layerCnt < 0) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      List<Integer> hiddenNode=(List<Integer>)params.get(CommonConstants.NUM_HIDDEN_NODES);
      List<String> activateFucs=(List<String>)params.get(CommonConstants.ACTIVATION_FUNC);
      if (hiddenNode.size() != activateFucs.size() || layerCnt != activateFucs.size()) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add(CommonConstants.NUM_HIDDEN_LAYERS + "String_Node_Str" + CommonConstants.NUM_HIDDEN_NODES+ "String_Node_Str"+ "String_Node_Str"+ CommonConstants.ACTIVATION_FUNC+ "String_Node_Str"+ "String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Double learningRate=Double.valueOf(params.get(CommonConstants.LEARNING_RATE).toString());
      if (learningRate != null && (learningRate.compareTo(Double.valueOf(0)) <= 0)) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object learningDecayO=params.get("String_Node_Str");
      if (learningDecayO != null) {
        Double learningDecay=Double.valueOf(learningDecayO.toString());
        if (learningDecay != null && ((learningDecay.compareTo(Double.valueOf(0)) < 0) || (learningDecay.compareTo(Double.valueOf(1)) >= 0))) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object elmObject=params.get(DTrainUtils.IS_ELM);
      boolean isELM=elmObject == null ? false : "String_Node_Str".equalsIgnoreCase(elmObject.toString());
      if (isELM && layerCnt != 1) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object dropoutObj=params.get(CommonConstants.DROPOUT_RATE);
      if (dropoutObj != null) {
        Double dropoutRate=Double.valueOf(dropoutObj.toString());
        if (dropoutRate != null && (dropoutRate < 0d || dropoutRate >= 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
    }
    if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(NNConstants.NN_ALG_NAME)) {
      Map<String,Object> params=train.getParams();
      Object fssObj=params.get("String_Node_Str");
      if (fssObj == null) {
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        boolean isNumber=false;
        double doubleFss=0;
        try {
          doubleFss=Double.parseDouble(fssObj.toString());
          isNumber=true;
        }
 catch (        Exception e) {
          isNumber=false;
        }
        if (isNumber && (doubleFss <= 0d || doubleFss > 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
        }
 else {
          boolean fssInEnum=false;
          for (          FeatureSubsetStrategy fss : FeatureSubsetStrategy.values()) {
            if (fss.toString().equalsIgnoreCase(fssObj.toString())) {
              fssInEnum=true;
              break;
            }
          }
          if (!fssInEnum) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
          }
        }
      }
    }
    if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
      Map<String,Object> params=train.getParams();
      if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
        Object loss=params.get("String_Node_Str");
        if (loss != null && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString())) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
        if (loss == null) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object maxDepthObj=params.get("String_Node_Str");
      if (maxDepthObj != null) {
        int maxDepth=Integer.valueOf(maxDepthObj.toString());
        if (maxDepth <= 0 || maxDepth > 20) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object vtObj=params.get("String_Node_Str");
      if (vtObj != null) {
        double validationTolerance=Double.valueOf(vtObj.toString());
        if (validationTolerance < 0d || validationTolerance >= 1d) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object maxLeavesObj=params.get("String_Node_Str");
      if (maxLeavesObj != null) {
        int maxLeaves=Integer.valueOf(maxLeavesObj.toString());
        if (maxLeaves <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      if (maxDepthObj == null && maxLeavesObj == null) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object maxStatsMemoryMBObj=params.get("String_Node_Str");
      if (maxStatsMemoryMBObj != null) {
        int maxStatsMemoryMB=Integer.valueOf(maxStatsMemoryMBObj.toString());
        if (maxStatsMemoryMB <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object dropoutObj=params.get(CommonConstants.DROPOUT_RATE);
      if (dropoutObj != null) {
        Double dropoutRate=Double.valueOf(dropoutObj.toString());
        if (dropoutRate != null && (dropoutRate < 0d || dropoutRate >= 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
        Object learningRateObj=params.get(CommonConstants.LEARNING_RATE);
        if (learningRateObj != null) {
          Double learningRate=Double.valueOf(learningRateObj.toString());
          if (learningRate != null && (learningRate.compareTo(Double.valueOf(0)) <= 0)) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
 else {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object minInstancesPerNodeObj=params.get("String_Node_Str");
      if (minInstancesPerNodeObj != null) {
        int minInstancesPerNode=Integer.valueOf(minInstancesPerNodeObj.toString());
        if (minInstancesPerNode <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object treeNumObj=params.get("String_Node_Str");
      if (treeNumObj != null) {
        int treeNum=Integer.valueOf(treeNumObj.toString());
        if (treeNum <= 0 || treeNum > 10000) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object minInfoGainObj=params.get("String_Node_Str");
      if (minInfoGainObj != null) {
        Double minInfoGain=Double.valueOf(minInfoGainObj.toString());
        if (minInfoGain != null && (minInfoGain.compareTo(Double.valueOf(0)) < 0)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object impurityObj=params.get("String_Node_Str");
      if (impurityObj == null) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
 else {
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
          if (impurityObj != null && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString())) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
          if (impurityObj != null && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString())) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Check the setting for model training. It will make sure (num_of_layers > 0 && num_of_layers = hidden_nodes_size && num_of_layse = active_func_size)
 * @param train - @ModelTrainConf to check
 * @return @ValidateResult
 */
@SuppressWarnings("String_Node_Str") private ValidateResult checkTrainSetting(ModelConfig modelConfig,ModelTrainConf train){
  ValidateResult result=new ValidateResult(true);
  if (train.getBaggingNum() == null || train.getBaggingNum() < 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getNumKFold() != null && train.getNumKFold() > 20) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getBaggingSampleRate() == null || train.getBaggingSampleRate().compareTo(Double.valueOf(0)) <= 0 || train.getBaggingSampleRate().compareTo(Double.valueOf(1)) > 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getValidSetRate() == null || train.getValidSetRate().compareTo(Double.valueOf(0)) < 0 || train.getValidSetRate().compareTo(Double.valueOf(1)) >= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getNumTrainEpochs() == null || train.getNumTrainEpochs() <= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getEpochsPerIteration() != null && train.getEpochsPerIteration() <= 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getWorkerThreadCount() != null && (train.getWorkerThreadCount() <= 0 || train.getWorkerThreadCount() > 32)) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (train.getConvergenceThreshold() != null && train.getConvergenceThreshold().compareTo(0.0) < 0) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (modelConfig.isClassification() && train.isOneVsAll() && !CommonUtils.isTreeModel(train.getAlgorithm())&& !train.getAlgorithm().equalsIgnoreCase("String_Node_Str")) {
    ValidateResult tmpResult=new ValidateResult(true);
    tmpResult.setStatus(false);
    tmpResult.getCauses().add("String_Node_Str");
    result=ValidateResult.mergeResult(result,tmpResult);
  }
  if (modelConfig.isClassification() && train.getMultiClassifyMethod() == MultipleClassification.NATIVE && train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
    Object impurity=train.getParams().get("String_Node_Str");
    if (impurity != null && !"String_Node_Str".equalsIgnoreCase(impurity.toString()) && !"String_Node_Str".equalsIgnoreCase(impurity.toString())) {
      ValidateResult tmpResult=new ValidateResult(true);
      tmpResult.setStatus(false);
      tmpResult.getCauses().add("String_Node_Str");
      result=ValidateResult.mergeResult(result,tmpResult);
    }
  }
  GridSearch gs=new GridSearch(train.getParams());
  if (modelConfig.isRegression() && !gs.hasHyperParam()) {
    if (train.getAlgorithm().equalsIgnoreCase("String_Node_Str")) {
      Map<String,Object> params=train.getParams();
      int layerCnt=(Integer)params.get(CommonConstants.NUM_HIDDEN_LAYERS);
      if (layerCnt < 0) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      List<Integer> hiddenNode=(List<Integer>)params.get(CommonConstants.NUM_HIDDEN_NODES);
      List<String> activateFucs=(List<String>)params.get(CommonConstants.ACTIVATION_FUNC);
      if (hiddenNode.size() != activateFucs.size() || layerCnt != activateFucs.size()) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add(CommonConstants.NUM_HIDDEN_LAYERS + "String_Node_Str" + CommonConstants.NUM_HIDDEN_NODES+ "String_Node_Str"+ "String_Node_Str"+ CommonConstants.ACTIVATION_FUNC+ "String_Node_Str"+ "String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Double learningRate=Double.valueOf(params.get(CommonConstants.LEARNING_RATE).toString());
      if (learningRate != null && (learningRate.compareTo(Double.valueOf(0)) <= 0)) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object learningDecayO=params.get("String_Node_Str");
      if (learningDecayO != null) {
        Double learningDecay=Double.valueOf(learningDecayO.toString());
        if (learningDecay != null && ((learningDecay.compareTo(Double.valueOf(0)) < 0) || (learningDecay.compareTo(Double.valueOf(1)) >= 0))) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object elmObject=params.get(DTrainUtils.IS_ELM);
      boolean isELM=elmObject == null ? false : "String_Node_Str".equalsIgnoreCase(elmObject.toString());
      if (isELM && layerCnt != 1) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object dropoutObj=params.get(CommonConstants.DROPOUT_RATE);
      if (dropoutObj != null) {
        Double dropoutRate=Double.valueOf(dropoutObj.toString());
        if (dropoutRate != null && (dropoutRate < 0d || dropoutRate >= 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
    }
    if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(NNConstants.NN_ALG_NAME)) {
      Map<String,Object> params=train.getParams();
      Object fssObj=params.get("String_Node_Str");
      if (fssObj == null) {
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        boolean isNumber=false;
        double doubleFss=0;
        try {
          doubleFss=Double.parseDouble(fssObj.toString());
          isNumber=true;
        }
 catch (        Exception e) {
          isNumber=false;
        }
        if (isNumber && (doubleFss <= 0d || doubleFss > 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
        }
 else {
          boolean fssInEnum=false;
          for (          FeatureSubsetStrategy fss : FeatureSubsetStrategy.values()) {
            if (fss.toString().equalsIgnoreCase(fssObj.toString())) {
              fssInEnum=true;
              break;
            }
          }
          if (!fssInEnum) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
          }
        }
      }
    }
    if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME) || train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
      Map<String,Object> params=train.getParams();
      if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
        Object loss=params.get("String_Node_Str");
        if (loss != null && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString()) && !"String_Node_Str".equalsIgnoreCase(loss.toString())) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
        if (loss == null) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object maxDepthObj=params.get("String_Node_Str");
      if (maxDepthObj != null) {
        int maxDepth=Integer.valueOf(maxDepthObj.toString());
        if (maxDepth <= 0 || maxDepth > 20) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object vtObj=params.get("String_Node_Str");
      if (vtObj != null) {
        double validationTolerance=Double.valueOf(vtObj.toString());
        if (validationTolerance < 0d || validationTolerance >= 1d) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object maxLeavesObj=params.get("String_Node_Str");
      if (maxLeavesObj != null) {
        int maxLeaves=Integer.valueOf(maxLeavesObj.toString());
        if (maxLeaves <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      if (maxDepthObj == null && maxLeavesObj == null) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object maxStatsMemoryMBObj=params.get("String_Node_Str");
      if (maxStatsMemoryMBObj != null) {
        int maxStatsMemoryMB=Integer.valueOf(maxStatsMemoryMBObj.toString());
        if (maxStatsMemoryMB <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object dropoutObj=params.get(CommonConstants.DROPOUT_RATE);
      if (dropoutObj != null) {
        Double dropoutRate=Double.valueOf(dropoutObj.toString());
        if (dropoutRate != null && (dropoutRate < 0d || dropoutRate >= 1d)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
        Object learningRateObj=params.get(CommonConstants.LEARNING_RATE);
        if (learningRateObj != null) {
          Double learningRate=Double.valueOf(learningRateObj.toString());
          if (learningRate != null && (learningRate.compareTo(Double.valueOf(0)) <= 0)) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
 else {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
      Object minInstancesPerNodeObj=params.get("String_Node_Str");
      if (minInstancesPerNodeObj != null) {
        int minInstancesPerNode=Integer.valueOf(minInstancesPerNodeObj.toString());
        if (minInstancesPerNode <= 0) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object treeNumObj=params.get("String_Node_Str");
      if (treeNumObj != null) {
        int treeNum=Integer.valueOf(treeNumObj.toString());
        if (treeNum <= 0 || treeNum > 10000) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object minInfoGainObj=params.get("String_Node_Str");
      if (minInfoGainObj != null) {
        Double minInfoGain=Double.valueOf(minInfoGainObj.toString());
        if (minInfoGain != null && (minInfoGain.compareTo(Double.valueOf(0)) < 0)) {
          ValidateResult tmpResult=new ValidateResult(true);
          tmpResult.setStatus(false);
          tmpResult.getCauses().add("String_Node_Str");
          result=ValidateResult.mergeResult(result,tmpResult);
        }
      }
 else {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
      Object impurityObj=params.get("String_Node_Str");
      if (impurityObj == null) {
        ValidateResult tmpResult=new ValidateResult(true);
        tmpResult.setStatus(false);
        tmpResult.getCauses().add("String_Node_Str");
        result=ValidateResult.mergeResult(result,tmpResult);
      }
 else {
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.GBT_ALG_NAME)) {
          if (impurityObj != null && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString())) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
        if (train.getAlgorithm().equalsIgnoreCase(CommonConstants.RF_ALG_NAME)) {
          if (impurityObj != null && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString()) && !"String_Node_Str".equalsIgnoreCase(impurityObj.toString())) {
            ValidateResult tmpResult=new ValidateResult(true);
            tmpResult.setStatus(false);
            tmpResult.getCauses().add("String_Node_Str");
            result=ValidateResult.mergeResult(result,tmpResult);
          }
        }
      }
    }
  }
  return result;
}