powered by
The function pnn.search_logl searches for the optimal value of PNN smoothing parameter by cross-validation.
pnn.search_logl
pnn.search_logl(net, sigmas, nfolds = 4, seed = 1)
A PNN object generated by pnn.fit()
A numeric vector to search for the best smoothing parameter
A scalar for the number of n-fold, 4 by default
The seed value for the n-fold cross-validation, 1 by default
The list of all searching outcomes and the best outcome
# NOT RUN { 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) # }
Run the code above in your browser using DataLab