Learn R Programming

yap (version 0.1.1)

pnn.predone: Calculate the predicted probability for each category of PNN

Description

The function pnn.predone calculates the predicted probability for each category of PNN

The function pnn.predone calculates the predicted probability for each category of PNN

Usage

pnn.predone(net, x)

pnn.predone(net, x)

Arguments

net

A PNN object created by pnn.fit()

x

A vector of input predictors

Value

A one-row matrix of predicted probabilities

A one-row matrix of predicted probabilities

See Also

pnn.fit

pnn.fit

Examples

Run this code
# NOT RUN {
data(iris, package = "datasets")
Y <- iris[, 5]
X <- scale(iris[, 1:4])
pnet <- pnn.fit(x = X, y = Y)
for (i in seq(5)) print(pnn.predone(pnet, X[i, ]))
data(iris, package = "datasets")
Y <- iris[, 5]
X <- scale(iris[, 1:4])
pnet <- pnn.fit(x = X, y = Y)
for (i in seq(5)) print(pnn.predone(pnet, X[i, ]))
# }

Run the code above in your browser using DataLab