Evaluate after training using the reserved test set. The test samples must not have been used to fit the model or preprocessing parameters.
import deepnetts.eval.RegressionMetrics;
RegressionMetrics metrics =
(RegressionMetrics) neuralNet.test(testSet);
System.out.println(metrics);
System.out.println("MAE: " + metrics.getMeanAbsoluteError());
System.out.println("RMSE: " + metrics.getRootMeanSquaredError());
System.out.println("R2: " + metrics.getR2());
Interpret errors in the target's real unit and compare them with a simple baseline.
import deepnetts.eval.ClassificationMetrics;
ClassificationMetrics metrics =
(ClassificationMetrics) neuralNet.test(testSet);
System.out.println(metrics);
System.out.println("Accuracy: " + metrics.getAccuracy());
System.out.println("Precision: " + metrics.getPrecision());
System.out.println("Recall: " + metrics.getRecall());
System.out.println("F1: " + metrics.getF1Score());
Accuracy alone can hide poor behavior when classes are imbalanced. Inspect precision, recall, F1, and the confusion matrix according to the cost of false positives and false negatives.
trainingSet to testSet.Held-out samples estimate how the trained model behaves on data it did not see while learning.
Use error metrics for regression and inspect accuracy together with precision, recall, and F1 for classification when class mistakes have different costs.
Was this helpful?
Thank you!