At training time and before deploying a MNN, it is important to know the accuracy of the model and understand its performance. In the previous chapter, we learned that at the end of a training phase, the model can be saved in a ZIP archive. From there, it is possible to run it and test it implementing a custom UI, like that shown in Figure 8.1 (it has been implemented using the JavaFX features; the example code is part of the source code that's bundled with this book). But more significant strategies can be utilized to perform an evaluation. DL4J provides an API that can be used to evaluate the performance of both binary and multi-class classifiers.
This first section and its subsections cover all the details of doing evaluation for classification (DL4J and Spark), while the next section provides an overview of other evaluation strategies that...