com.rapidminer.example
Interface Attributes

All Superinterfaces:
java.lang.Cloneable, java.lang.Iterable<Attribute>, java.io.Serializable
All Known Implementing Classes:
AbstractAttributes, DelegateAttributes, SimpleAttributes

public interface Attributes
extends java.lang.Iterable<Attribute>, java.lang.Cloneable, java.io.Serializable

This container holds all information about the example set attributes. Implementors might want to override AbstractAttributes for which only one of the iterating methods must be overridden.

Author:
Ingo Mierswa

Field Summary
static int ALL
          Indicates all attributes.
static java.lang.String ATTRIBUTE_NAME
          The name of regular attributes.
static java.lang.String BASE_VALUE
          The name of the classification cost special attribute.
static java.lang.String BATCH_NAME
          The name of the special attribute batch.
static java.lang.String CLASSIFICATION_COST
          The name of the classification cost special attribute.
static java.lang.String CLUSTER_NAME
          The name of the special attribute cluster.
static java.lang.String CONFIDENCE_NAME
          The name of the confidence special attributes.
static java.lang.String ID_NAME
          The name of the special attribute id.
static java.lang.String[] KNOWN_ATTRIBUTE_TYPES
          All known names of regular and special attribute types as an array.
static java.lang.String LABEL_NAME
          The name of the special attribute label.
static java.lang.String OUTLIER_NAME
          The name of the special attribute outlier.
static java.lang.String PREDICTION_NAME
          The name of the special attribute prediction.
static int REGULAR
          Indicates regular attributes.
static int SPECIAL
          Indicates special attributes.
static int TYPE_ATTRIBUTE
          Indicates a regular attribute type.
static int TYPE_BASE_VALUE
          Indicates the special attribute type base_value.
static int TYPE_BATCH
          Indicates the special attribute type batch (example batches).
static int TYPE_CLUSTER
          Indicates the special attribute type cluster.
static int TYPE_COST
          Indicates the special attribute type cost.
static int TYPE_ID
          Indicates the special attribute type id.
static int TYPE_LABEL
          Indicates the special attribute type label.
static int TYPE_OUTLIER
          Indicates the special attribute type outlier.
static int TYPE_PREDICTION
          Indicates the special attribute type prediction.
static int TYPE_WEIGHT
          Indicates the special attribute type weight (example weights).
static java.lang.String WEIGHT_NAME
          The name of the special attribute weight (example weights).
 
Method Summary
 void add(AttributeRole attributeRole)
          Adds a new attribute role.
 void addRegular(Attribute attribute)
          Adds the given attribute as regular attribute.
 java.util.Iterator<AttributeRole> allAttributeRoles()
          Returns an iterator over all attribute roles, including the special attribute roles.
 java.util.Iterator<Attribute> allAttributes()
          Returns an iterator over all attributes, including the special attributes.
 int allSize()
          Returns the number of all attributes, i.e. of the regular and the special attributes.
 void clearRegular()
          Removes all regular attributes.
 void clearSpecial()
          Removes all special attributes.
 java.lang.Object clone()
          Returns a clone of this attribute set.
 boolean contains(Attribute attribute)
          Returns true if this attribute set contains the given attribute.
 Attribute[] createRegularAttributeArray()
          This method creates an attribute array from all regular attributes.
 boolean equals(java.lang.Object o)
          Returns true if the given object is equal to this attribute set.
 AttributeRole findRoleByName(java.lang.String name)
          Finds the AttributeRole belonging to the attribute with the given name (both regular and special).
 AttributeRole findRoleBySpecialName(java.lang.String specialName)
          Finds the AttributeRole with the given special name (both regular and special).
 Attribute get(java.lang.String name)
          Returns the attribute for the given name.
 Attribute getCluster()
          Returns the cluster attribute or null if no label attribute is defined.
 Attribute getCost()
          Returns the cost attribute or null if no label attribute is defined.
 Attribute getId()
          Returns the id attribute or null if no label attribute is defined.
 Attribute getLabel()
          Returns the label attribute or null if no label attribute is defined.
 Attribute getOutlier()
          Returns the outlier attribute or null if no label attribute is defined.
 Attribute getPredictedLabel()
          Returns the predicted label attribute or null if no label attribute is defined.
 Attribute getRegular(java.lang.String name)
          Returns the regular attribute for the given name.
 AttributeRole getRole(Attribute attribute)
          Returns the attribute role for the given attribute.
 AttributeRole getRole(java.lang.String name)
          Returns the attribute role for the given name.
 Attribute getSpecial(java.lang.String name)
          Returns the special attribute for the given special name.
 Attribute getWeight()
          Returns the weight attribute or null if no label attribute is defined.
 int hashCode()
          Returns the hash code of this attribute set.
 java.util.Iterator<Attribute> iterator()
          Iterates over all regular attributes.
 java.util.Iterator<AttributeRole> regularAttributes()
          Returns an iterator over the attribute roles of the special attributes.
 boolean remove(Attribute attribute)
          Removes the given attribute.
 boolean remove(AttributeRole attributeRole)
          Removes the given attribute role.
 void rename(AttributeRole attributeRole, java.lang.String newSpecialName)
           
 void rename(Attribute attribute, java.lang.String newName)
          Notifies the Attributes that this attribute will rename itself to the given name immediately after this method returns.
 Attribute replace(Attribute first, Attribute second)
          Replaces the first attribute by the second.
 void setCluster(Attribute cluster)
          Sets the cluster attribute.
 void setCost(Attribute cost)
          Sets the cost attribute.
 void setId(Attribute id)
          Sets the id attribute.
 void setLabel(Attribute label)
          Sets the label attribute.
 void setOutlier(Attribute outlier)
          Sets the outlier attribute.
 void setPredictedLabel(Attribute predictedLabel)
          Sets the predicted label attribute.
 void setSpecialAttribute(Attribute attribute, java.lang.String specialName)
          Sets the special attribute for the given name.
 void setWeight(Attribute weight)
          Sets the weight attribute.
 int size()
          Returns the number of regular attributes.
 java.util.Iterator<AttributeRole> specialAttributes()
          Returns an iterator over the attribute roles of the special attributes.
 int specialSize()
          Returns the number of special attributes.
 java.lang.String toString()
          Returns a string representation of this attribute set.
 

Field Detail

REGULAR

static final int REGULAR
Indicates regular attributes.

See Also:
Constant Field Values

SPECIAL

static final int SPECIAL
Indicates special attributes.

See Also:
Constant Field Values

ALL

static final int ALL
Indicates all attributes.

See Also:
Constant Field Values

CONFIDENCE_NAME

static final java.lang.String CONFIDENCE_NAME
The name of the confidence special attributes.

See Also:
Constant Field Values

ATTRIBUTE_NAME

static final java.lang.String ATTRIBUTE_NAME
The name of regular attributes.

See Also:
Constant Field Values

ID_NAME

static final java.lang.String ID_NAME
The name of the special attribute id.

See Also:
Constant Field Values

LABEL_NAME

static final java.lang.String LABEL_NAME
The name of the special attribute label.

See Also:
Constant Field Values

PREDICTION_NAME

static final java.lang.String PREDICTION_NAME
The name of the special attribute prediction.

See Also:
Constant Field Values

CLUSTER_NAME

static final java.lang.String CLUSTER_NAME
The name of the special attribute cluster.

See Also:
Constant Field Values

WEIGHT_NAME

static final java.lang.String WEIGHT_NAME
The name of the special attribute weight (example weights).

See Also:
Constant Field Values

BATCH_NAME

static final java.lang.String BATCH_NAME
The name of the special attribute batch.

See Also:
Constant Field Values

OUTLIER_NAME

static final java.lang.String OUTLIER_NAME
The name of the special attribute outlier.

See Also:
Constant Field Values

CLASSIFICATION_COST

static final java.lang.String CLASSIFICATION_COST
The name of the classification cost special attribute.

See Also:
Constant Field Values

BASE_VALUE

static final java.lang.String BASE_VALUE
The name of the classification cost special attribute.

See Also:
Constant Field Values

KNOWN_ATTRIBUTE_TYPES

static final java.lang.String[] KNOWN_ATTRIBUTE_TYPES
All known names of regular and special attribute types as an array.


TYPE_ATTRIBUTE

static final int TYPE_ATTRIBUTE
Indicates a regular attribute type.

See Also:
Constant Field Values

TYPE_LABEL

static final int TYPE_LABEL
Indicates the special attribute type label.

See Also:
Constant Field Values

TYPE_ID

static final int TYPE_ID
Indicates the special attribute type id.

See Also:
Constant Field Values

TYPE_WEIGHT

static final int TYPE_WEIGHT
Indicates the special attribute type weight (example weights).

See Also:
Constant Field Values

TYPE_BATCH

static final int TYPE_BATCH
Indicates the special attribute type batch (example batches).

See Also:
Constant Field Values

TYPE_CLUSTER

static final int TYPE_CLUSTER
Indicates the special attribute type cluster.

See Also:
Constant Field Values

TYPE_PREDICTION

static final int TYPE_PREDICTION
Indicates the special attribute type prediction.

See Also:
Constant Field Values

TYPE_OUTLIER

static final int TYPE_OUTLIER
Indicates the special attribute type outlier.

See Also:
Constant Field Values

TYPE_COST

static final int TYPE_COST
Indicates the special attribute type cost.

See Also:
Constant Field Values

TYPE_BASE_VALUE

static final int TYPE_BASE_VALUE
Indicates the special attribute type base_value.

See Also:
Constant Field Values
Method Detail

clone

java.lang.Object clone()
Returns a clone of this attribute set.


equals

boolean equals(java.lang.Object o)
Returns true if the given object is equal to this attribute set.

Overrides:
equals in class java.lang.Object

hashCode

int hashCode()
Returns the hash code of this attribute set.

Overrides:
hashCode in class java.lang.Object

iterator

java.util.Iterator<Attribute> iterator()
Iterates over all regular attributes.

Specified by:
iterator in interface java.lang.Iterable<Attribute>

allAttributes

java.util.Iterator<Attribute> allAttributes()
Returns an iterator over all attributes, including the special attributes.


allAttributeRoles

java.util.Iterator<AttributeRole> allAttributeRoles()
Returns an iterator over all attribute roles, including the special attribute roles.


specialAttributes

java.util.Iterator<AttributeRole> specialAttributes()
Returns an iterator over the attribute roles of the special attributes.


regularAttributes

java.util.Iterator<AttributeRole> regularAttributes()
Returns an iterator over the attribute roles of the special attributes.


contains

boolean contains(Attribute attribute)
Returns true if this attribute set contains the given attribute.


size

int size()
Returns the number of regular attributes.


specialSize

int specialSize()
Returns the number of special attributes.


allSize

int allSize()
Returns the number of all attributes, i.e. of the regular and the special attributes.


add

void add(AttributeRole attributeRole)
Adds a new attribute role.


addRegular

void addRegular(Attribute attribute)
Adds the given attribute as regular attribute.


remove

boolean remove(AttributeRole attributeRole)
Removes the given attribute role.


remove

boolean remove(Attribute attribute)
Removes the given attribute.


clearRegular

void clearRegular()
Removes all regular attributes.


clearSpecial

void clearSpecial()
Removes all special attributes.


replace

Attribute replace(Attribute first,
                  Attribute second)
Replaces the first attribute by the second. Returns the second attribute.


get

Attribute get(java.lang.String name)
Returns the attribute for the given name.


getRegular

Attribute getRegular(java.lang.String name)
Returns the regular attribute for the given name.


getSpecial

Attribute getSpecial(java.lang.String name)
Returns the special attribute for the given special name.


getRole

AttributeRole getRole(Attribute attribute)
Returns the attribute role for the given attribute.


getRole

AttributeRole getRole(java.lang.String name)
Returns the attribute role for the given name.


getLabel

Attribute getLabel()
Returns the label attribute or null if no label attribute is defined.


setLabel

void setLabel(Attribute label)
Sets the label attribute. If the given attribute is null, no label attribute will be used.


getPredictedLabel

Attribute getPredictedLabel()
Returns the predicted label attribute or null if no label attribute is defined.


setPredictedLabel

void setPredictedLabel(Attribute predictedLabel)
Sets the predicted label attribute. If the given attribute is null, no predicted label attribute will be used.


getId

Attribute getId()
Returns the id attribute or null if no label attribute is defined.


setId

void setId(Attribute id)
Sets the id attribute. If the given attribute is null, no id attribute will be used.


getWeight

Attribute getWeight()
Returns the weight attribute or null if no label attribute is defined.


setWeight

void setWeight(Attribute weight)
Sets the weight attribute. If the given attribute is null, no weight attribute will be used.


getCluster

Attribute getCluster()
Returns the cluster attribute or null if no label attribute is defined.


setCluster

void setCluster(Attribute cluster)
Sets the cluster attribute. If the given attribute is null, no cluster attribute will be used.


getOutlier

Attribute getOutlier()
Returns the outlier attribute or null if no label attribute is defined.


setOutlier

void setOutlier(Attribute outlier)
Sets the outlier attribute. If the given attribute is null, no outlier attribute will be used.


getCost

Attribute getCost()
Returns the cost attribute or null if no label attribute is defined.


setCost

void setCost(Attribute cost)
Sets the cost attribute. If the given attribute is null, no cost attribute will be used.


setSpecialAttribute

void setSpecialAttribute(Attribute attribute,
                         java.lang.String specialName)
Sets the special attribute for the given name. If the given attribute is null, no special attribute with this name will be used.


createRegularAttributeArray

Attribute[] createRegularAttributeArray()
This method creates an attribute array from all regular attributes. ATTENTION: This method should only be used if it is ensured that the attribute roles and number of attributes cannot be changed, otherwise the delivered array will not be synchronized with the attribute roles object. Therefore, the iterator methods of this class should be preferred.


toString

java.lang.String toString()
Returns a string representation of this attribute set.

Overrides:
toString in class java.lang.Object

findRoleByName

AttributeRole findRoleByName(java.lang.String name)
Finds the AttributeRole belonging to the attribute with the given name (both regular and special).


findRoleBySpecialName

AttributeRole findRoleBySpecialName(java.lang.String specialName)
Finds the AttributeRole with the given special name (both regular and special).


rename

void rename(AttributeRole attributeRole,
            java.lang.String newSpecialName)
See Also:
{#rename(Attribute, String)}

rename

void rename(Attribute attribute,
            java.lang.String newName)
Notifies the Attributes that this attribute will rename itself to the given name immediately after this method returns.



Copyright © 2001-2009 by Rapid-I