source: src/main/java/weka/experiment/Tester.java @ 7

Last change on this file since 7 was 4, checked in by gnappo, 14 years ago

Import di weka.

File size: 8.2 KB
RevLine 
[4]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 * Tester.java
19 * Copyright (C) 2005 University of Waikato, Hamilton, New Zealand
20 *
21 */
22
23
24package weka.experiment;
25
26import weka.core.Instance;
27import weka.core.Instances;
28import weka.core.Range;
29
30import java.io.Serializable;
31
32/**
33 * Interface for different kinds of Testers in the Experimenter.
34 *
35 * @author FracPete (fracpete at waikato dot ac dot nz)
36 * @version $Revision: 1.4 $
37 */
38public interface Tester
39  extends Serializable {
40 
41  /**
42   * returns the name of the testing algorithm
43   */
44  public String getDisplayName();
45
46  /**
47   * returns a string that is displayed as tooltip on the "perform test"
48   * button in the experimenter
49   */
50  public String getToolTipText();
51
52  /**
53   * retrieves all the settings from the given Tester
54   *
55   * @param tester      the Tester to get the settings from
56   */
57  public void assign(Tester tester);
58
59  /**
60   * Sets the matrix to use to produce the output.
61   * @param matrix the instance to use to produce the output
62   * @see ResultMatrix
63   */
64  public void setResultMatrix(ResultMatrix matrix);
65
66  /**
67   * Gets the instance that produces the output.
68   * @return the instance to produce the output
69   */
70  public ResultMatrix getResultMatrix();
71
72  /**
73   * Set whether standard deviations are displayed or not.
74   * @param s true if standard deviations are to be displayed
75   */
76  public void setShowStdDevs(boolean s);
77
78  /**
79   * Returns true if standard deviations have been requested.
80   * @return true if standard deviations are to be displayed.
81   */
82  public boolean getShowStdDevs();
83
84  /**
85   * Gets the number of datasets in the resultsets
86   *
87   * @return the number of datasets in the resultsets
88   */
89  public int getNumDatasets();
90
91  /**
92   * Gets the number of resultsets in the data.
93   *
94   * @return the number of resultsets in the data
95   */
96  public int getNumResultsets();
97
98  /**
99   * Gets a string descriptive of the specified resultset.
100   *
101   * @param index the index of the resultset
102   * @return a descriptive string for the resultset
103   */
104  public String getResultsetName(int index);
105 
106  /**
107   * Checks whether the resultset with the given index shall be displayed.
108   *
109   * @param index the index of the resultset to check whether it shall be displayed
110   * @return whether the specified resultset is displayed
111   */
112  public boolean displayResultset(int index);
113 
114  /**
115   * Computes a paired t-test comparison for a specified dataset between
116   * two resultsets.
117   *
118   * @param datasetSpecifier the dataset specifier
119   * @param resultset1Index the index of the first resultset
120   * @param resultset2Index the index of the second resultset
121   * @param comparisonColumn the column containing values to compare
122   * @return the results of the paired comparison
123   * @exception Exception if an error occurs
124   */
125  public PairedStats calculateStatistics(Instance datasetSpecifier,
126                                         int resultset1Index,
127                                         int resultset2Index,
128                                         int comparisonColumn) throws Exception;
129 
130  /**
131   * Creates a key that maps resultset numbers to their descriptions.
132   *
133   * @return a value of type 'String'
134   */
135  public String resultsetKey();
136 
137  /**
138   * Creates a "header" string describing the current resultsets.
139   *
140   * @param comparisonColumn a value of type 'int'
141   * @return a value of type 'String'
142   */
143  public String header(int comparisonColumn);
144
145  /**
146   * Carries out a comparison between all resultsets, counting the number
147   * of datsets where one resultset outperforms the other.
148   *
149   * @param comparisonColumn the index of the comparison column
150   * @return a 2d array where element [i][j] is the number of times resultset
151   * j performed significantly better than resultset i.
152   * @exception Exception if an error occurs
153   */
154  public int [][] multiResultsetWins(int comparisonColumn, int [][] nonSigWin)
155    throws Exception;
156 
157  /**
158   * Carries out a comparison between all resultsets, counting the number
159   * of datsets where one resultset outperforms the other. The results
160   * are summarized in a table.
161   *
162   * @param comparisonColumn the index of the comparison column
163   * @return the results in a string
164   * @exception Exception if an error occurs
165   */
166  public String multiResultsetSummary(int comparisonColumn)
167    throws Exception;
168
169  public String multiResultsetRanking(int comparisonColumn)
170    throws Exception;
171                                   
172  /**
173   * Creates a comparison table where a base resultset is compared to the
174   * other resultsets. Results are presented for every dataset.
175   *
176   * @param baseResultset the index of the base resultset
177   * @param comparisonColumn the index of the column to compare over
178   * @return the comparison table string
179   * @exception Exception if an error occurs
180   */
181  public String multiResultsetFull(int baseResultset,
182                                   int comparisonColumn) throws Exception;
183
184  /**
185   * Get the value of ResultsetKeyColumns.
186   *
187   * @return Value of ResultsetKeyColumns.
188   */
189  public Range getResultsetKeyColumns();
190 
191  /**
192   * Set the value of ResultsetKeyColumns.
193   *
194   * @param newResultsetKeyColumns Value to assign to ResultsetKeyColumns.
195   */
196  public void setResultsetKeyColumns(Range newResultsetKeyColumns);
197 
198  /**
199   * Gets the indices of the the datasets that are displayed (if <code>null</code>
200   * then all are displayed). The base is always displayed.
201   *
202   * @return the indices of the datasets to display
203   */
204  public int[] getDisplayedResultsets();
205 
206  /**
207   * Sets the indicies of the datasets to display (<code>null</code> means all).
208   * The base is always displayed.
209   *
210   * @param cols the indices of the datasets to display
211   */
212  public void setDisplayedResultsets(int[] cols);
213 
214  /**
215   * Get the value of SignificanceLevel.
216   *
217   * @return Value of SignificanceLevel.
218   */
219  public double getSignificanceLevel();
220 
221  /**
222   * Set the value of SignificanceLevel.
223   *
224   * @param newSignificanceLevel Value to assign to SignificanceLevel.
225   */
226  public void setSignificanceLevel(double newSignificanceLevel);
227
228  /**
229   * Get the value of DatasetKeyColumns.
230   *
231   * @return Value of DatasetKeyColumns.
232   */
233  public Range getDatasetKeyColumns();
234 
235  /**
236   * Set the value of DatasetKeyColumns.
237   *
238   * @param newDatasetKeyColumns Value to assign to DatasetKeyColumns.
239   */
240  public void setDatasetKeyColumns(Range newDatasetKeyColumns);
241 
242  /**
243   * Get the value of RunColumn.
244   *
245   * @return Value of RunColumn.
246   */
247  public int getRunColumn();
248 
249  /**
250   * Set the value of RunColumn.
251   *
252   * @param newRunColumn Value to assign to RunColumn.
253   */
254  public void setRunColumn(int newRunColumn);
255
256  /**
257   * Get the value of FoldColumn.
258   *
259   * @return Value of FoldColumn.
260   */
261  public int getFoldColumn();
262 
263  /**
264   * Set the value of FoldColumn.
265   *
266   * @param newFoldColumn Value to assign to FoldColumn.
267   */
268  public void setFoldColumn(int newFoldColumn);
269
270  /**
271   * Returns the name of the column to sort on.
272   *
273   * @return the name of the column to sort on.
274   */
275  public String getSortColumnName();
276
277  /**
278   * Returns the column to sort on, -1 means the default sorting.
279   *
280   * @return the column to sort on.
281   */
282  public int getSortColumn();
283 
284  /**
285   * Set the column to sort on, -1 means the default sorting.
286   *
287   * @param newSortColumn the new sort column.
288   */
289  public void setSortColumn(int newSortColumn);
290 
291  /**
292   * Get the value of Instances.
293   *
294   * @return Value of Instances.
295   */
296  public Instances getInstances();
297 
298  /**
299   * Set the value of Instances.
300   *
301   * @param newInstances Value to assign to Instances.
302   */
303  public void setInstances(Instances newInstances);
304}
Note: See TracBrowser for help on using the repository browser.