@Override protected ExampleSetMetaData modifyMetaData(ExampleSetMetaData exampleSetMetaData) throws UndefinedParameterError { AttributeMetaData label = exampleSetMetaData.getLabelMetaData(); if (label != null) { if (label.isNumerical() && getParameterAsDouble(PARAMETER_LABEL_NOISE) > 0) { label.setValueSetRelation(SetRelation.SUPERSET); } } double defaultNoise = getParameterAsDouble(PARAMETER_DEFAULT_ATTRIBUTE_NOISE); if (defaultNoise > 0) { for (AttributeMetaData amd : exampleSetMetaData.getAllAttributes()) { if (!amd.isSpecial()) { if (amd.isNumerical()) { amd.setValueSetRelation(SetRelation.SUPERSET); } } } } int numberOfRandomAttributes = getParameterAsInt(PARAMETER_RANDOM_ATTRIBUTES); for (int i = 0; i < numberOfRandomAttributes; i++) { AttributeMetaData amd = new AttributeMetaData("random" + ((i == 0) ? "" : i + ""), Ontology.REAL); amd.setValueRange( new Range(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY), SetRelation.SUBSET); exampleSetMetaData.addAttribute(amd); } return exampleSetMetaData; }
@Override protected MetaData modifyMetaData(ExampleSetMetaData metaData) throws UndefinedParameterError { AttributeMetaData amd = metaData.getAttributeByName(getParameterAsString(PARAMETER_ATTRIBUTE_NAME)); if (amd != null) { AttributeMetaData newAttribute = amd.clone(); newAttribute.setType(Ontology.DATE_TIME); newAttribute.getMean().setUnkown(); newAttribute.setValueSetRelation(SetRelation.UNKNOWN); if (!getParameterAsBoolean(PARAMETER_KEEP_OLD_ATTRIBUTE)) metaData.removeAttribute(amd); else newAttribute.setName(newAttribute.getName() + "_AS_DATE"); metaData.addAttribute(newAttribute); } return metaData; }
@Override protected Collection<AttributeMetaData> modifyAttributeMetaData( ExampleSetMetaData emd, AttributeMetaData amd) throws UndefinedParameterError { amd.setValueSetRelation(SetRelation.SUBSET); return Collections.singleton(amd); }