|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.debellor.core.Cell
org.debellor.rseslib.RseslibClassifier
public class RseslibClassifier
Debellor wrapper for Rseslib classifiers - classes implementing
rseslib.processing.classification.Classifier
interface.
Rseslib class is identified by its name
given in long (with package specification) or short form.
This name must exactly match (including case)
the corresponding Rseslib class name.
Available names can be found by running Rseslib GUI (like VRseslib)
and opening the selection list of classifiers.
Alternatively, you can browse Rseslib code
(subpackages of rseslib.processing.classification
package)
for classes implementing
rseslib.processing.classification.Classifier
interface.
Parameters (or properties in Rseslib's terminology)
can be passed to Rseslib classifier in a standard
Debellor's way, by calling Cell.set(java.lang.String, java.lang.String)
or Cell.setParameters(org.debellor.core.Parameters)
.
Parameters should have names of corresponding Rseslib properties,
exactly in the same form as is printed in Rseslib GUI
in the dialog for setting classifier properties.
For example, the "C45" classifier, which implements C4.5 decision tree, has properties "noOfPartsForBuilding", "noOfPartsForPruning", "pruning". You can set their values in the following way:
Cell learner = new RseslibClassifier("C45"); learner.set("noOfPartsForPruning", "3"); learner.set("pruning", "true");If you don't specify some parameter, its default value will be used.
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.core.Cell |
---|
parameters, random |
Constructor Summary | |
---|---|
RseslibClassifier(java.lang.Class<? extends rseslib.processing.classification.Classifier> learnerClass)
|
|
RseslibClassifier(java.lang.String className)
|
Method Summary | |
---|---|
protected void |
onClose()
Called by Cell.Stream.close() . |
protected void |
onErase()
Called by Cell.erase() . |
protected void |
onLearn()
Learning procedure of the cell. |
protected Sample |
onNext()
Called by Cell.Stream.next() . |
protected Sample.SampleType |
onOpen()
Called by Cell.open() . |
java.lang.String |
toString()
|
Methods inherited from class org.debellor.core.Cell |
---|
close, erase, getAvailableParams, getParameters, learn, newThread, newThread, next, open, openInputStream, set, set, set, set, setAvailableParams, setParameters, setRandomSeed, setSource, state |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Cell.Stream input
Constructor Detail |
---|
public RseslibClassifier(java.lang.Class<? extends rseslib.processing.classification.Classifier> learnerClass) throws RseslibConversionException
RseslibConversionException
public RseslibClassifier(java.lang.String className) throws RseslibConversionException
className
- Name of Rseslib class implementing the classifier algorithm,
given in long (with package specification) or short form.
Letter case must be the same as in the class name.
RseslibConversionException
Method Detail |
---|
protected void onLearn() throws java.lang.Exception
Cell
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()
.
onLearn
in class Cell
java.lang.Exception
protected void onErase() throws DebellorException
Cell
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.
onErase
in class Cell
DebellorException
protected Sample.SampleType onOpen() throws java.lang.Exception
Cell
Cell.open()
. Performs the actual opening of
communication session,
while open
checks only against access violation and handles exceptions.
Must be overridden in subclasses if open
is to be used.
Overriders may assume that the cell is in Cell.State.CLOSED
state.
onOpen
in class Cell
java.lang.Exception
protected Sample onNext() throws java.lang.Exception
Cell
Cell.Stream.next()
. Performs the actual generation of the next output sample,
while Stream.next()
checks only against access violation and handles exceptions.
Must be overridden in the subclass if next
is to be used, i.e.
if the subclass should generate some output data.
Overriders may assume that the cell is in Cell.State.OPEN
state.
onNext
in class Cell
java.lang.Exception
protected void onClose() throws java.lang.Exception
Cell
Cell.Stream.close()
. Performs the actual closing of
communication session,
while close
checks only against access violation and handles exceptions.
Must be overridden in subclasses if close
is to be used.
Usually the overrider will use onClose to release resources,
to let them be garbage-collected.
Overriders may assume that the cell is in Cell.State.OPEN
state.
onClose
in class Cell
java.lang.Exception
public java.lang.String toString()
toString
in class Cell
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |