Trains a Naive Bayes classifier for classifying data into one of nClasses target classifications.

Namespace: Imsl.DataMining
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.0.0

Syntax

C#
public void Train(
	double[][] continuousData,
	int[][] nominalData,
	int[] classificationData
)
Visual Basic (Declaration)
Public Sub Train ( _
	continuousData As Double()(), _
	nominalData As Integer()(), _
	classificationData As Integer() _
)
Visual C++
public:
void Train(
	array<array<double>^>^ continuousData, 
	array<array<int>^>^ nominalData, 
	array<int>^ classificationData
)

Parameters

continuousData
Type: array< array< System..::.Double >[]()[] >[]()[]
A double matrix containing the training values for the nContinuous continuous attributes. The i-th row contains the input attributes for the i-th training pattern. The j-th column contains the values for the j-th continuous attribute. Missing values should be set to Double.NaN. Patterns with both non-missing and missing values are used to train the classifier unless the IgnoreMissingValues method has been set to true. A null is allowed when nContinuous is equal to zero.
nominalData
Type: array< array< System..::.Int32 >[]()[] >[]()[]
An int matrix containing the training values for the nNominal nominal attributes. The i-th row contains the input attributes for the i-th training pattern. The j-th column contains the classifications for the j-th nominal attribute. The values for the j-th nominal attribute are expected to be encoded with integers starting from 0 to nCategories - 1, where nCategories is specified in the CreateNominalAttribute method. Any value outside this range is treated as a missing value. Patterns with both non-missing and missing values are used to train the classifier unless the IgnoreMissingValues method has been set to true. A null is allowed when nNominal is equal to zero.
classificationData
Type: array< System..::.Int32 >[]()[]
An int array containing the target classifications for the training patterns. These must be encoded from zero to nClasses-1. Any value outside this range is considered a missing value. In this case, the data in that pattern are not used to train the Naive Bayes classifier. However, any pattern with missing values is still classified after the classifier is trained.

See Also