Forms predictions from a multi-layer perceptron neural network fitted by NNFIT.
Option
PRINT = string tokens |
Controls fitted output (description, predictions); default desc, pred |
|---|
Parameters
X = pointers |
Input variates |
|---|---|
PREDICTIONS = variates |
Predictions |
SAVE = pointers |
Details of the network |
Description
NNPREDICT forms predictions using a neural network fitted by NNFIT. The type of neural network fitted by NNFIT is a fully-connected feed-forward multi-layer perceptron with a single hidden layer. This network starts with a row of nodes, one for each input variable (i.e. x-variate), which are all connected to every node in the hidden layer. The nodes in the hidden layer are then all connected to the output node in the final, output layer.
Details of the fit and the structure of the neural network must be supplied using the SAVE parameter. This must have been saved using the SAVE parameter of NNFIT. If this is not set, the output is from the most recent network fitted by NNFIT. The values of the input variates to be used to calculate the predictions are supplied, in a pointer, using the X parameter. The variates in the pointer must be in exactly the same order as the equivalent variates in the pointer defined for the X parameter in the original NNFIT command.
The output is controlled by the PRINT option, with settings:
description |
a description of the network (number of input variables, nodes etc.), |
|---|---|
predictions |
predicted values. |
Option: PRINT.
Parameters: X, PREDICTIONS, SAVE.
Method
NNPREDICT uses the function nagdmc_predict_mlp from the Numerical Algorithms Group’s library of Data Mining Components (DMCs).
See also
Commands for: Data mining.
Example
" Example NNPR-1: Forms predictions from a multi-layer perceptron neural
network fitted by NNFIT."
" This example predicts the values at the means of the data, after using
NNFIT to fit a multi-layer perceptron neural network with five hidden layers,
a hyperbolic activation function in the hidden layer and a linear activation
function in the output layer."
" The data are in a file called iris.GSH and contain the data from Fisher's
Iris data set."
SPLOAD [PRINT=*] '%GENDIR%/Data/iris.GSH'
POINTER [VALUES=Sepal_Length,Sepal_Width,Petal_Length,Petal_Width] Measures
CALC yval = NEWLEVELS(Species)
NNFIT [PRINT=description,estimates,summary; NHIDDEN=5;\
HIDDENMETHOD=hyperbolictangent; OUTPUTMETHOD=linear; SEED=12]\
Y=yval; X=Measures
VARI [NVAL=1] vmeasures[1...4]
CALC vmeasures[]$[1] = MEAN(Measures[])
NNPREDICT [PRINT = desc, pred] X=vmeasures; PRED=p1