|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.learn.NaiveBayes.Count
protected static class NaiveBayes.Count
A Count object stores two doubles, one which
holds a accumulated count value and the other intended to hold the
natural logarithm of the count. The object also contains a
boolean flag that is set when the log needs to be updated.
| Field Summary | |
|---|---|
protected double |
count
The accumulated value. |
protected double |
logCount
The natural logartihm of count is sometimes stored here. |
protected boolean |
updateLog
A flag that is set iff logCount is not up to date. |
| Constructor Summary | |
|---|---|
NaiveBayes.Count()
Sets the count to 0. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
This method returns a shallow clone. |
double |
getCount()
Returns the integer count. |
double |
getLog()
Returns the log after updating it. |
void |
increment(double inc)
Increments the count, but does not update the log. |
private void |
readObject(java.io.ObjectInputStream in)
Special handling during deserialization to ensure that updateLog is set to true. |
java.lang.String |
toString()
The string representation of a Count object is simply the
integer count. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double count
protected transient double logCount
count is sometimes stored here.
protected transient boolean updateLog
logCount is not up to date.
| Constructor Detail |
|---|
public NaiveBayes.Count()
| Method Detail |
|---|
public double getCount()
public void increment(double inc)
inc - The amount the count should be incremented by.public double getLog()
public java.lang.String toString()
Count object is simply the
integer count.
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Object
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
updateLog is set to true.
in - The stream to deserialize from.
java.io.IOException
java.lang.ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||