|
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 | |||||||||||
java.lang.Objectcom.ibm.able.AbleObject
com.ibm.able.beans.bayes.AbleNaiveBayes
| Field Summary | |
|---|---|
protected int[][] |
data
|
protected int[] |
inNum
|
protected int[] |
labels
|
protected NaiveBayes |
NB
|
protected int |
netMode
|
protected int |
netNumRecs
|
protected int |
netRecInx
|
protected int |
nfeatures
|
protected int |
ninst
|
protected int |
nlabels
|
protected int |
numInputs
|
protected int |
numOutputs
|
protected int[] |
nvals
|
protected int |
nvalues
|
protected double[] |
outNum
|
| Fields inherited from class com.ibm.able.AbleObject |
|---|
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace |
| Constructor Summary | |
|---|---|
AbleNaiveBayes()
construct an AbleNaiveBayes bean |
|
AbleNaiveBayes(int ncls,
int nftr,
int[] nval,
int m,
double[] cpriors,
double[][][] ppriors)
construct AbleNaiveBayes bean with the explicitly specified parameters ncls - number of class labels nftr - number of features nval - number of values per each feature (assuming nominal - discrete finite-valued - features) cpriors - prior probability distribution over class labels m - equivalent sample size ppriors - prior estimates of the probabilities P(f|C) (used for Bayesian parameter estimation with equivalent sample size method) |
|
AbleNaiveBayes(java.lang.String name)
construct an AbleNaiveBayes bean |
|
| Method Summary | |
|---|---|
double |
getAccuracy()
|
double |
getAvgLikelihood()
|
double |
getAvgLogLikelihood()
|
double[] |
getClassPriors()
|
double[] |
getClassProb()
|
int[][] |
getConfusionMatrix()
|
double[][][] |
getCPT()
|
double[] |
getEqSampleSize()
|
int |
getNClasses()
|
int |
getNetMode()
|
int |
getNetNumRecs()
|
int |
getNetRecInx()
|
int |
getNFeatures()
|
int[] |
getNFValues()
|
void |
init()
Initialize the bean Read in the file and create the Naive Bayes Network |
protected void |
initFromImport()
try to figure out the Bayes network architecture from an AbleImport and DataSet object |
void |
process()
Process a single record from the input buffer if in train mode, add info to the network if in test mode, classify it and place the class index in the output buffer |
void |
processTimerEvent()
Not used in this class |
void |
reset()
Reset this bean to its "initialized" state. |
void |
setClassPriors(double[] cpriors)
|
void |
setNClasses(int ncls)
|
void |
setNetMode(int mode)
train (build hypothesis) or test(classify) modes |
void |
setNFeatures(int nftr,
int[] nfv)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected NaiveBayes NB
protected int[][] data
protected int[] labels
protected int[] nvals
protected int nlabels
protected int nfeatures
protected int nvalues
protected int ninst
protected int numInputs
protected int numOutputs
protected int[] inNum
protected double[] outNum
protected int netMode
protected int netNumRecs
protected int netRecInx
| Constructor Detail |
public AbleNaiveBayes()
throws AbleException
public AbleNaiveBayes(java.lang.String name)
throws AbleException
public AbleNaiveBayes(int ncls,
int nftr,
int[] nval,
int m,
double[] cpriors,
double[][][] ppriors)
throws AbleException
| Method Detail |
public int getNetMode()
public int getNetNumRecs()
public int getNetRecInx()
public void setNetMode(int mode)
public void init()
throws AbleException
init in interface AbleBeaninit in class AbleObjectAbleException - If an error occurs.AbleObject.startEnabledEventProcessing()public void reset()
AbleObjectThis base method has no default implementation. It only provides tracing.
reset in interface AbleBeanreset in class AbleObjectAbleBean.reset()
public void process()
throws AbleException
process in interface AbleBeanprocess in class AbleObjectAbleExceptionAbleObject.inputBuffer,
AbleObject.outputBuffer,
AbleBean.process()public void processTimerEvent()
processTimerEvent in interface AbleEventQueueProcessorprocessTimerEvent in class AbleObject
protected void initFromImport()
throws AbleException
AbleExceptionpublic int getNClasses()
public int getNFeatures()
public int[] getNFValues()
public double[] getEqSampleSize()
public double[][][] getCPT()
public double[] getClassPriors()
public double getAvgLikelihood()
public double getAvgLogLikelihood()
public double getAccuracy()
public double[] getClassProb()
public int[][] getConfusionMatrix()
public void setNClasses(int ncls)
public void setNFeatures(int nftr,
int[] nfv)
public void setClassPriors(double[] cpriors)
|
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 | |||||||||||