|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.operator.AbstractIOObject
com.rapidminer.operator.ResultObjectAdapter
com.rapidminer.tools.math.AverageVector
com.rapidminer.example.AttributeWeights
public class AttributeWeights
AttributeWeights holds the information about the weights of attributes of an example set. It is delivered by several feature weighting algorithms or learning schemes. The use of a linked hash map ensures that the added features are stored in the same sequence they were added.
| Field Summary | |
|---|---|
static int |
ABSOLUTE_WEIGHTS
Indicates that the the absolute weights should be used for sorting. |
static int |
DECREASING
Indicates that the weights should be sorted in descending order. |
static int |
INCREASING
Indicates that the weights should be sorted in ascending order. |
static int |
NO_SORTING
Indicates that the weights should not be sorted at all. |
static int |
ORIGINAL_WEIGHTS
Indicates that the the actual weights should be used for sorting. |
| Constructor Summary | |
|---|---|
AttributeWeights()
Creates a new empty attribute weights object. |
|
AttributeWeights(ExampleSet exampleSet)
Creates a new attribute weights object containing a weight of 1 for each of the given input attributes. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a deep clone of the attribute weights which provides the same sequence of attribute names. |
int |
compareTo(java.lang.Object o)
Since this average vector cannot be compared this method always returns 0. |
DataTable |
createDataTable()
|
boolean |
equals(java.lang.Object o)
Returns true if both objects have the same weight map. |
java.util.Set<java.lang.String> |
getAttributeNames()
Returns an set of attribute names in this map ordered by their insertion time. |
java.lang.String |
getExtension()
Returns the default extension in file choosers. |
java.lang.String |
getFileDescription()
Returns the file description used in file choosers. |
java.lang.String |
getName()
Returns the name of this AverageVector. |
javax.swing.Icon |
getResultIcon()
Returns null. |
int |
getSortingType()
Returns the currently used sorting type. |
java.awt.Component |
getVisualizationComponent(IOContainer container)
Returns a visualisation component which allows sorting of the attribute weights and several weight plots. |
double |
getWeight(java.lang.String name)
Returns the weight for the attribute with the given name. |
int |
getWeightType()
Returns the currently used weight type. |
int |
hashCode()
Returns the hash code of the weight map. |
static AttributeWeights |
load(java.io.File file)
Loads a new AttributeWeights object from the given XML file. |
void |
normalize()
This method normalizes all weights to the range 0 to 1. |
void |
save(java.io.File file)
Saves the attribute weights into an XML file. |
void |
setSortingType(int sortingType)
Sets the currently used sorting type. |
void |
setWeight(java.lang.String name,
double weight)
Sets the weight for the attribute with the given name. |
void |
setWeightType(int weightType)
Returns the currently used weight type. |
int |
size()
Returns the number of features in this map. |
void |
sortByWeight(java.lang.String[] attributeNames,
int direction,
int comparatorType)
Sorts the given array of attribute names according to their weight, the sorting direction (ascending or descending), and with respect to the fact if original or absolute weights should be used. |
java.lang.String |
toString()
Returns a string representation of this object. |
void |
writeAttributeWeights(java.io.File file,
java.nio.charset.Charset encoding)
|
| Methods inherited from class com.rapidminer.tools.math.AverageVector |
|---|
addAveragable, buildAverages, getAveragable, getAveragable, getSize, removeAveragable, toResultString |
| Methods inherited from class com.rapidminer.operator.ResultObjectAdapter |
|---|
addAction, getActions, isSavable, log, logError, logNote, logWarning, toHTML |
| 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 |
| Field Detail |
|---|
public static final int NO_SORTING
public static final int DECREASING
public static final int INCREASING
public static final int ORIGINAL_WEIGHTS
public static final int ABSOLUTE_WEIGHTS
| Constructor Detail |
|---|
public AttributeWeights()
public AttributeWeights(ExampleSet exampleSet)
| Method Detail |
|---|
public java.lang.String getName()
getName in interface ResultObjectgetName in class ResultObjectAdapter
public void setWeight(java.lang.String name,
double weight)
public double getWeight(java.lang.String name)
public int getWeightType()
public void setWeightType(int weightType)
public int getSortingType()
public void setSortingType(int sortingType)
public int size()
size in class AverageVectorpublic java.util.Set<java.lang.String> getAttributeNames()
public int compareTo(java.lang.Object o)
public boolean equals(java.lang.Object o)
equals in class AverageVectorpublic int hashCode()
hashCode in class AverageVector
public void sortByWeight(java.lang.String[] attributeNames,
int direction,
int comparatorType)
direction - ASCENDING or DESCENDINGcomparatorType - WEIGHT or WEIGHT_ABSOLUTE.
public void save(java.io.File file)
throws java.io.IOException
save in interface Saveablesave in class ResultObjectAdapterjava.io.IOException
public void writeAttributeWeights(java.io.File file,
java.nio.charset.Charset encoding)
throws java.io.IOException
java.io.IOException
public static AttributeWeights load(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getExtension()
Saveable
public java.lang.String getFileDescription()
Saveable
public java.lang.String toString()
toString in class AverageVectorpublic java.lang.Object clone()
clone in class AverageVectorpublic void normalize()
public java.awt.Component getVisualizationComponent(IOContainer container)
getVisualizationComponent in interface ResultObjectgetVisualizationComponent in class AverageVectorpublic javax.swing.Icon getResultIcon()
ResultObjectAdapter
getResultIcon in interface ResultObjectgetResultIcon in class ResultObjectAdapterpublic DataTable createDataTable()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||