@Test public void isDefault(){ FieldName name = FieldName.create("x"); DataField dataField = new DataField(name, OpType.CONTINUOUS, DataType.DOUBLE); MiningField miningField = new MiningField(name); assertTrue(InputFieldUtil.isDefault(dataField, miningField)); miningField.setOpType(OpType.CATEGORICAL); assertFalse(InputFieldUtil.isDefault(dataField, miningField)); }
static public boolean isDefault(Field<?> field, MiningField miningField){ if(field instanceof DataField){ if(!Objects.equals(field.getOpType(), FieldUtil.getOpType(field, miningField))){ return false; } } else { if(!Objects.equals(miningField.getOpType(), null)){ return false; } } Object invalidValueReplacement = miningField.getInvalidValueReplacement(); if(invalidValueReplacement != null){ return false; } InvalidValueTreatmentMethod invalidValueTreatmentMethod = miningField.getInvalidValueTreatment(); switch(invalidValueTreatmentMethod){ case RETURN_INVALID: case AS_IS: break; default: return false; } Object missingValueReplacement = miningField.getMissingValueReplacement(); if(missingValueReplacement != null){ return false; } OutlierTreatmentMethod outlierTreatmentMethod = miningField.getOutlierTreatment(); switch(outlierTreatmentMethod){ case AS_IS: break; default: return false; } return true; }
InputFieldUtil { static public boolean isDefault(Field<?> field, MiningField miningField){ if(field instanceof DataField){ if(!Objects.equals(field.getOpType(), FieldUtil.getOpType(field, miningField))){ return false; } } else { if(!Objects.equals(miningField.getOpType(), null)){ return false; } } Object invalidValueReplacement = miningField.getInvalidValueReplacement(); if(invalidValueReplacement != null){ return false; } InvalidValueTreatmentMethod invalidValueTreatmentMethod = miningField.getInvalidValueTreatment(); switch(invalidValueTreatmentMethod){ case RETURN_INVALID: case AS_IS: break; default: return false; } Object missingValueReplacement = miningField.getMissingValueReplacement(); if(missingValueReplacement != null){ return false; } OutlierTreatmentMethod outlierTreatmentMethod = miningField.getOutlierTreatment(); switch(outlierTreatmentMethod){ case AS_IS: break; default: return false; } return true; } }
InputFieldUtil { static public boolean isDefault(Field<?> field, MiningField miningField){ if(field instanceof DataField){ if(!Objects.equals(field.getOpType(), FieldUtil.getOpType(field, miningField))){ return false; } } else { if(!Objects.equals(miningField.getOpType(), null)){ return false; } } Object invalidValueReplacement = miningField.getInvalidValueReplacement(); if(invalidValueReplacement != null){ return false; } InvalidValueTreatmentMethod invalidValueTreatmentMethod = miningField.getInvalidValueTreatment(); switch(invalidValueTreatmentMethod){ case RETURN_INVALID: case AS_IS: break; default: return false; } Object missingValueReplacement = miningField.getMissingValueReplacement(); if(missingValueReplacement != null){ return false; } OutlierTreatmentMethod outlierTreatmentMethod = miningField.getOutlierTreatment(); switch(outlierTreatmentMethod){ case AS_IS: break; default: return false; } return true; } private  InputFieldUtil(); }
InputFieldUtil { static public boolean isDefault(Field<?> field, MiningField miningField){ if(field instanceof DataField){ if(!Objects.equals(field.getOpType(), FieldUtil.getOpType(field, miningField))){ return false; } } else { if(!Objects.equals(miningField.getOpType(), null)){ return false; } } Object invalidValueReplacement = miningField.getInvalidValueReplacement(); if(invalidValueReplacement != null){ return false; } InvalidValueTreatmentMethod invalidValueTreatmentMethod = miningField.getInvalidValueTreatment(); switch(invalidValueTreatmentMethod){ case RETURN_INVALID: case AS_IS: break; default: return false; } Object missingValueReplacement = miningField.getMissingValueReplacement(); if(missingValueReplacement != null){ return false; } OutlierTreatmentMethod outlierTreatmentMethod = miningField.getOutlierTreatment(); switch(outlierTreatmentMethod){ case AS_IS: break; default: return false; } return true; } private  InputFieldUtil(); static boolean isDefault(Field<?> field, MiningField miningField); static FieldValue prepareInputValue(Field<?> field, MiningField miningField, Object value); static FieldValue prepareResidualInputValue(DataField dataField, MiningField miningField, Object value); }
InputFieldUtil { static public boolean isDefault(Field<?> field, MiningField miningField){ if(field instanceof DataField){ if(!Objects.equals(field.getOpType(), FieldUtil.getOpType(field, miningField))){ return false; } } else { if(!Objects.equals(miningField.getOpType(), null)){ return false; } } Object invalidValueReplacement = miningField.getInvalidValueReplacement(); if(invalidValueReplacement != null){ return false; } InvalidValueTreatmentMethod invalidValueTreatmentMethod = miningField.getInvalidValueTreatment(); switch(invalidValueTreatmentMethod){ case RETURN_INVALID: case AS_IS: break; default: return false; } Object missingValueReplacement = miningField.getMissingValueReplacement(); if(missingValueReplacement != null){ return false; } OutlierTreatmentMethod outlierTreatmentMethod = miningField.getOutlierTreatment(); switch(outlierTreatmentMethod){ case AS_IS: break; default: return false; } return true; } private  InputFieldUtil(); static boolean isDefault(Field<?> field, MiningField miningField); static FieldValue prepareInputValue(Field<?> field, MiningField miningField, Object value); static FieldValue prepareResidualInputValue(DataField dataField, MiningField miningField, Object value);  }