TrainingSetEvent.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.  *    TrainingSetEvent.java
  18.  *    Copyright (C) 2002 Mark Hall
  19.  *
  20.  */
  21. package weka.gui.beans;
  22. import java.util.EventObject;
  23. import weka.core.Instances;
  24. /**
  25.  * Event encapsulating a training set
  26.  *
  27.  * @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a>
  28.  * @version $Revision: 1.1 $
  29.  */
  30. public class TrainingSetEvent extends EventObject {
  31.   
  32.   /**
  33.    * The training instances
  34.    */
  35.   protected Instances m_trainingSet;
  36.   /**
  37.    * what number is this training set (ie fold 2 of 10 folds)
  38.    */
  39.   protected int m_setNumber;
  40.   /**
  41.    * Maximum number of sets (ie 10 in a 10 fold)
  42.    */
  43.   protected int m_maxSetNumber;
  44.   /**
  45.    * Creates a new <code>TrainingSetEvent</code>
  46.    *
  47.    * @param source the source of the event
  48.    * @param trainSet the training instances
  49.    */
  50.   public TrainingSetEvent(Object source, Instances trainSet) {
  51.     super(source);
  52.     m_trainingSet = trainSet;
  53.   }
  54.   /**
  55.    * Get the training instances
  56.    *
  57.    * @return an <code>Instances</code> value
  58.    */
  59.   public Instances getTrainingSet() {
  60.     return m_trainingSet;
  61.   }
  62.   /**
  63.    * Get the set number (eg. fold 2 of a 10 fold split)
  64.    *
  65.    * @return an <code>int</code> value
  66.    */
  67.   public int getSetNumber() {
  68.     return m_setNumber;
  69.   }
  70.   /**
  71.    * Get the maximum set number
  72.    *
  73.    * @return an <code>int</code> value
  74.    */
  75.   public int getMaxSetNumber() {
  76.     return m_maxSetNumber;
  77.   }
  78. }