weka.gui.boundaryvisualizer
Class KDDataGenerator

java.lang.Object
  extended byweka.gui.boundaryvisualizer.KDDataGenerator
All Implemented Interfaces:
DataGenerator, java.io.Serializable

public class KDDataGenerator
extends java.lang.Object
implements DataGenerator, java.io.Serializable

KDDataGenerator. Class that uses kernels to generate new random instances based on a supplied set of instances.

Since:
1.0
See Also:
DataGenerator, Serializable, Serialized Form

Constructor Summary
KDDataGenerator()
           
 
Method Summary
 void buildGenerator(Instances inputInstances)
          Initialize the generator using the supplied instances
 Instance generateInstance()
          Generate a new instance.
 Instance generateInstanceFast()
          Generate a new instance.
 int getNumGeneratingModels()
          Return the number of kernels (there is one per training instance)
static void main(java.lang.String[] args)
          Main method for tesing this class
 void setWeightingDimensions(boolean[] dims)
          Set which dimensions to use when computing a weight for the next instance to generate
 void setWeightingValues(double[] vals)
          Set the values for the weighting dimensions to be used when computing the weight for the next instance to be generated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KDDataGenerator

public KDDataGenerator()
Method Detail

buildGenerator

public void buildGenerator(Instances inputInstances)
                    throws java.lang.Exception
Initialize the generator using the supplied instances

Specified by:
buildGenerator in interface DataGenerator
Parameters:
inputInstances - the instances to use as the basis of the kernels
Throws:
java.lang.Exception - if an error occurs

generateInstance

public Instance generateInstance()
                          throws java.lang.Exception
Generate a new instance. Returns the instance in an brand new Instance object.

Specified by:
generateInstance in interface DataGenerator
Returns:
an Instance value
Throws:
java.lang.Exception - if an error occurs

generateInstanceFast

public Instance generateInstanceFast()
                              throws java.lang.Exception
Generate a new instance. Reuses an existing instance object to speed up the process.

Specified by:
generateInstanceFast in interface DataGenerator
Returns:
an Instance value
Throws:
java.lang.Exception - if an error occurs

setWeightingDimensions

public void setWeightingDimensions(boolean[] dims)
Set which dimensions to use when computing a weight for the next instance to generate

Specified by:
setWeightingDimensions in interface DataGenerator
Parameters:
dims - an array of booleans indicating which dimensions to use

setWeightingValues

public void setWeightingValues(double[] vals)
Set the values for the weighting dimensions to be used when computing the weight for the next instance to be generated

Specified by:
setWeightingValues in interface DataGenerator
Parameters:
vals - an array of doubles containing the values of the weighting dimensions (corresponding to the entries that are set to true throw setWeightingDimensions)

getNumGeneratingModels

public int getNumGeneratingModels()
Return the number of kernels (there is one per training instance)

Specified by:
getNumGeneratingModels in interface DataGenerator
Returns:
the number of kernels

main

public static void main(java.lang.String[] args)
Main method for tesing this class

Parameters:
args - a String[] value