org.debellor.base.evaluator
Class TrainAndTest

java.lang.Object
  extended by org.debellor.core.Cell
      extended by org.debellor.base.evaluator.EvaluatorCell
          extended by org.debellor.base.evaluator.TrainAndTest

public class TrainAndTest
extends EvaluatorCell

Implements evaluation of a cell (decision system) with Train+Test procedure. Samples are randomly shuffled before splitting into train and test sets. See EvaluatorCell for more information about usage. The evaluated cell must be erasable (it must correctly override Cell.onErase()).

Parameters:

Author:
Marcin Wojnarski

Nested Class Summary
 
Nested classes/interfaces inherited from class org.debellor.core.Cell
Cell.CellMethod, Cell.State, Cell.Stream
 
Field Summary
protected  Cell.Stream input
           
 
Fields inherited from class org.debellor.base.evaluator.EvaluatorCell
learner, score, scoreFromUser
 
Fields inherited from class org.debellor.core.Cell
parameters, random
 
Constructor Summary
TrainAndTest()
           
TrainAndTest(Cell cell)
           
 
Method Summary
protected  void onLearn()
          Learning procedure of the cell.
protected  void releaseData()
           
 
Methods inherited from class org.debellor.base.evaluator.EvaluatorCell
initScore, onErase, report, result, setInner, setScore
 
Methods inherited from class org.debellor.core.Cell
close, erase, getAvailableParams, getParameters, learn, newThread, newThread, next, onClose, 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

input

protected Cell.Stream input
Constructor Detail

TrainAndTest

public TrainAndTest()

TrainAndTest

public TrainAndTest(Cell cell)
Method Detail

onLearn

protected void onLearn()
                throws java.lang.Exception
Description copied from class: Cell
Learning procedure of the cell. For example, may train the internal decision model; read and buffer input data; calculate an evaluation measure of another cell; calculate data-driven parameters of a preprocessing algorithm (e.g. attribute means for normalization algorithm) etc. Called by Cell.learn().

Must be overridden in all subclasses that implement trainable cells. If your cell is not trainable, you must provide this information to the Cell base class by calling Cell.Cell(boolean) instead of Cell.Cell() in your constructor. Overriders may safely assume that the cell is in Cell.State.EMPTY state when onLearn is called - this is guaranteed by implementation of learn().

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

releaseData

protected void releaseData()
Overrides:
releaseData in class EvaluatorCell