程序包 weka.core
类 InstanceComparator
java.lang.Object
weka.core.InstanceComparator
- 所有已实现的接口:
Serializable
,Comparator
,RevisionHandler
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
.
Relational values are compared instance by instance with a nested
InstanceComparator.- 版本:
- $Revision: 7988 $
- 作者:
- FracPete (fracpete at cs dot waikato dot ac dot nz)
- 另请参阅:
-
构造器概要
构造器构造器说明initializes the comparator and includes the class in the comparisonInstanceComparator
(boolean includeClass) initializes the comparator -
方法概要
修饰符和类型方法说明int
compares the two instances, returns -1 if o1 is smaller than o2, 0 if equal and +1 if greater.boolean
returns TRUE if the class is included in the comparisonReturns the revision string.static void
for testing only.void
setIncludeClass
(boolean includeClass) sets whether the class should be included (= TRUE) in the comparison从接口继承的方法 java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
构造器详细资料
-
InstanceComparator
public InstanceComparator()initializes the comparator and includes the class in the comparison -
InstanceComparator
public InstanceComparator(boolean includeClass) initializes the comparator
-
-
方法详细资料
-
setIncludeClass
public void setIncludeClass(boolean includeClass) sets whether the class should be included (= TRUE) in the comparison- 参数:
includeClass
- whether to include the class in the comparison
-
getIncludeClass
public boolean getIncludeClass()returns TRUE if the class is included in the comparison -
compare
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.- 指定者:
compare
在接口中Comparator
- 参数:
o1
- the first instance to compareo2
- the second instance to compare- 返回:
- returns -1 if o1 is smaller than o2, 0 if equal and +1 if greater
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-
main
for testing only. takes an ARFF-filename as first argument to perform some tests.- 抛出:
Exception
-