@Override public DataField getField(){ return (DataField)super.getField(); } }
protected boolean assessPurity(){ List<InputField> inputFields = getInputFields(); for(InputField inputField : inputFields){ Field<?> field = inputField.getField(); MiningField miningField = inputField.getMiningField(); if(!InputFieldUtil.isDefault(field, miningField)){ return false; } } return this.localDerivedFields.isEmpty() && this.outputFields.isEmpty(); }
/** * <p> * Returns the domain of valid values for this categorical or ordinal field. * If specified, then all input values that are contained in this list shall be considered valid, and all others invalid. * In not specified, then all input values shall be considered valid. * </p> * * <p> * List elements are all valid values in PMML representation. * For example, if the data type of this field is {@link DataType#INTEGER}, then all list elements shall be {@link Integer}. * </p> * * @return A non-empty list, or <code>null</code>. * * @see #getDataType() * @see #getOpType() * * @see TypeUtil#parse(DataType, String) * @see TypeUtil#parseOrCast(DataType, Object) */ public List<?> getDiscreteDomain(){ Field<?> field = getField(); if(field instanceof HasDiscreteDomain){ List<?> validValues = FieldUtil.getValidValues((Field & HasDiscreteDomain)field); if(validValues != null && !validValues.isEmpty()){ return validValues; } } return null; }
@Override public OpType getOpType(){ return FieldUtil.getOpType(getField(), getMiningField()); }
/** * <p> * Prepares the input value for a field. * </p> * * <p> * First, the value is converted from the user-supplied representation to PMML representation. * After that, the value is subjected to missing value treatment, invalid value treatment and outlier treatment. * </p> * * @param value The input value in user-supplied representation. * Use <code>null</code> to represent a missing input value. * * @throws EvaluationException If the input value preparation fails. * @throws InvalidMarkupException * @throws UnsupportedMarkupException */ public FieldValue prepare(Object value){ return InputFieldUtil.prepareInputValue(getField(), getMiningField(), value); }
/** * <p> * Returns the domain of valid values for this continuous field. * If specified, then all input values that are contained in this set shall be considered valid, and all others invalid. * If not specified, then all input values shall be considered valid. * </p> * * @return A non-empty set, or <code>null</code>. * * @see #getOpType() */ public RangeSet<Double> getContinuousDomain(){ Field<?> field = getField(); if(field instanceof HasContinuousDomain){ RangeSet<Double> validRanges = FieldUtil.getValidRanges((Field & HasContinuousDomain)field); if(validRanges != null && !validRanges.isEmpty()){ return validRanges; } } return null; }
protected boolean assessParentCompatibility(){ List<InputField> inputFields = getInputFields(); for(InputField inputField : inputFields){ Field<?> field = inputField.getField(); MiningField miningField = inputField.getMiningField(); if(!(field instanceof DataField)){ continue; } // End if if(!InputFieldUtil.isDefault(field, miningField)){ return false; } } return true; }