gaussianNB#

swordfish.function.gaussianNB()#

Conduct the Naive Bayesian classification.

Parameters:
  • Y (Constant) – A vector with the same length as table X. Each element of labels indicates the class that the correponding row in X belongs to.

  • X (Constant) – A table indicating the training set. Each row is a sample and each column is a feature.

  • varSmoothing (Constant, optional) – A positive floating number indicating the portion of the largest variance of all features that is added to variances for calculation stability. The default value is 1e-9.

Returns:

A dictionary with the following keys:

  • model: a RESOURCE data type variable. It is an internal binary resource generated by function gaussianNB and to be used by function predict.

  • modelName: string “GaussianNB”.

  • varSmoothing: varSmoothing parameter value.

Return type:

Constant