| 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 | * DataGenerator.java |
|---|
| 19 | * Copyright (C) 2002 University of Waikato, Hamilton, New Zealand |
|---|
| 20 | * |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | package weka.gui.boundaryvisualizer; |
|---|
| 24 | |
|---|
| 25 | import weka.core.*; |
|---|
| 26 | |
|---|
| 27 | /** |
|---|
| 28 | * Interface to something that can generate new instances based on |
|---|
| 29 | * a set of input instances |
|---|
| 30 | * |
|---|
| 31 | * @author <a href="mailto:mhall@cs.waikato.ac.nz">Mark Hall</a> |
|---|
| 32 | * @version $Revision: 1.4 $ |
|---|
| 33 | * @since 1.0 |
|---|
| 34 | */ |
|---|
| 35 | public interface DataGenerator { |
|---|
| 36 | |
|---|
| 37 | /** |
|---|
| 38 | * Build the data generator |
|---|
| 39 | * |
|---|
| 40 | * @param inputInstances Instances to build the generator from |
|---|
| 41 | * @exception Exception if an error occurs |
|---|
| 42 | */ |
|---|
| 43 | void buildGenerator(Instances inputInstances) throws Exception; |
|---|
| 44 | |
|---|
| 45 | /** |
|---|
| 46 | * Generate an instance. Should return a new Instance object |
|---|
| 47 | * |
|---|
| 48 | * @return an <code>Instance</code> value |
|---|
| 49 | * @exception Exception if an error occurs |
|---|
| 50 | */ |
|---|
| 51 | double [][] generateInstances(int [] indices) throws Exception; |
|---|
| 52 | |
|---|
| 53 | /** |
|---|
| 54 | * Get weights |
|---|
| 55 | */ |
|---|
| 56 | double [] getWeights() throws Exception; |
|---|
| 57 | |
|---|
| 58 | /** |
|---|
| 59 | * Set the dimensions to be used in computing a weight for |
|---|
| 60 | * each instance generated |
|---|
| 61 | * |
|---|
| 62 | * @param dimensions an array of booleans specifying the dimensions to |
|---|
| 63 | * be used when computing instance weights |
|---|
| 64 | */ |
|---|
| 65 | void setWeightingDimensions(boolean [] dimensions); |
|---|
| 66 | |
|---|
| 67 | /** |
|---|
| 68 | * Set the values of the dimensions (chosen via setWeightingDimensions) |
|---|
| 69 | * to be used when computing instance weights |
|---|
| 70 | * |
|---|
| 71 | * @param vals a <code>double[]</code> value |
|---|
| 72 | */ |
|---|
| 73 | void setWeightingValues(double [] vals); |
|---|
| 74 | |
|---|
| 75 | /** |
|---|
| 76 | * Returns the number of generating models used by this DataGenerator |
|---|
| 77 | * |
|---|
| 78 | * @return an <code>int</code> value |
|---|
| 79 | */ |
|---|
| 80 | int getNumGeneratingModels(); |
|---|
| 81 | |
|---|
| 82 | /** |
|---|
| 83 | * Set a seed for random number generation (if needed). |
|---|
| 84 | * |
|---|
| 85 | * @param seed an <code>int</code> value |
|---|
| 86 | */ |
|---|
| 87 | void setSeed(int seed); |
|---|
| 88 | } |
|---|