|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.AbleObject | +--com.ibm.able.beans.knn.AbleNaiveBayesDistributed
Field Summary | |
---|---|
static java.lang.String |
defaultName
Value assigned to name by default. |
double[] |
inNum
The numeric input buffer |
static java.lang.String[] |
MODE_NAMES
Labels for the train, test and run modes for GUI use. |
double[] |
outNum
The numeric output buffer |
static int |
RUN
Application or Run mode output is produced |
static int |
TEST
Test mode performance is tested (errors are computed) |
static int |
TRAIN
Training mode training data is stored |
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 | |
---|---|
AbleNaiveBayesDistributed()
Default constructor |
|
AbleNaiveBayesDistributed(java.lang.String aName)
Construct a naive bayes bean with specified name |
|
AbleNaiveBayesDistributed(java.lang.String aName,
int args)
|
Method Summary | |
---|---|
void |
calcPosteriorProb()
|
double[] |
calcPriorClassProb()
|
void |
calcPriorProb()
|
static java.lang.String |
Copyright()
Determine the copyright of this class. |
void |
generateTranslateTemplates(AbleFilter inFilt,
AbleFilter outFilt,
java.util.Vector fields)
Populate a filter for converting data to a bean's input specifications, and a filter for converting a bean's output specifications back to the original coordinates. |
double |
getAccuracy()
Get the accuracy |
double |
getClass(double[] x)
Find to which class the current test example is assigned by Naive Bayes algorithm |
double |
getCurrentActualClass()
Get the current actual classes corresponding to the current test example |
double |
getCurrentLearnedClass()
Get the current learned classes corresponding to the current test/run example |
double[] |
getCurrentTestExample()
Get the current test example |
double[] |
getCurrentTrainExample()
Get the current training example |
AttributeValueClass |
getElement(java.util.Vector v,
int attr,
int val,
int cl)
|
double |
getError()
Get the error |
java.util.Hashtable[] |
getFieldValues()
|
double[] |
getInNum()
|
int |
getM()
Get m parameter |
int |
getMaxProbIndex(double[] prob)
Given a Vector distance populated with distances between current test example and all the training examples, get the index of the training example with the smallest distance to the test example |
int |
getNaiveBayesMode()
Get the current operating mode of the naive bayes bean. |
int |
getNumAttributes()
Get numAttr parameter |
int |
getNumClasses()
Get numClasses parameter |
long |
getNumCorrectTestExamples()
Get the number of correctly classified test examples |
int |
GetNumInstances(int clasS)
|
long |
getNumRecords()
Get numRecords parameter |
long |
getNumTestExamples()
Get the number of test examples seen so far |
double[] |
getOutNum()
|
java.util.Vector |
getTable()
|
void |
init()
Get ready to process - init all the bean members |
void |
process()
Performs the main, synchronous, standard processing function performed by this bean. |
void |
reset()
reset the naive bayes bean |
java.util.Vector |
setAllTable()
|
protected void |
setDefaults()
Set up the event queue behavior No timer processing and no asynch event processing |
void |
setNaiveBayesMode(int mode)
Set the operating mode of the naive bayes bean. |
void |
setNaiveBayesParameters(int newAttr,
int newCl,
long newRec)
Set the number records, number attributes and number classes for naive bayes bean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String defaultName
public double[] inNum
public double[] outNum
public static final int TRAIN
public static final int TEST
public static final int RUN
public static final java.lang.String[] MODE_NAMES
Constructor Detail |
public AbleNaiveBayesDistributed() throws AbleException
public AbleNaiveBayesDistributed(java.lang.String aName) throws AbleException
Name
- The object name
public AbleNaiveBayesDistributed(java.lang.String aName, int args) throws AbleException
Method Detail |
public double[] getInNum()
public double[] getOutNum()
protected void setDefaults() throws AbleException
public int getNaiveBayesMode()
public void setNaiveBayesMode(int mode)
Mode
- The current operating mode, train/test/run
public void setNaiveBayesParameters(int newAttr, int newCl, long newRec)
parameter
- newRec that defines the number of recordsparameter
- newAttr that defines the number of attributesparameter
- newCl that defines the number of classespublic int getM()
public long getNumRecords()
public int getNumAttributes()
public int getNumClasses()
public long getNumTestExamples()
public long getNumCorrectTestExamples()
public double getAccuracy()
public double getError()
public double[] getCurrentTrainExample()
public double[] getCurrentTestExample()
public double getCurrentLearnedClass()
public double getCurrentActualClass()
public java.util.Vector getTable()
public void init() throws AbleException
init
in class AbleObject
com.ibm.able.AbleObject
AbleException
- If an error occurs.AbleObject.startEnabledEventProcessing()
public void reset() throws AbleException
reset
in class AbleObject
com.ibm.able.AbleObject
AbleException
- If an error occurs.AbleBean.reset()
public int getMaxProbIndex(double[] prob)
public AttributeValueClass getElement(java.util.Vector v, int attr, int val, int cl)
public double getClass(double[] x) throws AbleException
public java.util.Hashtable[] getFieldValues() throws AbleException
public double[] calcPriorClassProb() throws AbleException
public java.util.Vector setAllTable() throws AbleException
public void calcPriorProb() throws AbleException
public int GetNumInstances(int clasS)
public void calcPosteriorProb() throws AbleException
public void process() throws AbleException
AbleObject
This base method implementation provides tracing only.
process
in class AbleObject
com.ibm.able.AbleObject
AbleObject.inputBuffer
,
AbleObject.outputBuffer
,
AbleBean.process()
public void generateTranslateTemplates(AbleFilter inFilt, AbleFilter outFilt, java.util.Vector fields) throws AbleException
AbleTranslateTemplateProvider
AbleFilter.generateTranslateTemplates(com.ibm.able.beans.filter.AbleFilter, com.ibm.able.beans.filter.AbleFilter, java.util.Vector)
generateTranslateTemplates
in interface AbleTranslateTemplateProvider
com.ibm.able.beans.filter.AbleTranslateTemplateProvider
inFilter
- The AbleFilter used to convert incoming data.outFilter
- The AbleFilter used to convert outgoing data.fields
- A vector of AbleFields from which to derive the translation template.public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |