weka.classifiers.neural.lvq.model
Class CommonModel

java.lang.Object
  extended by weka.classifiers.neural.lvq.model.CommonModel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LvqModel, SomModel

public class CommonModel
extends java.lang.Object
implements java.io.Serializable

Date: 25/05/2004 File: CommonModel.java

Author:
Jason Brownlee
See Also:
Serialized Form

Constructor Summary
CommonModel(int totalVectors)
           
 
Method Summary
 void applyLearningRateToAllVectors(double aLearningRate)
           
 int[] calculateCodebookClassDistribution()
          Calculates the codebook vector class distributeion - that is the distribution of classes that codebook vectors are currently assigned to
 double calculateQuantisationError(weka.core.Instances aInstances)
           
 double classifyInstance(weka.core.Instance aInstance)
          Classifies the provided data instance
 void clearBmuCounts()
           
 void clearClassDistributions()
           
 CodebookVector getBmu(weka.core.Instance aInstance)
          Returns the best matching unit (codebook vecotr) for a given data instance.
 int[][] getBmuCounts()
           
 double getBmuDistance(weka.core.Instance aInstance)
           
 java.lang.String getClassLabelIndex(int i)
          Returns the class label for the provided class value/type index
 CodebookVector[] getCodebookVectors()
           
 int getTotalCodebookVectors()
           
 void initialiseModel(ModelInitialiser aModelInitialiser)
           
 void setUseVoting(boolean useVoting)
           
 void updateModel(ModelUpdater aModelUpdator)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonModel

public CommonModel(int totalVectors)
Parameters:
totalVectors -
Method Detail

updateModel

public void updateModel(ModelUpdater aModelUpdator)

initialiseModel

public void initialiseModel(ModelInitialiser aModelInitialiser)

applyLearningRateToAllVectors

public void applyLearningRateToAllVectors(double aLearningRate)

calculateCodebookClassDistribution

public int[] calculateCodebookClassDistribution()
Calculates the codebook vector class distributeion - that is the distribution of classes that codebook vectors are currently assigned to

Returns:

classifyInstance

public double classifyInstance(weka.core.Instance aInstance)
Classifies the provided data instance

Parameters:
aInstance -
Returns:

getClassLabelIndex

public java.lang.String getClassLabelIndex(int i)
Returns the class label for the provided class value/type index

Parameters:
i -
Returns:

getBmu

public CodebookVector getBmu(weka.core.Instance aInstance)
Returns the best matching unit (codebook vecotr) for a given data instance. A distance measure from the instance to each codebook vector is calculated. The lowest distance measure becomes the best matching unit (BMU)

Parameters:
aInstance - - a dat instance
Returns:

getBmuDistance

public double getBmuDistance(weka.core.Instance aInstance)

getTotalCodebookVectors

public int getTotalCodebookVectors()

clearBmuCounts

public void clearBmuCounts()

getBmuCounts

public int[][] getBmuCounts()

setUseVoting

public void setUseVoting(boolean useVoting)

clearClassDistributions

public void clearClassDistributions()

calculateQuantisationError

public double calculateQuantisationError(weka.core.Instances aInstances)

getCodebookVectors

public CodebookVector[] getCodebookVectors()
Returns: