nnetrandom {BiodiversityR}R Documentation

Calculate the NNET Result with the Smallest Value from Various Random Starts

Description

This function provides the best solution from various calls to the nnet feed-forward artificial neural networks function (nnet).

Usage

nnetrandom(formula,data,tries=10,leave.one.out=F,...)

Arguments

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.

Details

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.

Value

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.

Author(s)

Roeland Kindt (World Agroforestry Centre)

Examples

## 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)

[Package BiodiversityR version 2.16-1 Index]