Similar to other classification methods, we can predict the labels of new observations based on trained neural networks. Furthermore, we can validate the performance of these networks through the use of a confusion matrix. In the following recipe, we will introduce how to use the compute
function in a neural network to obtain a probability matrix of the testing dataset labels, and use a table and confusion matrix to measure the prediction performance.
To complete this recipe, you need to have completed the previous recipe by generating the training dataset, trainset
, and the testing dataset, testset
. The trained neural network needs to be saved in the network.