powered by
The function pnn.optmiz_logl optimize the optimal value of PNN smoothing parameter by cross-validation.
pnn.optmiz_logl
pnn.optmiz_logl(net, lower = 0, upper, nfolds = 4, seed = 1, method = 1)
A PNN object generated by pnn.fit()
A scalar for the lower bound of the smoothing parameter, 0 by default
A scalar for the upper bound of the 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
A scalar referring to the optimization method, 1 for Golden section searc and 2 for Brent's method
The best outcome
pnn.search_logl
# 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