Package weka.classifiers
Interface IterativeClassifier
-
- All Superinterfaces:
Classifier
- All Known Implementing Classes:
AdaBoostM1,AdditiveRegression,FilteredClassifier,LogitBoost,MultilayerPerceptron,RandomizableFilteredClassifier
public interface IterativeClassifier extends Classifier
Interface for classifiers that can induce models of growing complexity one step at a time.- Version:
- $Revision: 15022 $
- Author:
- Gabi Schmidberger (gabi@cs.waikato.ac.nz), Bernhard Pfahringer (bernhard@cs.waikato.ac.nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddone()Signal end of iterating, for either the time being or permanently if setFinalized(true) has been called.booleangetResume()Returns true if the classifier will be able to be trained further (with more iterations) at a later date.voidinitializeClassifier(Instances instances)Initializes an iterative classifier.booleannext()Performs one iteration.voidsetResume(boolean resume)If called with argument true then the classifier will be able to be trained further (with more iterations) at a later date.-
Methods inherited from interface weka.classifiers.Classifier
buildClassifier, classifyInstance, distributionForInstance, getCapabilities
-
-
-
-
Method Detail
-
initializeClassifier
void initializeClassifier(Instances instances) throws java.lang.Exception
Initializes an iterative classifier.- Parameters:
instances- the instances to be used in induction- Throws:
java.lang.Exception- if the model cannot be initialized
-
setResume
void setResume(boolean resume) throws java.lang.ExceptionIf called with argument true then the classifier will be able to be trained further (with more iterations) at a later date. Note that this can potentially make serialized model structures larger, because certain data and data structures might need to be retained to facilitate continued training. When set to false, and done() is called, then the classifier will be cleaned up, resulting in (potentially) a more compact serialized model.- Parameters:
resume- true to enable training to continue at a later point after the initial model is built.- Throws:
java.lang.Exception- if finalization cannot be set
-
getResume
boolean getResume()
Returns true if the classifier will be able to be trained further (with more iterations) at a later date. Note that this can potentially make serialized model structures larger, because certain data and data structures might need to be retained to facilitate continued training. When set to false, and done() is called, then the classifier will be cleaned up, resulting in (potentially) a more compact serialized model.- Returns:
- true to enable training to continue at a later point after the initial model is built.
- Throws:
java.lang.Exception- if finalization cannot be set
-
next
boolean next() throws java.lang.ExceptionPerforms one iteration.- Returns:
- false if no further iterations could be performed, true otherwise
- Throws:
java.lang.Exception- if this iteration fails for unexpected reasons
-
done
void done() throws java.lang.Exception
Signal end of iterating, for either the time being or permanently if setFinalized(true) has been called. Useful for any house-keeping/cleanup.- Throws:
java.lang.Exception- if cleanup fails
-
-