| java.lang.Object weka.core.InstanceComparator
InstanceComparator | public class InstanceComparator implements Comparator,Serializable(Code) | | A comparator for the Instance class. it can be used with or without the
class label. Missing values are sorted at the beginning.
Can be used as comparator in the sorting and binary search algorithms of
Arrays and Collections .
See Also: Instance author: FracPete (fracpete at cs dot waikato dot ac dot nz) version: $Revision: 1.3 $ See Also: java.util.Arrays See Also: java.util.Collections |
m_IncludeClass | protected boolean m_IncludeClass(Code) | | whether to include the class in the comparison
|
InstanceComparator | public InstanceComparator()(Code) | | initializes the comparator and includes the class in the comparison
|
InstanceComparator | public InstanceComparator(boolean includeClass)(Code) | | initializes the comparator
|
compare | public int compare(Object o1, Object o2)(Code) | | compares the two instances, returns -1 if o1 is smaller than o2, 0
if equal and +1 if greater. The method assumes that both instance objects
have the same attributes, they don't have to belong to the same dataset.
Parameters: o1 - the first instance to compare Parameters: o2 - the second instance to compare returns -1 if o1 is smaller than o2, 0 if equal and +1 if greater |
getIncludeClass | public boolean getIncludeClass()(Code) | | returns TRUE if the class is included in the comparison
|
main | public static void main(String[] args) throws Exception(Code) | | for testing only. takes an ARFF-filename as first argument to perform
some tests.
|
setIncludeClass | public void setIncludeClass(boolean includeClass)(Code) | | sets whether the class should be included (= TRUE) in the comparison
Parameters: includeClass - whether to include the class in the comparison |
|
|