pnn.predict: Calculate a matrix of predicted probabilities

Description Usage Arguments Value See Also Examples

View source: R/pnn.predict.R

Description

The function pnn.predict calculates a matrix of predicted probabilities based on a matrix of predictors

Usage

1
pnn.predict(net, x)

Arguments

net

The PNN object generated by pnn.fit()

x

The matrix of input predictors

Value

A matrix of predicted probabilities for all categories

See Also

pnn.predone

Examples

1
2
3
4
5
data(iris, package = "datasets")
Y <- iris[, 5]
X <- scale(iris[, 1:4])
pnet <- pnn.fit(x = X, y = Y)
pnn.predict(pnet, X[seq(5), ])

Example output

        setosa versicolor    virginica
[1,] 0.9801419 0.01882609 0.0010320113
[2,] 0.9296185 0.06755915 0.0028223580
[3,] 0.9700381 0.02879490 0.0011670227
[4,] 0.9573777 0.04096616 0.0016561408
[5,] 0.9869090 0.01242208 0.0006689094

yap documentation built on Oct. 26, 2020, 1:06 a.m.

Related to pnn.predict in yap...