Package elki.evaluation.scores.adapter
Class SimpleAdapter
- java.lang.Object
-
- elki.evaluation.scores.adapter.SimpleAdapter
-
- All Implemented Interfaces:
ScoreEvaluation.Adapter
,Iter
public class SimpleAdapter extends java.lang.Object implements ScoreEvaluation.Adapter
This adapter can be used for an arbitrary collection of DBIDs, and does hence not have a notion of ties.Note that of course, no id should occur more than once.
- Since:
- 0.7.0
- Author:
- Erich Schubert
-
-
Constructor Summary
Constructors Constructor Description SimpleAdapter(DBIDs set, DBIDIter iter, int size)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleAdapter
advance()
Moves the iterator forward to the next entry.int
numPositive()
Return the number of positive ids.int
numTotal()
Return the number of all ids.boolean
test()
True if the current object is a positive example.boolean
tiedToPrevious()
Test whether the score is the same as the previous objects score.boolean
valid()
Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
valid
public boolean valid()
Description copied from interface:Iter
Returns true if the iterator currently points to a valid object.
-
advance
public SimpleAdapter advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
tiedToPrevious
public boolean tiedToPrevious()
Description copied from interface:ScoreEvaluation.Adapter
Test whether the score is the same as the previous objects score. When there is no previous result, implementations should return false!- Specified by:
tiedToPrevious
in interfaceScoreEvaluation.Adapter
- Returns:
- Boolean
-
test
public boolean test()
Description copied from interface:ScoreEvaluation.Adapter
True if the current object is a positive example.- Specified by:
test
in interfaceScoreEvaluation.Adapter
- Returns:
true
when positive.
-
numPositive
public int numPositive()
Description copied from interface:ScoreEvaluation.Adapter
Return the number of positive ids.- Specified by:
numPositive
in interfaceScoreEvaluation.Adapter
- Returns:
- Number of positive elements
-
numTotal
public int numTotal()
Description copied from interface:ScoreEvaluation.Adapter
Return the number of all ids.- Specified by:
numTotal
in interfaceScoreEvaluation.Adapter
- Returns:
- Number of all elements
-
-