IterativeClassifier.java
Upload User: rhdiban
Upload Date: 2013-08-09
Package Size: 15085k
Code Size: 2k
Category:

Windows Develop

Development Platform:

Java

  1. /*
  2.  *    This program is free software; you can redistribute it and/or modify
  3.  *    it under the terms of the GNU General Public License as published by
  4.  *    the Free Software Foundation; either version 2 of the License, or
  5.  *    (at your option) any later version.
  6.  *
  7.  *    This program is distributed in the hope that it will be useful,
  8.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.  *    GNU General Public License for more details.
  11.  *
  12.  *    You should have received a copy of the GNU General Public License
  13.  *    along with this program; if not, write to the Free Software
  14.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15.  */
  16. /*
  17.  *    IterativeClassifier.java
  18.  *    Copyright (C) 2001  Gabi Schmidberger, Bernhard Pfahringer
  19.  *
  20.  */
  21. package weka.classifiers;
  22. import weka.core.*;
  23. /**
  24.  * Interface for classifiers that can induce models of growing
  25.  * complexity one step at a time.
  26.  *
  27.  * @author Gabi Schmidberger (gabi@cs.waikato.ac.nz)
  28.  * @author Bernhard Pfahringer (bernhard@cs.waikato.ac.nz)
  29.  * @version $Revision: 1.2 $
  30.  */
  31. public interface IterativeClassifier {
  32.   /**
  33.    * Inits an iterative classifier.
  34.    *
  35.    * @param instances the instances to be used in induction
  36.    * @exception Exception if the model cannot be initialized
  37.    */
  38.   void initClassifier(Instances instances) throws Exception;
  39.   /**
  40.    * Performs one iteration.
  41.    * 
  42.    * @param iteration the index of the current iteration (0-based)
  43.    * @exception Exception if this iteration fails 
  44.    */  
  45.   void next(int iteration) throws Exception;
  46.   /**
  47.    * Signal end of iterating, useful for any house-keeping/cleanup
  48.    * 
  49.    * @exception Exception if cleanup fails 
  50.    */  
  51.   void done() throws Exception;
  52.   /**
  53.     * Performs a deep copy of the classifier, and a reference copy
  54.     * of the training instances (or a deep copy if required).
  55.     *
  56.     * @return a clone of the classifier
  57.     */
  58.   Object clone() throws CloneNotSupportedException;
  59. }