| 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 | * Null.java |
|---|
| 19 | * Copyright (C) 2009 University of Waikato, Hamilton, New Zealand |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | package weka.classifiers.evaluation.output.prediction; |
|---|
| 23 | |
|---|
| 24 | import weka.classifiers.Classifier; |
|---|
| 25 | import weka.core.Instance; |
|---|
| 26 | |
|---|
| 27 | /** |
|---|
| 28 | <!-- globalinfo-start --> |
|---|
| 29 | * Suppresses all output. |
|---|
| 30 | * <p/> |
|---|
| 31 | <!-- globalinfo-end --> |
|---|
| 32 | * |
|---|
| 33 | <!-- options-start --> |
|---|
| 34 | * Valid options are: <p/> |
|---|
| 35 | * |
|---|
| 36 | * <pre> -p <range> |
|---|
| 37 | * The range of attributes to print in addition to the classification. |
|---|
| 38 | * (default: none)</pre> |
|---|
| 39 | * |
|---|
| 40 | * <pre> -distribution |
|---|
| 41 | * Whether to turn on the output of the class distribution. |
|---|
| 42 | * Only for nominal class attributes. |
|---|
| 43 | * (default: off)</pre> |
|---|
| 44 | * |
|---|
| 45 | * <pre> -decimals <num> |
|---|
| 46 | * The number of digits after the decimal point. |
|---|
| 47 | * (default: 3)</pre> |
|---|
| 48 | * |
|---|
| 49 | * <pre> -file <path> |
|---|
| 50 | * The file to store the output in, instead of outputting it on stdout. |
|---|
| 51 | * Gets ignored if the supplied path is a directory. |
|---|
| 52 | * (default: .)</pre> |
|---|
| 53 | * |
|---|
| 54 | * <pre> -suppress |
|---|
| 55 | * In case the data gets stored in a file, then this flag can be used |
|---|
| 56 | * to suppress the regular output. |
|---|
| 57 | * (default: not suppressed)</pre> |
|---|
| 58 | * |
|---|
| 59 | <!-- options-end --> |
|---|
| 60 | * |
|---|
| 61 | * @author fracpete (fracpete at waikato dot ac dot nz) |
|---|
| 62 | * @version $Revision: 5466 $ |
|---|
| 63 | */ |
|---|
| 64 | public class Null |
|---|
| 65 | extends AbstractOutput { |
|---|
| 66 | |
|---|
| 67 | /** for serialization. */ |
|---|
| 68 | private static final long serialVersionUID = 4988413155999044966L; |
|---|
| 69 | |
|---|
| 70 | /** |
|---|
| 71 | * Returns a string describing the output generator. |
|---|
| 72 | * |
|---|
| 73 | * @return a description suitable for |
|---|
| 74 | * displaying in the GUI |
|---|
| 75 | */ |
|---|
| 76 | public String globalInfo() { |
|---|
| 77 | return "Suppresses all output."; |
|---|
| 78 | } |
|---|
| 79 | |
|---|
| 80 | /** |
|---|
| 81 | * Returns a short display text, to be used in comboboxes. |
|---|
| 82 | * |
|---|
| 83 | * @return a short display text |
|---|
| 84 | */ |
|---|
| 85 | public String getDisplay() { |
|---|
| 86 | return "No output"; |
|---|
| 87 | } |
|---|
| 88 | |
|---|
| 89 | /** |
|---|
| 90 | * Returns always false. |
|---|
| 91 | * |
|---|
| 92 | * @return always false |
|---|
| 93 | */ |
|---|
| 94 | public boolean generatesOutput() { |
|---|
| 95 | return false; |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | /** |
|---|
| 99 | * Does nothing. |
|---|
| 100 | */ |
|---|
| 101 | protected void doPrintHeader() { |
|---|
| 102 | } |
|---|
| 103 | |
|---|
| 104 | /** |
|---|
| 105 | * Does nothing. |
|---|
| 106 | * |
|---|
| 107 | * @param classifier the classifier to use |
|---|
| 108 | * @param inst the instance to generate text from |
|---|
| 109 | * @param index the index in the dataset |
|---|
| 110 | * @throws Exception if something goes wrong |
|---|
| 111 | */ |
|---|
| 112 | protected void doPrintClassification(Classifier classifier, Instance inst, int index) throws Exception { |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | /** |
|---|
| 116 | * Does nothing. |
|---|
| 117 | */ |
|---|
| 118 | protected void doPrintFooter() { |
|---|
| 119 | } |
|---|
| 120 | } |
|---|