org.debellor.base.evaluator
Class EvaluatorCell

java.lang.Object
  extended by org.debellor.core.Cell
      extended by org.debellor.base.evaluator.EvaluatorCell
Direct Known Subclasses:
CrossValidation, TrainAndTest

public class EvaluatorCell
extends Cell

Base class for cells that implement evaluation of other cells -- decision systems. To run evaluation you must insert the evaluated cell with either EvaluatorCell(Cell) or setInner(Cell), set the data source with Cell.setSource(Cell) and call Cell.learn() which performs actual evaluation. Afterwards you may read the result with either result() or report(). If you want to use the same instance of EvaluatorCell to run another evaluation you must call Cell.erase() first. Note that usually the evaluated cell must be erasable (it must correctly override Cell.onErase()).

Parameters:

Author:
Marcin Wojnarski
See Also:
TrainAndTest, CrossValidation

Nested Class Summary
 
Nested classes/interfaces inherited from class org.debellor.core.Cell
Cell.CellMethod, Cell.State, Cell.Stream
 
Field Summary
protected  Cell learner
           
protected  Score score
           
protected  Score scoreFromUser
           
 
Fields inherited from class org.debellor.core.Cell
parameters, random
 
Constructor Summary
EvaluatorCell()
           
EvaluatorCell(Cell cell)
           
 
Method Summary
protected  void initScore()
           
protected  void onErase()
          Called by Cell.erase().
protected  void releaseData()
           
 java.lang.String report()
           
 java.lang.Double[] result()
           
 void setInner(Cell cell)
          Sets the cell - a decision system - that would undergo evaluation.
 void setScore(Score sc)
          Sets Score instance that will be used for calculation of a quality measure of the evaluated decision system.
 
Methods inherited from class org.debellor.core.Cell
close, erase, getAvailableParams, getParameters, learn, newThread, newThread, next, onClose, onLearn, onNext, onOpen, open, openInputStream, set, set, set, set, setAvailableParams, setParameters, setRandomSeed, setSource, state, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

score

protected Score score

scoreFromUser

protected Score scoreFromUser

learner

protected Cell learner
Constructor Detail

EvaluatorCell

public EvaluatorCell()

EvaluatorCell

public EvaluatorCell(Cell cell)
Method Detail

setInner

public void setInner(Cell cell)
Sets the cell - a decision system - that would undergo evaluation.


setScore

public void setScore(Score sc)

Sets Score instance that will be used for calculation of a quality measure of the evaluated decision system. This method is an alternative for specifying the score type through the cell parameter "score", which is a preferred way of doing this. If both this method has been called and the parameter has been set, the score instance passed to this method is used.

Supplied score instance will be used only in the nearest call to learn. The score will not be reset at the beginning of evaluation, so the user may supply a previously-used score, in order to accumulate results of different evaluations.


initScore

protected void initScore()
                  throws IllegalParameterValueException
Throws:
IllegalParameterValueException

releaseData

protected void releaseData()

result

public java.lang.Double[] result()

report

public java.lang.String report()

onErase

protected void onErase()
                throws java.lang.Exception
Description copied from class: Cell
Called by Cell.erase(). Performs the actual erasure of cell content, while erase checks only against access violation and handles exceptions. Must be overridden in subclasses if erasure is to be used. Overriders may assume that the cell is in Cell.State.CLOSED state.

Overrides:
onErase in class Cell
Throws:
java.lang.Exception