com.sjm.machlearn.classifiers.lvq
Class LVQ

java.lang.Object
  |
  +--com.sjm.machlearn.util.MainClass
        |
        +--com.sjm.machlearn.classifiers.Classifier
              |
              +--com.sjm.machlearn.classifiers.lvq.LVQ
Direct Known Subclasses:
LVQ1, OLVQ1, SOM

public abstract class LVQ
extends Classifier


Field Summary
protected  double alpha
           
protected  int[] code_class_id
           
protected  DoubleMatrix code_vectors
           
protected  BPFeatureVector converter
           
protected  int max_epochs
           
protected  int nvectors
           
protected  int nweights
           
 
Fields inherited from class com.sjm.machlearn.classifiers.Classifier
Fold10Validation, JackKnifeValidation, Random10Validation
 
Fields inherited from class com.sjm.machlearn.util.MainClass
debug, debug_level, debug_listeners
 
Constructor Summary
LVQ()
           
LVQ(int nvec)
           
 
Method Summary
 Feature classify(Example example)
           
 double[] getDiff(double[] features, int code_index)
           
 double[] getDiff(Example example, int code_index)
           
 double getDist(double[] features, double[] code_vector)
           
 double getDist(Example ex, double[] code_vector)
           
 int getNearest(double[] features)
           
 int getNearest(Example ex)
           
abstract  void initializeLVQ()
           
 void initializeVectors(int nwgts)
           
 void runEpoch(DataSet td)
           
abstract  void runEpoch(double[][] trainingdata, int[] output)
           
 void setAlpha(double a)
           
 void setMaxEpochs(int me)
           
 void setNumVectors(int nv)
           
 void setParameter(int index, java.lang.Object par)
           
 void train(DataSet trainingData)
           
 
Methods inherited from class com.sjm.machlearn.classifiers.Classifier
cloneClassifier, doTune, generateROCCurve, getAccuracy, getBothCat, getExampleWeight, getMisCat, printClassifier
 
Methods inherited from class com.sjm.machlearn.util.MainClass
_internalError, _internalError, addDebugListener, debugMesg, debugMesg, debugMesg, debugMesg, debugMesg, debugMesg, debugOff, debugOn, internalError, internalError, setDebug, setDebugLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nweights

protected int nweights

nvectors

protected int nvectors

code_vectors

protected DoubleMatrix code_vectors

code_class_id

protected int[] code_class_id

alpha

protected double alpha

max_epochs

protected int max_epochs

converter

protected BPFeatureVector converter
Constructor Detail

LVQ

public LVQ()

LVQ

public LVQ(int nvec)
Method Detail

runEpoch

public abstract void runEpoch(double[][] trainingdata,
                              int[] output)

initializeLVQ

public abstract void initializeLVQ()

runEpoch

public void runEpoch(DataSet td)

setAlpha

public void setAlpha(double a)

setMaxEpochs

public void setMaxEpochs(int me)

setNumVectors

public void setNumVectors(int nv)

classify

public Feature classify(Example example)
Overrides:
classify in class Classifier

initializeVectors

public void initializeVectors(int nwgts)

train

public void train(DataSet trainingData)
           throws java.lang.Exception
Overrides:
train in class Classifier

getDiff

public double[] getDiff(double[] features,
                        int code_index)

getDiff

public double[] getDiff(Example example,
                        int code_index)

getNearest

public int getNearest(double[] features)

getNearest

public int getNearest(Example ex)

getDist

public double getDist(Example ex,
                      double[] code_vector)

getDist

public double getDist(double[] features,
                      double[] code_vector)

setParameter

public void setParameter(int index,
                         java.lang.Object par)
Overrides:
setParameter in class Classifier