nb
Class NBNorm

java.lang.Object
  |
  +--nb.NBNorm

public class NBNorm
extends java.lang.Object

NBNorm is a helper class to hold the 3rd dimension of an Array2 containing the parameters of the Normal Density for each (continuous attribute,label) combination. The hd (hasData) argument defaults to FALSE.


Field Summary
 boolean hasData
          If true the data in this NBNorm is valid, if false there is no valid data stored in this object.
 double mean
          stores the mean value of the data.
 double var
          stores the variance of the data.
 
Constructor Summary
NBNorm()
          This is the default constructor.
NBNorm(double m, double v, boolean hd)
          This constructor sets fields to parameter values.
NBNorm(NBNorm rhs)
          The copy constructor for NBNorm.
 
Method Summary
 boolean equals(NBNorm rhs)
          Equivalent to operator==.
 void set_mean_and_var(double m, double v)
          Sets the mean and variance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mean

public double mean
stores the mean value of the data.

var

public double var
stores the variance of the data.

hasData

public boolean hasData
If true the data in this NBNorm is valid, if false there is no valid data stored in this object.
Constructor Detail

NBNorm

public NBNorm()
This is the default constructor. All fields set to default.

NBNorm

public NBNorm(double m,
              double v,
              boolean hd)
This constructor sets fields to parameter values.
Parameters:
m - - the mean value.
v - - the variance.
hd - - the has data boolean.

NBNorm

public NBNorm(NBNorm rhs)
The copy constructor for NBNorm.
Method Detail

set_mean_and_var

public void set_mean_and_var(double m,
                             double v)
Sets the mean and variance.
Parameters:
m - - the new mean.
v - - the new variance.

equals

public boolean equals(NBNorm rhs)
Equivalent to operator==. Provided for use by NaiveBayesCat.equals.
Parameters:
rhs - - the NBNorm to test equalitly.
Returns:
true if the this is equal to rhs; false else.