com.ibm.able.beans.bayes
Class AbleNaiveBayes
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--com.ibm.able.AbleObject
|
+--com.ibm.able.beans.bayes.AbleNaiveBayes
- public class AbleNaiveBayes
- extends AbleObject
- See Also:
- Serialized Form
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 |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary |
AbleNaiveBayes()
construct an AbleNaiveBayes bean |
AbleNaiveBayes(int ncls,
int nftr,
short[] 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) |
Methods inherited from class com.ibm.able.AbleObject |
addAbleEventListener,
addDestBufferConnection,
addPropertyChangeListener,
addPropertyConnection,
addSourceBufferConnection,
addStateChangeListener,
Copyright,
dataChanged,
firePropertyChange,
flushAbleEventQueue,
getAbleEventListeners,
getAbleEventProcessingEnabled,
getAbleEventQueueSize,
getBuffer,
getBufferContents,
getComment,
getDestBufferConnections,
getFileName,
getInputBuffer,
getInputBuffer,
getInputBufferAsStringArray,
getInputBufferContents,
getLogger,
getName,
getOutputBuffer,
getOutputBuffer,
getOutputBufferAsStringArray,
getOutputBufferContents,
getParent,
getPropertyConnectionManager,
getSleepTime,
getSourceBufferConnections,
getState,
handleAbleEvent,
hasInputBuffer,
hasOutputBuffer,
init,
isAbleEventPostingEnabled,
isAbleEventProcessingEnabled,
isChanged,
isConnectable,
isDataFlowEnabled,
isTimerEventProcessingEnabled,
notifyAbleEventListeners,
processAbleEvent,
processBufferConnections,
processNoEventProcessingEnabledSituation,
propertyChange,
quitAll,
quitEnabledEventProcessing,
removeAbleEventListener,
removeAllAbleEventListeners,
removeAllBufferConnections,
removeAllPropertyConnections,
removeDestBufferConnection,
removePropertyChangeListener,
removePropertyConnection,
removeSourceBufferConnection,
removeStateChangeListener,
restartEnabledEventProcessing,
restoreFromFile,
restoreFromFile,
restoreFromSerializedFile,
restoreFromStream,
resumeAll,
resumeEnabledEventProcessing,
saveToFile,
saveToFile,
setAbleEventProcessingEnabled,
setChanged,
setComment,
setDataFlowEnabled,
setFileName,
setInputBuffer,
setInputBuffer,
setLogger,
setName,
setOutputBuffer,
setOutputBuffer,
setParent,
setSleepTime,
setState,
setTimerEventProcessingEnabled,
sourceConnectionsOK,
startEnabledEventProcessing,
suspendAll,
suspendEnabledEventProcessing,
toString |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone,
exportObject,
exportObject,
exportObject,
unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost,
getLog,
setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals,
getRef,
hashCode,
toStub |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
NB
protected NaiveBayes NB
data
protected int[][] data
labels
protected int[] labels
nvals
protected short[] nvals
nlabels
protected int nlabels
nfeatures
protected int nfeatures
nvalues
protected int nvalues
ninst
protected int ninst
numInputs
protected int numInputs
numOutputs
protected int numOutputs
inNum
protected int[] inNum
outNum
protected double[] outNum
netMode
protected int netMode
netNumRecs
protected int netNumRecs
netRecInx
protected int netRecInx
AbleNaiveBayes
public AbleNaiveBayes()
throws java.rmi.RemoteException
- construct an AbleNaiveBayes bean
AbleNaiveBayes
public AbleNaiveBayes(int ncls,
int nftr,
short[] nval,
int m,
double[] cpriors,
double[][][] ppriors)
throws java.rmi.RemoteException
- 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)
getNetMode
public int getNetMode()
getNetNumRecs
public int getNetNumRecs()
getNetRecInx
public int getNetRecInx()
setNetMode
public void setNetMode(int mode)
- train (build hypothesis) or test(classify) modes
init
public void init()
throws java.rmi.RemoteException
- Initialize the bean
Read in the file and create the Naive Bayes Network
- Overrides:
- init in class AbleObject
reset
public void reset()
- Overrides:
- reset in class AbleObject
process
public void process()
throws java.rmi.RemoteException
- 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
- Overrides:
- process in class AbleObject
processTimerEvent
public void processTimerEvent()
- Not used in this class
- Overrides:
- processTimerEvent in class AbleObject
initFromImport
protected void initFromImport()
- try to figure out the Bayes network architecture from an AbleImport
and DataSet object
getNClasses
public int getNClasses()
getNFeatures
public int getNFeatures()
getNFValues
public short[] getNFValues()
getEqSampleSize
public double[] getEqSampleSize()
getCPT
public double[][][] getCPT()
getClassPriors
public double[] getClassPriors()
getAvgLikelihood
public double getAvgLikelihood()
getAvgLogLikelihood
public double getAvgLogLikelihood()
getAccuracy
public double getAccuracy()
getClassProb
public double[] getClassProb()
getConfusionMatrix
public int[][] getConfusionMatrix()
setNClasses
public void setNClasses(int ncls)
setNFeatures
public void setNFeatures(int nftr)
setNFValues
public void setNFValues(short[] nfv)
setClassPriors
public void setClassPriors(double[] cpriors)
ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'