train.ann {quarrint} | R Documentation |
Training an Artificial Neural Network for Interaction Prediction.
Description
The function trains a neural network to be used with the functions
compute.interaction
and
compute.ann
. The neural network can then
be used to predict whether the level of interaction between a quarry and the
groundwater is low, medium, high or very high.
The user can specify:
the explanatory variables to be used;
the data frame used to train and validate the network;
the structure of the hidden layers;
the number of repetitions for the neural network training.
Usage
train.ann(var = c("H", "Z", "G", "C", "T", "L"), data = quarrint::quarries,
hidden = 7, rep = 1, ...)
Arguments
var |
The explanatory variable to be used. By default, all the variables in the
default data frame are used. Note that the variables must be categorical
(coded with integers) and will be transformed in dummy variables. For
instance if |
data |
The training and validation dataframe. It must contain the
variables listed in |
A vector of integer detailing the structure of the hidden layers. For instance if we want 2 hidden layers with 4 and 2 nodes respectively, then it must be it to (2, 4). The default is 7, i.e. 1 hidden layer of 7 nodes. | |
rep |
The number of repetition of the neural network to be computed. |
... |
Further arguments passed to or from other methods. See the documentation of "neuralnet" from the package "neuralnet". |
Value
A list whose elements are:
ann |
A |
prop.correct.prediction |
A list detailing for each repetition of the neural network the proportion of correct predictions. |
Author(s)
Johan Barthelemy.
Maintainer: Johan Barthelemy johan@uow.edu.au.
References
Barthelemy, J., Carletti, T., Collier L., Hallet, V., Moriame, M., Sartenaer, A. (2016) Interaction prediction between groundwater and quarry extension using discrete choice models and artificial neural networks Environmental Earth Sciences (in press)
Collier, L., Barthelemy, J., Carletti, T., Moriame, M., Sartenaer, A., Hallet, V. (2015) Calculation of an Interaction Index between the Extractive Activity and Groundwater Resources Energy Procedia 76, 412-420
Krieselm, D. (2007) A Brief Introduction to Neural Networks. On-line available at http://www.dkriesel.com
Ripley, B. (1996) Pattern recognition and neural networks Cambridge university press
See Also
The function relies on the function neuralnet
of the neuralnet package to generate an object of type nn
containing the trained neural network.
compute.interaction
and
compute.ann
to use the trained neural
network.
The data frame quarries
.
Examples
## Not run:
# training a neural network using the attribues H and T as predictors,
# with 2 hidden layers of 2 nodes each and computing 2 replications
r.ann <- train.ann(var = c("H", "T", "L", "Z"), hidden = c(2, 2), rep = 2)
# using the ann to compute the interaction
q <- quarry(geological.context = 2, hydrogeological.context = 4,
piezometric.context = 1, quarry.position = 4,
production.catchment = 4, quality.catchment = 3)
compute.interaction(q, method="ann", ann = r.ann$ann)
## End(Not run)