ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.agents
Class AbleNeuralClusteringAgent

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.AbleDefaultAgent
              |
              +--com.ibm.able.agents.AbleNeuralClusteringAgent
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 AbleNeuralClusteringAgent
extends AbleDefaultAgent
implements java.io.Serializable

This class implements clustering using a self-organizing map

See Also:
Serialized Form

Field Summary
protected  boolean autoTrain
           
protected  int bufferSize
           
protected  double confidence
           
protected  java.lang.String dataFileName
           
static java.lang.String defaultName
          Value assigned to name by default.
protected  AbleFilter filt1
           
protected  AbleImport imp1
           
protected  AbleImport imp2
           
protected  double[] inNum
           
protected  java.lang.String[] inSym
           
protected  int maxNumPasses
           
protected  AbleSelfOrganizingMap net
           
protected  int numCols
           
protected  int numPasses
           
protected  int numRows
           
protected  double[] outNum
           
protected  java.lang.String[] outSym
           
protected  java.lang.String testDataFileName
           
protected  boolean training
           
protected  int winner
           
 
Fields inherited from class com.ibm.able.AbleDefaultAgent
activeDataSource, 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, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleNeuralClusteringAgent()
           
AbleNeuralClusteringAgent(java.lang.String aName)
           
 
Method Summary
static java.lang.String Copyright()
          Determine the copyright of this class.
 boolean getAutoTrain()
           
 int getBufferSize()
           
 java.lang.String[] getClusterCategories()
          Returns the cluster category values for each cluster
 java.lang.String getClusterCategory(int clusterIndex)
          Get the category associated with the specified cluster
 java.util.Vector getClusterCategoryValues()
          Returns a list of unique cluster category values
 java.lang.String getClusterLabel(int clusterIndex)
          Return the label associated with the specified cluster
 java.lang.String[] getClusterLabels()
          Get an array of Labels (one for each cluster)
 double getConfidence()
           
 java.lang.String getDataFileName()
           
 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 getNetArchitecture()
          Return the number of input, hidden, and output units.
 AbleSelfOrganizingMap getNetwork()
           
 int getNumCols()
           
 int getNumPasses()
           
 int getNumRows()
           
 java.lang.String getTestDataFileName()
           
 double getWinner()
           
 java.lang.String getWinnerCategory()
          Get the category of the current winner cluster
 java.lang.String getWinnerLabel()
          Get the label of the winner cluster
 void init()
          generate a complete neural Clustering 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 to automated training of the neural agent
 void reset()
          Reset each bean created when the agent was initialized.
 void setAutoTrain(boolean state)
           
 void setBufferSize(int size)
           
 void setClusterCategory(int clusterIndex, java.lang.String category)
          Set the category for the specified cluster
 void setClusterLabel(int clusterIndex, java.lang.String label)
          Set the label for the specified cluster
 void setDataFileName(java.lang.String aFileName)
           
protected  void setDefaults()
           
 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 setNumCols(int num)
           
 void setNumPasses(int num)
           
 void setNumRows(int num)
           
 void setTestDataFileName(java.lang.String aFileName)
           
 void startTraining()
          start automatically training the model from the external data
 void stopTraining()
          stop automatically training the model from the external data
 
Methods inherited from class com.ibm.able.AbleDefaultAgent
addBean, addBeans, addEventConnection, addUserDefinedFunction, buildProcessList, clsNm, containsBean, containsBean, containsUserDefinedFunction, debugTrace, generateUniqueName, getBean, getBeans, getDataSource, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, invokeUserDefinedFunction, isActiveDataSource, process, propertyChange, quitAll, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, 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, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, 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, getState, getTraceLogger, init, isChanged, process, setChanged, setComment, setLogger, setName, setParent, setState, setTraceLogger
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, 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, 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

defaultName

public static final java.lang.String defaultName
Value assigned to name by default.

dataFileName

protected java.lang.String dataFileName

testDataFileName

protected java.lang.String testDataFileName

bufferSize

protected int bufferSize

maxNumPasses

protected int maxNumPasses

confidence

protected double confidence

numRows

protected int numRows

numCols

protected int numCols

imp1

protected AbleImport imp1

imp2

protected AbleImport imp2

filt1

protected AbleFilter filt1

net

protected AbleSelfOrganizingMap net

winner

protected int winner

numPasses

protected int numPasses

training

protected boolean training

autoTrain

protected boolean autoTrain

inNum

protected double[] inNum

outNum

protected double[] outNum

inSym

protected java.lang.String[] inSym

outSym

protected java.lang.String[] outSym
Constructor Detail

AbleNeuralClusteringAgent

public AbleNeuralClusteringAgent()
                          throws AbleException

AbleNeuralClusteringAgent

public AbleNeuralClusteringAgent(java.lang.String aName)
                          throws AbleException
Method Detail

reset

public void reset()
           throws AbleException
Reset each bean created when the agent was initialized. Restore processing options to default values.
Overrides:
reset in class AbleDefaultAgent
Following copied from class: com.ibm.able.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.

setDefaults

protected void setDefaults()
                    throws AbleException

init

public void init()
          throws AbleException
generate a complete neural Clustering agent bean
Overrides:
init in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Throws:
AbleException - If an error occurs.

processTimerEvent

public void processTimerEvent()
                       throws AbleException
This method is called from the asynch thread It is only used to automated training of the neural agent
Overrides:
processTimerEvent in class AbleObject
Following copied from interface: com.ibm.able.AbleEventQueueProcessor
Throws:
AbleException - If an error occurs.

setDataFileName

public void setDataFileName(java.lang.String aFileName)
                     throws AbleException

getDataFileName

public java.lang.String getDataFileName()

setTestDataFileName

public void setTestDataFileName(java.lang.String aFileName)
                         throws AbleException

getTestDataFileName

public java.lang.String getTestDataFileName()

setBufferSize

public void setBufferSize(int size)

getBufferSize

public int getBufferSize()

getNetwork

public AbleSelfOrganizingMap getNetwork()

getNumPasses

public int getNumPasses()

setNumPasses

public void setNumPasses(int num)

setMaxNumPasses

public void setMaxNumPasses(int num)

getMaxNumPasses

public int getMaxNumPasses()

getConfidence

public double getConfidence()

getWinner

public double getWinner()

setNumRows

public void setNumRows(int num)

getNumRows

public int getNumRows()

setNumCols

public void setNumCols(int num)

getNumCols

public int getNumCols()

setAutoTrain

public void setAutoTrain(boolean state)

getAutoTrain

public boolean getAutoTrain()

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

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

getNetArchitecture

public java.lang.String getNetArchitecture()
                                    throws AbleException
Return the number of input, hidden, and output units.

isTraining

public boolean isTraining()
                   throws AbleException
Check to see if the network is in the process of training.

startTraining

public void startTraining()
                   throws AbleException
start automatically training the model from the external data

stopTraining

public void stopTraining()
                  throws AbleException
stop automatically training the model from the external data

getClusterLabel

public java.lang.String getClusterLabel(int clusterIndex)
Return the label associated with the specified cluster
Parameters:
clusterIndex - The cluster ID of the cluster
Returns:
the label

setClusterLabel

public void setClusterLabel(int clusterIndex,
                            java.lang.String label)
Set the label for the specified cluster
Parameters:
clusterIndex - The cluster ID (number) ranging from 0 to n-1
label - The string label for the cluster

getClusterLabels

public java.lang.String[] getClusterLabels()
Get an array of Labels (one for each cluster)
Returns:
A string array of cluster labels

getClusterCategory

public java.lang.String getClusterCategory(int clusterIndex)
Get the category associated with the specified cluster
Parameters:
clusterIndex - The cluster ID (number) ranging from 0 to n-1

Returns:
the category of the cluster

getWinnerCategory

public java.lang.String getWinnerCategory()
Get the category of the current winner cluster
Returns:
the category of the winner

getWinnerLabel

public java.lang.String getWinnerLabel()
Get the label of the winner cluster

setClusterCategory

public void setClusterCategory(int clusterIndex,
                               java.lang.String category)
                        throws AbleDataException
Set the category for the specified cluster
Parameters:
clusterIndex - The cluster ID (number) ranging from 0 to n-1
category - The string identifier for the category

getClusterCategories

public java.lang.String[] getClusterCategories()
Returns the cluster category values for each cluster
Returns:
A string array of categories

getClusterCategoryValues

public java.util.Vector getClusterCategoryValues()
Returns a list of unique cluster category values
Returns:
A vector of unique cluster category values

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003