NaiveBayes

scalation.modeling.classifying.NaiveBayes
See theNaiveBayes companion class
object NaiveBayes

NaiveBayes is the companion object for the NaiveBayes class.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NaiveBayes.type

Members list

Value members

Concrete methods

def apply(xy: MatrixI, fname: Array[String], k: Int, cname: Array[String], vc: VectorI, hparam: HyperParameter)(col: Int): NaiveBayes

Create a NaiveBayes object, passing x and y together in one matrix.

Create a NaiveBayes object, passing x and y together in one matrix.

Value parameters

cname

the names of the classes

col

the designated response column (defaults to the last column)

fname

the names of the features/variables

hparam

the hyper-parameters

k

the number of classes

vc

the value count (number of distinct values) for each feature

xy

the combined data-response matrix

Attributes

def me_vc(me: Double, vc: VectorI): VectorD

Compute the contribution to the fake instances for each each feature xj based on its value count. Used for Laplace smoothing.

Compute the contribution to the fake instances for each each feature xj based on its value count. Used for Laplace smoothing.

Value parameters

me

the number/fraction of fake instances used for Laplace smooth

vc

the value count vector

Attributes

Concrete fields