Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.able.beans.bayes
Class AbleNaiveBayesClassifierAgent

    java.lang.Object
      com.ibm.able.AbleObject
          com.ibm.able.AbleDefaultAgent
              com.ibm.able.beans.bayes.AbleNaiveBayesClassifierAgent

All Implemented Interfaces:
  AbleAgent, AbleBean, AbleBeanContainer, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, AbleUserDefinedFunctionManager, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable

public class AbleNaiveBayesClassifierAgent
extends AbleDefaultAgent
implements java.io.Serializable

This class implements a classifier using back propagation

See Also:
  Serialized Form

Field Summary
`double` | `avgRMSError`
`protected int` | `bufferSize`
`protected java.lang.String` | `dataFileName`
`protected int` | `desiredPercentCorrect`
`protected int` | `desiredPercentIncorrect`
`protected AbleFilter` | `filt1`
`protected AbleFilter` | `filt2`
`protected AbleImport` | `imp1`
`protected AbleImport` | `imp2`
`protected double[]` | `inNum`
`protected java.lang.String[]` | `inSym`
`protected int` | `lastNumPasses`
`protected int` | `maxNumPasses`
`protected AbleBackPropagation` | `net`
`protected java.lang.String` | `netArch`
`int` | `numPasses`
`protected double[]` | `outNum`
`protected java.lang.String[]` | `outSym`
`protected java.lang.String` | `testDataFileName`
`protected double` | `testTolerance`
`protected boolean` | `training`
`protected boolean` | `trainOK`
`protected int` | `trainToTestRatio`
`protected double` | `userTolerance`

Fields inherited from class com.ibm.able.AbleDefaultAgent
`activeDataSource, defaultName, eventConnections, myBeans, numEpochs, processList, processListOK, userDefinedFunctions`

Fields inherited from class com.ibm.able.AbleObject
`changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace`

Constructor Summary
`AbleNaiveBayesClassifierAgent()`
`AbleNaiveBayesClassifierAgent(java.lang.String aName)`

Method Summary
`protected void` | `autoTrain(int numPasses)` this method toggles between train/test modes it is only called at the end of an epoch
`double` | `getAvgRMSError()`
`int` | `getBufferSize()`
`java.lang.String` | `getDataFileName()`
`int` | `getDesiredPercentCorrect()`
`int` | `getDesiredPercentIncorrect()`
`int` | `getMaxNumPasses()`
`int` | `getMode()` get the internal config for either NNTRAIN = training from an external data file NNTEST = testing (with network locked) from an external data file or NNRUN = running (with network locked) from data placed in the input buffer
`java.lang.String` | `getNetArch()` Return the number of hidden units specified.
`java.lang.String` | `getNetArchitecture()` Return the number of input, hidden, and output units.
`AbleBackPropagation` | `getNetwork()`
`int` | `getNumPasses()`
`java.lang.String` | `getTestDataFileName()`
`double` | `getTestTolerance()`
`int` | `getTrainToTestRatio()`
`void` | `init()` generate a complete NaiveBayes Classifier agent bean
`boolean` | `isTraining()` Check to see if the network is in the process of training.
`void` | `processTimerEvent()` This method is called from the asynch thread It is only used for automated training of the NaiveBayes agent
`void` | `reset()` Reset each bean in the agent.
`void` | `setBufferSize(int size)`
`void` | `setDataFileName(java.lang.String aFileName)`
`void` | `setDesiredPercentCorrect(int percent)`
`void` | `setDesiredPercentIncorrect(int percent)`
`void` | `setMaxNumPasses(int num)`
`void` | `setMode(int mode)` set the internal config for either NNTRAIN = training from an external data file NNTEST = testing (with network locked) from an external data file or NNRUN = running (with network locked) from data placed in the input buffer
`void` | `setNetArch(java.lang.String arch)`
`void` | `setNumPasses(int num)`
`void` | `setTestDataFileName(java.lang.String aFileName)`
`void` | `setTestTolerance(double tol)`
`void` | `setTrainToTestRatio(int num)`
`void` | `startTraining()` start automatically training the model from the external data this method is called from the customizer Start button should only be called when agent is already in TRAIN state
`void` | `stopTraining()` stop automatically training the model from the external data
`void` | `train()` automatically train the model from the external data stop and lock the network when we are done

Methods inherited from class com.ibm.able.AbleDefaultAgent
`addBean, addBeans, addEventConnection, addUserDefinedFunction, buildProcessList, clsNm, containsBean, containsBean, containsUserDefinedFunction, debugTrace, generateUniqueName, getBean, getBeans, getDataSource, getEventConnections, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, initAllBeans, invokeUserDefinedFunction, isActiveDataSource, process, propertyChange, quitAll, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, resetAllBeans, resumeAll, setActiveDataSource, setDataFlowEnabled, setProcessList, setUserDefinedFunctions, suspendAll`

Methods inherited from class com.ibm.able.AbleObject
`addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getProperties, getProperty, getPropertyChangeListeners, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removeProperty, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setProperties, setProperty, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendEnabledEventProcessing`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.ibm.able.AbleBean
`getComment, getLogger, getName, getParent, getProperties, getProperty, getState, getTraceLogger, init, isChanged, process, removeProperty, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, setState, setTraceLogger`

Methods inherited from interface com.ibm.able.AbleDataBufferManager
`addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer`

Methods inherited from interface com.ibm.able.AbleEventListenerManager
`addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener`

Methods inherited from interface com.ibm.able.AbleEventQueueManager
`flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing`

Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
`processAbleEvent, processNoEventProcessingEnabledSituation`

Methods inherited from interface com.ibm.able.AblePropertyChangeManager
`addPropertyChangeListener, addPropertyConnection, getPropertyChangeListeners, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection`

Methods inherited from interface com.ibm.able.AbleSerializable
`getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName`

Methods inherited from interface com.ibm.able.AbleBeanContainer
`getName`

Field Detail

### dataFileName

    protected java.lang.String dataFileName

### testDataFileName

    protected java.lang.String testDataFileName

### bufferSize

    protected int bufferSize

### maxNumPasses

    protected int maxNumPasses

### desiredPercentCorrect

    protected int desiredPercentCorrect

### desiredPercentIncorrect

    protected int desiredPercentIncorrect

### netArch

    protected java.lang.String netArch

### imp1

    protected AbleImport imp1

### imp2

    protected AbleImport imp2

### filt1

    protected AbleFilter filt1

### filt2

    protected AbleFilter filt2

### net

    protected AbleBackPropagation net

### avgRMSError

    public double avgRMSError

### numPasses

    public int numPasses

### training

    protected boolean training

### lastNumPasses

    protected int lastNumPasses

### userTolerance

    protected double userTolerance

### testTolerance

    protected double testTolerance

### trainToTestRatio

    protected int trainToTestRatio

### trainOK

    protected boolean trainOK

### inNum

    protected double[] inNum

### outNum

    protected double[] outNum

### inSym

    protected java.lang.String[] inSym

### outSym

    protected java.lang.String[] outSym

Constructor Detail

### AbleNaiveBayesClassifierAgent

    public AbleNaiveBayesClassifierAgent()
                                  throws AbleException

### AbleNaiveBayesClassifierAgent

    public AbleNaiveBayesClassifierAgent(java.lang.String aName)
                                  throws AbleException

Method Detail

### init

    public void init()
              throws AbleException

  generate a complete NaiveBayes Classifier agent bean

  Specified by:
    `init` in interface `AbleBean`
  Overrides:
    `init` in class `AbleDefaultAgent`
  Throws:
    `AbleException`
  See Also:
    `AbleObject.init()`

### processTimerEvent

    public void processTimerEvent()
                           throws AbleException

  This method is called from the asynch thread It is only used for automated training of the NaiveBayes agent

  Specified by:
    `processTimerEvent` in interface `AbleEventQueueProcessor`
  Overrides:
    `processTimerEvent` in class `AbleObject`
  Throws:
    `AbleException` - If an error occurs.

### autoTrain

    protected void autoTrain(int numPasses)

  this method toggles between train/test modes it is only called at the end of an epoch

### setDataFileName

    public void setDataFileName(java.lang.String aFileName)

### getDataFileName

    public java.lang.String getDataFileName()

### setTestDataFileName

    public void setTestDataFileName(java.lang.String aFileName)

### getTestDataFileName

    public java.lang.String getTestDataFileName()

### setBufferSize

    public void setBufferSize(int size)

### getBufferSize

    public int getBufferSize()

### getNetwork

    public AbleBackPropagation getNetwork()

### getNumPasses

    public int getNumPasses()

### setNumPasses

    public void setNumPasses(int num)

### setMaxNumPasses

    public void setMaxNumPasses(int num)

### getMaxNumPasses

    public int getMaxNumPasses()

### setDesiredPercentCorrect

    public void setDesiredPercentCorrect(int percent)

### getDesiredPercentCorrect

    public int getDesiredPercentCorrect()

### setDesiredPercentIncorrect

    public void setDesiredPercentIncorrect(int percent)

### getDesiredPercentIncorrect

    public int getDesiredPercentIncorrect()

### getAvgRMSError

    public double getAvgRMSError()

### setNetArch

    public void setNetArch(java.lang.String arch)

### getNetArch

    public java.lang.String getNetArch()

  Return the number of hidden units specified. Input and output units are calculated.

### getNetArchitecture

    public java.lang.String getNetArchitecture()

  Return the number of input, hidden, and output units.

### setTrainToTestRatio

    public void setTrainToTestRatio(int num)

### getTrainToTestRatio

    public int getTrainToTestRatio()

### setTestTolerance

    public void setTestTolerance(double tol)

### getTestTolerance

    public double getTestTolerance()

### setMode

    public void setMode(int mode)
                 throws AbleException

  set the internal config for either NNTRAIN = training from an external data file NNTEST = testing (with network locked) from an external data file or NNRUN = running (with network locked) from data placed in the input buffer

  Throws:
    `AbleException`

### getMode

    public int getMode()
                throws AbleException

  get the internal config for either NNTRAIN = training from an external data file NNTEST = testing (with network locked) from an external data file or NNRUN = running (with network locked) from data placed in the input buffer

  Throws:
    `AbleException`

### isTraining

    public boolean isTraining()
                       throws AbleException

  Check to see if the network is in the process of training.

  Throws:
    `AbleException`

### train

    public void train()
               throws AbleException

  automatically train the model from the external data stop and lock the network when we are done

  Throws:
    `AbleException`

### startTraining

    public void startTraining()
                       throws AbleException

  start automatically training the model from the external data this method is called from the customizer Start button should only be called when agent is already in TRAIN state

  Throws:
    `AbleException`

### stopTraining

    public void stopTraining()
                      throws AbleException

  stop automatically training the model from the external data

  Throws:
    `AbleException`

### reset

    public void reset()
               throws AbleException

  Reset each bean in the agent. Restore training settings to default values.

  Specified by:
    `reset` in interface `AbleBean`
  Overrides:
    `reset` in class `AbleDefaultAgent`
  Throws:
    `AbleException` - If an error occurs when resetting a contained bean. All errors are collected and insert into the exception so that one bean's error does not prevent another from being reset.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005