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 SimpleAdapteradvance()Moves the iterator forward to the next entry.intnumPositive()Return the number of positive ids.intnumTotal()Return the number of all ids.booleantest()True if the current object is a positive example.booleantiedToPrevious()Test whether the score is the same as the previous objects score.booleanvalid()Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
valid
public boolean valid()
Description copied from interface:IterReturns true if the iterator currently points to a valid object.
-
advance
public SimpleAdapter advance()
Description copied from interface:IterMoves the iterator forward to the next entry.
-
tiedToPrevious
public boolean tiedToPrevious()
Description copied from interface:ScoreEvaluation.AdapterTest whether the score is the same as the previous objects score. When there is no previous result, implementations should return false!- Specified by:
tiedToPreviousin interfaceScoreEvaluation.Adapter- Returns:
- Boolean
-
test
public boolean test()
Description copied from interface:ScoreEvaluation.AdapterTrue if the current object is a positive example.- Specified by:
testin interfaceScoreEvaluation.Adapter- Returns:
truewhen positive.
-
numPositive
public int numPositive()
Description copied from interface:ScoreEvaluation.AdapterReturn the number of positive ids.- Specified by:
numPositivein interfaceScoreEvaluation.Adapter- Returns:
- Number of positive elements
-
numTotal
public int numTotal()
Description copied from interface:ScoreEvaluation.AdapterReturn the number of all ids.- Specified by:
numTotalin interfaceScoreEvaluation.Adapter- Returns:
- Number of all elements
-
-