com.rapidminer.example
Class AttributeWeight

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.tools.math.Averagable
              extended by com.rapidminer.example.AttributeWeight
All Implemented Interfaces:
IOObject, ResultObject, Saveable, Readable, Reportable, LoggingHandler, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AttributeWeight>

public class AttributeWeight
extends Averagable
implements java.lang.Comparable<AttributeWeight>

Helper class containing the name of an attribute and the corresponding weight.

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
AttributeWeight(AttributeWeight attWeight)
          Clone constructor.
AttributeWeight(AttributeWeights weights, java.lang.String name, double weight)
          Creates a new attribute weight object.
 
Method Summary
 void buildSingleAverage(Averagable avg)
          Builds the sum of weights and counters.
 int compareTo(AttributeWeight o)
          Compares the weight of this object with the weight of another AttributeWeight object.
 boolean equals(java.lang.Object o)
          Returns true if both objects have the same name and the same weight.
 double getMikroAverage()
          Returns the current weight.
 double getMikroVariance()
          Returns the MakroVariance since no other micro variance can be calculated.
 java.lang.String getName()
          Returns the name of the attribute.
 double getWeight()
          Returns the weight of the attribute.
 int hashCode()
           
 void setWeight(double weight)
          Sets the weight of the attribute.
 
Methods inherited from class com.rapidminer.tools.math.Averagable
buildAverage, clone, cloneAveragable, formatPercent, getAverage, getAverageCount, getExtension, getFileDescription, getMakroAverage, getMakroStandardDeviation, getMakroVariance, getMikroStandardDeviation, getStandardDeviation, getVariance, getVisualizationComponent, setAverageCount, toString
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, getResultIcon, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 

Constructor Detail

AttributeWeight

public AttributeWeight(AttributeWeights weights,
                       java.lang.String name,
                       double weight)
Creates a new attribute weight object.


AttributeWeight

public AttributeWeight(AttributeWeight attWeight)
Clone constructor. The name and the weight are deep cloned, the reference to the AttributeWeights object is only a shallow copy.

Method Detail

getName

public java.lang.String getName()
Returns the name of the attribute.

Specified by:
getName in interface ResultObject
Specified by:
getName in class Averagable

getWeight

public double getWeight()
Returns the weight of the attribute.


setWeight

public void setWeight(double weight)
Sets the weight of the attribute.


getMikroVariance

public double getMikroVariance()
Returns the MakroVariance since no other micro variance can be calculated.

Specified by:
getMikroVariance in class Averagable

getMikroAverage

public double getMikroAverage()
Returns the current weight.

Specified by:
getMikroAverage in class Averagable

compareTo

public int compareTo(AttributeWeight o)
Compares the weight of this object with the weight of another AttributeWeight object. May also use the absolute weight.

Specified by:
compareTo in interface java.lang.Comparable<AttributeWeight>

equals

public boolean equals(java.lang.Object o)
Returns true if both objects have the same name and the same weight.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

buildSingleAverage

public void buildSingleAverage(Averagable avg)
Builds the sum of weights and counters.

Specified by:
buildSingleAverage in class Averagable


Copyright © 2001-2009 by Rapid-I