Learn R Programming

yap (version 0.1.1)

pnn.optmiz_logl: Optimize the optimal value of PNN smoothing parameter based on the cross entropy

Description

The function pnn.optmiz_logl optimize the optimal value of PNN smoothing parameter by cross-validation.

Usage

pnn.optmiz_logl(net, lower = 0, upper, nfolds = 4, seed = 1, method = 1)

Arguments

net

A PNN object generated by pnn.fit()

lower

A scalar for the lower bound of the smoothing parameter, 0 by default

upper

A scalar for the upper bound of the smoothing parameter

nfolds

A scalar for the number of n-fold, 4 by default

seed

The seed value for the n-fold cross-validation, 1 by default

method

A scalar referring to the optimization method, 1 for Golden section searc and 2 for Brent's method

Value

The best outcome

See Also

pnn.search_logl

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)
# }
# NOT RUN {
pnn.optmiz_logl(pnet, upper = 1)
# }

Run the code above in your browser using DataLab