weka.classifiers.neural.lvq
Class AlgorithmAncestor

java.lang.Object
  extended by weka.classifiers.Classifier
      extended by weka.classifiers.neural.lvq.AlgorithmAncestor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, weka.core.OptionHandler, weka.core.WeightedInstancesHandler
Direct Known Subclasses:
LvqAlgorithmAncestor, Som

public abstract class AlgorithmAncestor
extends weka.classifiers.Classifier
implements weka.core.OptionHandler, weka.core.WeightedInstancesHandler

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

Author:
Jason Brownlee
See Also:
Serialized Form

Constructor Summary
AlgorithmAncestor()
           
 
Method Summary
 void addEpochEventListener(EpochEventListener aListener)
           
 void buildClassifier(weka.core.Instances instances)
          Build a model of the provided training dataset using the specific LVQ algorithm implementation.
 double calculateQuantisationError(weka.core.Instances instances)
           
 double[] distributionForInstance(weka.core.Instance instance)
          Calcualte the class distribution for the provided instance
 weka.core.SelectedTag getInitialisationMode()
          Return the initialisation mode
 CommonModel getModel()
           
 long getSeed()
           
abstract  int getTotalCodebookVectors()
           
 int getTotalTrainingBmuHits()
           
 int[][] getTrainingBmuUsage()
           
 boolean getUseVoting()
           
abstract  java.lang.String globalInfo()
           
 java.lang.String prepareBuildTimeReport()
           
 java.lang.String prepareClassDistributionReport(java.lang.String aHeader)
          Responsible for calculating the class distribution of nodes in the provided model
 java.lang.String prepareCodebookVectorReport()
           
 java.lang.String prepareIndividualClassDistributionReport()
           
 java.lang.String prepareTrainingBMUReport()
           
 java.lang.String quantisationErrorReport()
           
 void setInitialisationMode(weka.core.SelectedTag s)
          Set the initialisation mode
 void setPreInitialisedModel(CommonModel aModel)
           
 void setPrepareBmuStatistis(boolean b)
           
 void setSeed(long l)
           
 void setUseVoting(boolean b)
           
 java.lang.String toString()
           
 
Methods inherited from class weka.classifiers.Classifier
classifyInstance, debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface weka.core.OptionHandler
getOptions, listOptions, setOptions
 

Constructor Detail

AlgorithmAncestor

public AlgorithmAncestor()
Method Detail

globalInfo

public abstract java.lang.String globalInfo()

getTotalCodebookVectors

public abstract int getTotalCodebookVectors()

addEpochEventListener

public void addEpochEventListener(EpochEventListener aListener)

buildClassifier

public void buildClassifier(weka.core.Instances instances)
                     throws java.lang.Exception
Build a model of the provided training dataset using the specific LVQ algorithm implementation. The model is constructed (if not already provided), it is initialised, then the model is trained (constructed) using the specific implementation of the LVQ algorithm by calling prepareLVQClassifier()

Specified by:
buildClassifier in class weka.classifiers.Classifier
Parameters:
instances - - training dataset.
Throws:
java.lang.Exception

setPreInitialisedModel

public void setPreInitialisedModel(CommonModel aModel)

getModel

public CommonModel getModel()

distributionForInstance

public double[] distributionForInstance(weka.core.Instance instance)
                                 throws java.lang.Exception
Calcualte the class distribution for the provided instance

Overrides:
distributionForInstance in class weka.classifiers.Classifier
Parameters:
instance - - an instance to calculate the class distribution for
Returns:
double [] - class distribution for instance
Throws:
java.lang.Exception

prepareClassDistributionReport

public java.lang.String prepareClassDistributionReport(java.lang.String aHeader)
Responsible for calculating the class distribution of nodes in the provided model

Parameters:
context - - context of the distribution (descriptiuon)
distribution - - a calculated distribution of each class
aModel - - model to evaluate
Returns:

prepareIndividualClassDistributionReport

public java.lang.String prepareIndividualClassDistributionReport()

prepareTrainingBMUReport

public java.lang.String prepareTrainingBMUReport()

prepareCodebookVectorReport

public java.lang.String prepareCodebookVectorReport()

prepareBuildTimeReport

public java.lang.String prepareBuildTimeReport()

quantisationErrorReport

public java.lang.String quantisationErrorReport()

calculateQuantisationError

public double calculateQuantisationError(weka.core.Instances instances)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setInitialisationMode

public void setInitialisationMode(weka.core.SelectedTag s)
Set the initialisation mode

Parameters:
s -

getInitialisationMode

public weka.core.SelectedTag getInitialisationMode()
Return the initialisation mode

Returns:

getTotalTrainingBmuHits

public int getTotalTrainingBmuHits()
Returns:

getTrainingBmuUsage

public int[][] getTrainingBmuUsage()
Returns:

setSeed

public void setSeed(long l)
Parameters:
l -

getSeed

public long getSeed()
Returns:

getUseVoting

public boolean getUseVoting()
Returns:

setUseVoting

public void setUseVoting(boolean b)
Parameters:
b -

setPrepareBmuStatistis

public void setPrepareBmuStatistis(boolean b)
Parameters:
b -