|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.misc.monotone.InstancesComparator
public class InstancesComparator
Class to compare instances with respect to a given attribute, indicated by its index. The ordering of the attribute values is determined by the internal values of WEKA. There is also the possibility of reversing this order.
This implementation is part of the master's thesis: "Studie en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd rangschikken", Stijn Lievens, Ghent University, 2004.
Constructor Summary | |
---|---|
InstancesComparator(int index)
Construct an InstancesComparator that compares
the attributes with the given index. |
|
InstancesComparator(int index,
boolean reverse)
Construct an InstancesComparator that compares
the attributes with the given index, with the possibility of
reversing the order. |
Method Summary | |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two objects (instances) with respect to the attribute this comparator is constructed on. |
java.lang.String |
getRevision()
Returns the revision string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public InstancesComparator(int index)
InstancesComparator
that compares
the attributes with the given index.
index
- the index on which to compare instancespublic InstancesComparator(int index, boolean reverse)
InstancesComparator
that compares
the attributes with the given index, with the possibility of
reversing the order.
index
- the index on which to compare instancesreverse
- if true
the order is reversed, if
false
the order is not reversedMethod Detail |
---|
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
o1
- the first object to be comparedo2
- the second object to be compared
o1 < o2
(wrt to the given attribute),
1 if o1 > o2
, and 0 if o1
and
o2
are equal (wrt to the given attribute)public java.lang.String getRevision()
getRevision
in interface RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |