yager (version 0.1.0)

grnn.search_rsq: Search for the optimal value of GRNN smoothing parameter based on r-square

Description

The function grnn.search_rsq searches for the optimal value of GRNN smoothing parameter by cross-validation. It is applicable to the functional approximation

Usage

grnn.search_rsq(net, sigmas, nfolds = 4, seed = 1)

Arguments

net

A GRNN object generated by grnn.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

Run this code
# NOT RUN {
data(iris, package = "datasets")
Y <- ifelse(iris[, 5] == "setosa", 1, 0)
X <- scale(iris[, 1:4])
gnet <- grnn.fit(x = X, y = Y)
grnn.search_rsq(net = gnet, sigmas = seq(3), nfolds = 2)
# }

Run the code above in your browser using DataCamp Workspace