pnn.search_logl: Search for the optimal value of PNN smoothing parameter based...

Description Usage Arguments Value Examples

View source: R/pnn.search_logl.R

Description

The function pnn.search_logl searches for the optimal value of PNN smoothing parameter by cross-validation.

Usage

1
pnn.search_logl(net, sigmas, nfolds = 4, seed = 1)

Arguments

net

A PNN object generated by pnn.fit()

sigmas

A numeric vector to search for the best 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

Value

The list of all searching outcomes and the best outcome

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.search_logl(pnet, c(0.5, 1), nfolds = 2)

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

Related to pnn.search_logl in yap...