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

  Modifier and Type
  Method
  Description
  `void`
  `done()`
  Signal end of iterating, for either the time being or permanently if setFinalized(true) has been called.
  `boolean`
  `getResume()`
  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

    void initializeClassifier(Instances instances) throws Exception
    Initializes an iterative classifier.
    Parameters:
      `instances` - the instances to be used in induction
    Throws:
      `Exception` - if the model cannot be initialized

  - ### setResume

    void setResume(boolean resume) throws Exception
    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

    boolean next() throws Exception
    Performs one iteration.
    Returns:
      false if no further iterations could be performed, true otherwise
    Throws:
      `Exception` - if this iteration fails for unexpected reasons

  - ### done

    void done() throws 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:
      `Exception` - if cleanup fails