Calculate the NNET Result with the Smallest Value from Various Random Starts
This function provides the best solution from various calls to the nnet feed-forward artificial neural networks function (nnet).
nnetrandom(formula,data,tries=10,leave.one.out=F,...)
This function makes various calls to nnet. If desired by the user, leave-one-out statistics are provided that report the prediction if one particular sample unit was not used for iterating the networks.
The function returns the same components as nnet, but adds the following components:
range |
Summary of the observed "values". |
tries |
Number of different attempts to iterate an ANN. |
CV |
Predicted class when not using the respective sample unit for iterating ANN. |
succesful |
Test whether leave-one-out statistics provided the same class as the original class. |
Roeland Kindt (World Agroforestry Centre)
## Not run:
data(faramea)
faramea <- na.omit(faramea)
faramea$presence <- as.numeric(faramea$Faramea.occidentalis > 0)
attach(faramea)
library(nnet)
result <- nnetrandom(presence ~ Elevation, data=faramea, size=2,
skip=FALSE, entropy=TRUE, trace=FALSE, maxit=1000, tries=100,
leave.one.out=FALSE)
summary(result)
result$fitted.values
result$value
result2 <- nnetrandom(presence ~ Elevation, data=faramea, size=2,
skip=FALSE, entropy=TRUE, trace=FALSE, maxit=1000, tries=50,
leave.one.out=TRUE)
result2$range
result2$CV
result2$successful
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.