org.debellor.base.evaluator
Class TrainAndTest
java.lang.Object
org.debellor.core.Cell
org.debellor.base.evaluator.EvaluatorCell
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:
- trainPercent: percentage of all samples to be used as training set.
Should be between 1 and 100. Default: 70.
- repetitions: number of independent repetitions of the train+test procedure.
Repetitions are independent and data are split randomly in each of them.
Final results are summed over all repetitions
(the same Score instance is used for all of them).
Default: 1.
- score: name of the Score class to be used to measure quality of the evaluated decision system.
See docs for
EvaluatorCell
.
- Author:
- Marcin Wojnarski
Method Summary |
protected void |
onLearn()
Learning procedure of the cell. |
protected void |
releaseData()
|
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 |
input
protected Cell.Stream input
TrainAndTest
public TrainAndTest()
TrainAndTest
public TrainAndTest(Cell cell)
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