/** * Generate a bunch of predictions ready for processing, by performing a * evaluation on a test set assuming the classifier is already trained. * * @param classifier the pre-trained Classifier to evaluate * @param test the test dataset * @exception Exception if an error occurs */ public ArrayList<Prediction> getTestPredictions(Classifier classifier, Instances test) throws Exception { ArrayList<Prediction> predictions = new ArrayList<Prediction>(); for (int i = 0; i < test.numInstances(); i++) { if (!test.instance(i).classIsMissing()) { predictions.add(getPrediction(classifier, test.instance(i))); } } return predictions; }
/** * Generate a bunch of predictions ready for processing, by performing a * evaluation on a test set assuming the classifier is already trained. * * @param classifier the pre-trained Classifier to evaluate * @param test the test dataset * @exception Exception if an error occurs */ public ArrayList<Prediction> getTestPredictions(Classifier classifier, Instances test) throws Exception { ArrayList<Prediction> predictions = new ArrayList<Prediction>(); for (int i = 0; i < test.numInstances(); i++) { if (!test.instance(i).classIsMissing()) { predictions.add(getPrediction(classifier, test.instance(i))); } } return predictions; }