/** * Pulls all the margin values out of a vector of NominalPredictions. * * @param predictions a FastVector containing NominalPredictions * @return an array of margin values. */ private double[] getMargins(ArrayList<Prediction> predictions) { // sort by predicted probability of the desired class. double[] margins = new double[predictions.size()]; for (int i = 0; i < margins.length; i++) { NominalPrediction pred = (NominalPrediction) predictions.get(i); margins[i] = pred.margin(); } return margins; }
/** * Pulls all the margin values out of a vector of NominalPredictions. * * @param predictions a FastVector containing NominalPredictions * @return an array of margin values. */ private double[] getMargins(ArrayList<Prediction> predictions) { // sort by predicted probability of the desired class. double[] margins = new double[predictions.size()]; for (int i = 0; i < margins.length; i++) { NominalPrediction pred = (NominalPrediction) predictions.get(i); margins[i] = pred.margin(); } return margins; }