1

I am trying to use DL4J for deep learning and have provided the training data with the labels. I am then trying to send a test data by assigning a dummy label. Without providing a dummy label, it gives runtime error. I dont understand why we need to assign label to test data.
Additionally, I want to know what is the accuracy of the prediction made. From what I saw in the dl4j docs, there is something known as a confusion matrix which is generated. I understand that this just gives us an idea of how well the training data has trained the system. Is there a way to get the accuracy of prediction on test data? Since we are giving a dummy label for the test data, I feel that the confusion matrix is also not generated correctly.

Supriya
  • 91
  • 2
  • 13

2 Answers2

1

First, how can you test if the network outputs the correct labels if you don't know what the correct labels are? You should always have a labels when training and testing because that way you can assert if the output is correct.

Second question, I've found this on dl4j webpage:

Evaluation eval = new Evaluation(3);
INDArray output = model.output(testData.getFeatures());
eval.eval(testData.getLabels(), output);
log.info(eval.stats());

There is stated that this .stats() method displays the confusion matrix entries (one per line), Accuracy, Precision, Recall and F1 Score. Additionally the Evaluation Class can also calculate and return the following values:

Confusion Matrix
False Positive/Negative Rate
True Positive/Negative
Class Counts
F-beta, G-measure, Matthews Correlation Coefficient and more

I hope this helps you.

Novak
  • 2,143
  • 1
  • 12
  • 22
  • Thanks Novak for the quick answer... I am still not clear on why should we provide label with test data? For training data, it is understandable to provide labels. But for test data, the classifier should predict the label - isnt it? – Supriya Oct 16 '18 at 12:39
  • The classifier predicts the label in the training also. In the training you tell classifier to predict the label and then you compare the predicted label with the real (correct) one. Also, in training you perform backpropagation. The test phase is there to asses how well is your model trained and how well it performs. It also needs to have labels to be able to do that. But in the test phase, you don't perform backpropagation, because in that phase, model is not learning anymore, you just want to see how well it performs. I hope it's clearer now. – Novak Oct 19 '18 at 12:41
0

You may find people who can respond to your question in the DL4J dev community here: https://gitter.im/deeplearning4j/deeplearning4j/tuninghelp

racknuf
  • 444
  • 3
  • 12