|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.converters.HierarchicalCostMatrix
This is a stand-alone class within the WEKA-framework to provide a hierarchical cost matrix for a given hierarchy of classes. It is a first attempt to do so. The idea was not further developed. The architecture of this class is not weka-like, perhaps it should be adapted once.
Field Summary | |
private double[][] |
costMatrix
Keeps the cost matrix. |
static double |
DEFAULT_WEIGHT
The default weight of classes. |
private double |
multiplier
Default multiplier to increase penalty for a wrong class per differing branch in a hierarchy. |
Constructor Summary | |
HierarchicalCostMatrix(Attribute nominalClasses,
ClassHierarchy hierarchy)
Creates a hierarchical cost matrix using default multiplier. |
|
HierarchicalCostMatrix(Attribute nominalClasses,
ClassHierarchy hierarchy,
double multiplier)
Creates a hierarchical cost matrix using given multiplier. |
Method Summary | |
protected void |
adjust(Attribute nominalClasses,
ClassHierarchy hierarchy)
Adjusts the costMatrix for the given classes, and hierarchy, using the currently set multiplier. |
protected void |
init(Attribute nominalClasses,
ClassHierarchy hierarchy)
Inits the fields according to the given classes and hierarchy. |
static void |
main(java.lang.String[] args)
Method to use the class as stand-alone tool. |
java.lang.String |
toString()
Returns a String representation of the cost matrix suitable for usage mit cost dependend classifiers. |
static java.lang.String |
usage()
Describes the proper usage of this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double DEFAULT_WEIGHT
private double[][] costMatrix
private double multiplier
Constructor Detail |
public HierarchicalCostMatrix(Attribute nominalClasses, ClassHierarchy hierarchy)
nominalClasses
- the classes to create cost matrix forhierarchy
- the hierarchy defining the costspublic HierarchicalCostMatrix(Attribute nominalClasses, ClassHierarchy hierarchy, double multiplier)
nominalClasses
- the classes to create cost matrix forhierarchy
- the hierarchy defining the costsmultiplier
- multiplier to enhance costs for wrong branches per levelMethod Detail |
protected void init(Attribute nominalClasses, ClassHierarchy hierarchy)
nominalClasses
- the classes to create cost matrix forhierarchy
- the hierarchy defining the costsprotected void adjust(Attribute nominalClasses, ClassHierarchy hierarchy)
nominalClasses
- the classes to create cost matrix forhierarchy
- the hierarchy defining the costspublic java.lang.String toString()
Object.toString()
public static java.lang.String usage()
public static void main(java.lang.String[] args)
args
- expects the arguments:
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |