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
Constructor Summary |
LVQ()
|
LVQ(int nvec)
|
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 |
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
LVQ
public LVQ()
LVQ
public LVQ(int nvec)
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