gaussianKdePredict

Syntax

gaussianKdePredict(model,X)

Arguments

model is a dictionary indicating the model generated by gaussianKde.

X is a numeric vector, matrix, tuple, or table indicating the data to be predicted. Its dimensions must be the same as those of the dataset used in gaussianKde.

Details

Predict the probability density of the input data based on the model generated by gaussianKde.

Return value: A floating-point vector of the same size as the number of rows in X, indicating the prediction result of each data point in X.

Examples

The following example first uses the gaussianKde function to estimate the probability density of the input trainset.txt. based on the Gaussian kernel estimation and generate a model. Then, the gaussianKdePredict function is called to apply this model to another input file, testset.txt, to predict its probability density results.

trainData = loadText("trainset.txt"," ");
testData = loadText("testset.txt"," ");
model = gaussianKde(trainData)
gaussianKdePredict(model, testData)

Output:

->[0.0623,0.0730,0.0336,0.0030,0.0001,0.0552....]

Related Function: gaussianKde