| nnetrandom {BiodiversityR} | R Documentation |
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,...)
formula |
Formula as passed to nnet. |
data |
Data as passed to nnet. |
tries |
Number of calls to nnet to obtain the best solution. |
leave.one.out |
Calculate leave-one-out predictions. |
... |
Other arguments passed to nnet. |
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)
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