Package weka.classifiers
Interface IterativeClassifier
- All Superinterfaces:
Classifier
- All Known Implementing Classes:
AdaBoostM1
,AdditiveRegression
,FilteredClassifier
,LogitBoost
,MultilayerPerceptron
,RandomizableFilteredClassifier
Interface for classifiers that can induce models of growing complexity one
step at a time.
- Version:
- $Revision: 15021 $
- Author:
- Gabi Schmidberger (gabi@cs.waikato.ac.nz), Bernhard Pfahringer (bernhard@cs.waikato.ac.nz)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
done()
Signal end of iterating, for either the time being or permanently if setFinalized(true) has been called.boolean
Returns true if the classifier will be able to be trained further (with more iterations) at a later date.void
initializeClassifier
(Instances instances) Initializes an iterative classifier.boolean
next()
Performs one iteration.void
setResume
(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 Details
-
initializeClassifier
Initializes an iterative classifier.- Parameters:
instances
- the instances to be used in induction- Throws:
Exception
- if the model cannot be initialized
-
setResume
If 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:
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:
Exception
- if finalization cannot be set
-
next
Performs one iteration.- Returns:
- false if no further iterations could be performed, true otherwise
- Throws:
Exception
- if this iteration fails for unexpected reasons
-
done
Signal end of iterating, for either the time being or permanently if setFinalized(true) has been called. Useful for any house-keeping/cleanup.- Throws:
Exception
- if cleanup fails
-