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

Description Usage Arguments Value See Also Examples

View source: R/pnn.optmiz_logl.R

Description

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

Usage

1
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

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

pnn.optmiz_logl(pnet, upper = 1)

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

Related to pnn.optmiz_logl in yap...