com.rapidminer.operator.ports.metadata
Class ExampleSetMetaData

java.lang.Object
  extended by com.rapidminer.operator.ports.metadata.MetaData
      extended by com.rapidminer.operator.ports.metadata.ExampleSetMetaData
All Implemented Interfaces:
java.io.Serializable

public class ExampleSetMetaData
extends MetaData

This class stores detailed meta data information about ExampleSets.

Author:
Simon Fischer, Sebastian Land
See Also:
Serialized Form

Constructor Summary
ExampleSetMetaData()
           
ExampleSetMetaData(ExampleSet exampleSet)
          This constructor will generate a complete meta data description of the given example set.
ExampleSetMetaData(ExampleSet exampleSet, boolean shortened)
           
ExampleSetMetaData(java.util.List<AttributeMetaData> attributeMetaData)
           
ExampleSetMetaData(java.util.Map<java.lang.String,java.lang.Object> keyValueMap)
           
ExampleSetMetaData(java.lang.String key, java.lang.Object value)
           
 
Method Summary
 void addAllAttributes(java.util.Collection<AttributeMetaData> attributes)
           
 void addAttribute(AttributeMetaData attribute)
           
 void attributesAreKnown()
           
 void attributesAreSubset()
          Declares that the attributes in this example set are only a subset of attributeMetaData.
 void attributesAreSuperset()
          Declares that the attributes in this example set are a superset of attributeMetaData.
 void clear()
          This method removes every attribute
 void clearRegular()
          This method removes all regular attributes from this exampleSet meta data
 ExampleSetMetaData clone()
           
 MetaDataInfo containsAttributeName(java.lang.String name)
           
 MetaDataInfo containsAttributesWithValueType(int type, boolean includeSpecials)
           
 MetaDataInfo containsSpecialAttribute(java.lang.String role)
           
 MetaDataInfo equalHeader(ExampleSetMetaData other)
          Checks if the attribute sets are equal.
 java.util.Collection<AttributeMetaData> getAllAttributes()
           
 AttributeMetaData getAttributeByName(java.lang.String name)
           
 AttributeMetaData getAttributeByRole(java.lang.String role)
           
 java.util.Collection<java.lang.String> getAttributeNamesByType(int mustBeOfType)
           
 SetRelation getAttributeSetRelation()
           
 java.lang.String getDescription()
           
 AttributeMetaData getLabelMetaData()
           
static int getMaximumNumberOfAttributes()
          Returns the maximum number of attributes to be used for shortened meta data generation as specified by RapidMiner.PROPERTY_RAPIDMINER_GENERAL_MAX_META_DATA_ATTRIBUTES.
 MDInteger getNumberOfExamples()
           
 int getNumberOfRegularAttributes()
           
 java.lang.String getShortDescription()
           
 AttributeMetaData getSpecial(java.lang.String role)
           
 MetaDataInfo hasSpecial(java.lang.String role)
          This returns if an attribute with the given role exists in the example set.
 ExampleSetMetaData joinAttributes(ExampleSetMetaData es2, java.lang.String prefixForDuplicates)
          Joins the attributes of both example sets.
 void mergeSetRelation(SetRelation relation)
          Changes the knowledge about the attributes in this set.
 void numberOfExamplesIsUnkown()
           
 void removeAllAttributes()
           
 void removeAttribute(AttributeMetaData attribute)
           
 void setAttributes(java.util.List<AttributeMetaData> attributes)
           
 void setNominalDataWasShrinked(boolean b)
           
 void setNumberOfExamples(int num)
          Convenience method for setting the number of examples if the number is known exactly.
 void setNumberOfExamples(MDInteger num)
          Method for setting the number of examples.
 java.lang.String toString()
           
 MetaData transpose()
           
 
Methods inherited from class com.rapidminer.operator.ports.metadata.MetaData
addToHistory, forIOObject, forIOObject, getAnnotations, getErrorsForInput, getGenerationHistory, getGenerationHistoryAsHTML, getMetaData, getObjectClass, isCompatible, putMetaData, setAnnotations
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExampleSetMetaData

public ExampleSetMetaData()

ExampleSetMetaData

public ExampleSetMetaData(java.util.Map<java.lang.String,java.lang.Object> keyValueMap)

ExampleSetMetaData

public ExampleSetMetaData(java.lang.String key,
                          java.lang.Object value)

ExampleSetMetaData

public ExampleSetMetaData(java.util.List<AttributeMetaData> attributeMetaData)

ExampleSetMetaData

public ExampleSetMetaData(ExampleSet exampleSet)
This constructor will generate a complete meta data description of the given example set. Please pay attention to the fact that it might be very big since the meta data will contain each nominal value stored in the data. With large, id-like data this will become very big.


ExampleSetMetaData

public ExampleSetMetaData(ExampleSet exampleSet,
                          boolean shortened)
Method Detail

getAttributeByName

public AttributeMetaData getAttributeByName(java.lang.String name)

getAttributeByRole

public AttributeMetaData getAttributeByRole(java.lang.String role)

addAllAttributes

public void addAllAttributes(java.util.Collection<AttributeMetaData> attributes)

getAllAttributes

public java.util.Collection<AttributeMetaData> getAllAttributes()

removeAttribute

public void removeAttribute(AttributeMetaData attribute)

addAttribute

public void addAttribute(AttributeMetaData attribute)

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class MetaData

setAttributes

public void setAttributes(java.util.List<AttributeMetaData> attributes)

clone

public ExampleSetMetaData clone()
Overrides:
clone in class MetaData

containsAttributesWithValueType

public MetaDataInfo containsAttributesWithValueType(int type,
                                                    boolean includeSpecials)

getSpecial

public AttributeMetaData getSpecial(java.lang.String role)

getLabelMetaData

public AttributeMetaData getLabelMetaData()

hasSpecial

public MetaDataInfo hasSpecial(java.lang.String role)
This returns if an attribute with the given role exists in the example set. If the role is confidence, then it checks not whether exactly the same role occurs, but if any role starts with the confidence stem.


joinAttributes

public ExampleSetMetaData joinAttributes(ExampleSetMetaData es2,
                                         java.lang.String prefixForDuplicates)
Joins the attributes of both example sets.

Parameters:
prefixForDuplicates - If this is non-null, attributes with duplicate names will be renamed. Otherwise, only one will be kept.

containsAttributeName

public MetaDataInfo containsAttributeName(java.lang.String name)

containsSpecialAttribute

public MetaDataInfo containsSpecialAttribute(java.lang.String role)

mergeSetRelation

public void mergeSetRelation(SetRelation relation)
Changes the knowledge about the attributes in this set. Example: If we had full knowledge (SetRelation#EQUAL) and relation if {@link SetRelation#SUBSET}, our knowledge changes to {@link SetRelation#SUBSET}. If the current knowledge is {@link SetRelation#SUBSET} and relation is {@link SetRelation#SUPERSET}, our knowledge changes to {@link SetRelation#UNKNOWN}


getAttributeSetRelation

public SetRelation getAttributeSetRelation()

attributesAreKnown

public void attributesAreKnown()

attributesAreSuperset

public void attributesAreSuperset()
Declares that the attributes in this example set are a superset of attributeMetaData.


attributesAreSubset

public void attributesAreSubset()
Declares that the attributes in this example set are only a subset of attributeMetaData.


setNumberOfExamples

public void setNumberOfExamples(int num)
Convenience method for setting the number of examples if the number is known exactly.


setNumberOfExamples

public void setNumberOfExamples(MDInteger num)
Method for setting the number of examples.


numberOfExamplesIsUnkown

public void numberOfExamplesIsUnkown()

getNumberOfExamples

public MDInteger getNumberOfExamples()

toString

public java.lang.String toString()
Overrides:
toString in class MetaData

transpose

public MetaData transpose()

clearRegular

public void clearRegular()
This method removes all regular attributes from this exampleSet meta data


clear

public void clear()
This method removes every attribute


getNumberOfRegularAttributes

public int getNumberOfRegularAttributes()

equalHeader

public MetaDataInfo equalHeader(ExampleSetMetaData other)
Checks if the attribute sets are equal.


getAttributeNamesByType

public java.util.Collection<java.lang.String> getAttributeNamesByType(int mustBeOfType)

getShortDescription

public java.lang.String getShortDescription()

removeAllAttributes

public void removeAllAttributes()

setNominalDataWasShrinked

public void setNominalDataWasShrinked(boolean b)

getMaximumNumberOfAttributes

public static int getMaximumNumberOfAttributes()
Returns the maximum number of attributes to be used for shortened meta data generation as specified by RapidMiner.PROPERTY_RAPIDMINER_GENERAL_MAX_META_DATA_ATTRIBUTES.



Copyright © 2001-2009 by Rapid-I