| 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 | /* |
|---|
| 18 | * ThresholdDataEvent.java |
|---|
| 19 | * Copyright (C) 2003 University of Waikato, Hamilton, New Zealand |
|---|
| 20 | * |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | package weka.gui.beans; |
|---|
| 24 | |
|---|
| 25 | import weka.core.Attribute; |
|---|
| 26 | import weka.gui.visualize.PlotData2D; |
|---|
| 27 | |
|---|
| 28 | import java.util.EventObject; |
|---|
| 29 | |
|---|
| 30 | /** |
|---|
| 31 | * Event encapsulating classifier performance data based on |
|---|
| 32 | * varying a threshold over the classifier's predicted probabilities |
|---|
| 33 | * |
|---|
| 34 | * @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a> |
|---|
| 35 | * @version $Revision: 5750 $ |
|---|
| 36 | * @see EventObject |
|---|
| 37 | */ |
|---|
| 38 | public class ThresholdDataEvent |
|---|
| 39 | extends EventObject { |
|---|
| 40 | |
|---|
| 41 | /** for serialization */ |
|---|
| 42 | private static final long serialVersionUID = -8309334224492439644L; |
|---|
| 43 | |
|---|
| 44 | private PlotData2D m_dataSet; |
|---|
| 45 | |
|---|
| 46 | private Attribute m_classAttribute; |
|---|
| 47 | |
|---|
| 48 | public ThresholdDataEvent(Object source, PlotData2D dataSet) { |
|---|
| 49 | this(source, dataSet, null); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | public ThresholdDataEvent(Object source, PlotData2D dataSet, Attribute classAtt) { |
|---|
| 53 | super(source); |
|---|
| 54 | m_dataSet = dataSet; |
|---|
| 55 | m_classAttribute = classAtt; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | /** |
|---|
| 59 | * Return the instances of the data set |
|---|
| 60 | * |
|---|
| 61 | * @return an <code>Instances</code> value |
|---|
| 62 | */ |
|---|
| 63 | public PlotData2D getDataSet() { |
|---|
| 64 | return m_dataSet; |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | /** |
|---|
| 68 | * Return the class attribute for which the threshold data was generated |
|---|
| 69 | * for. |
|---|
| 70 | * |
|---|
| 71 | * @return the class attribute for the threshold data or null if not set. |
|---|
| 72 | */ |
|---|
| 73 | public Attribute getClassAttribute() { |
|---|
| 74 | return m_classAttribute; |
|---|
| 75 | } |
|---|
| 76 | } |
|---|