private static int[] getFeaturesFromLabels (Label[] labels) { int[] features = new int[labels.length]; for (int i = 0; i < labels.length; i++) features[i] = labels[i].getIndex(); return features; }
private static int[] getFeaturesFromLabels (Label[] labels) { int[] features = new int[labels.length]; for (int i = 0; i < labels.length; i++) features[i] = labels[i].getIndex(); return features; }
private static int[] indicesForLabels (Label[] labels) { int[] indices = new int[labels.length]; for (int i = 0; i < labels.length; i++) indices[i] = labels[i].getIndex(); return indices; }
/** * Gets the raw counts for a specified label. * * @param label Label to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label */ public int[][] getCounts(Label label) { return this.counts[label.getIndex()]; }
/** * Gets the raw counts for a specified label. * * @param label Label to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label */ public int[][] getCounts(Label label) { return this.counts[label.getIndex()]; }
private static int[] indicesForLabels (Label[] labels) { int[] indices = new int[labels.length]; for (int i = 0; i < labels.length; i++) indices[i] = labels[i].getIndex(); return indices; }
private static int[] getFeaturesFromLabels (Label[] labels) { int[] features = new int[labels.length]; for (int i = 0; i < labels.length; i++) features[i] = labels[i].getIndex(); return features; }
private static int[] indicesForLabels (Label[] labels) { int[] indices = new int[labels.length]; for (int i = 0; i < labels.length; i++) indices[i] = labels[i].getIndex(); return indices; }
/** * Gets the raw counts for a specified label. * * @param label Label to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label */ public int[][] getCounts(Label label) { return this.counts[label.getIndex()]; }
/** * Gets the raw counts for a specified label and threshold. * * If data was not collected for the exact threshold specified, then results * for the highest threshold <= the specified threshold will be returned. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label and threshold */ public int[] getCounts(Label label, double threshold) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } return this.counts[label.getIndex()][index]; }
/** * Gets the raw counts for a specified label and threshold. * * If data was not collected for the exact threshold specified, then results * for the highest threshold <= the specified threshold will be returned. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label and threshold */ public int[] getCounts(Label label, double threshold) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } return this.counts[label.getIndex()][index]; }
/** * Gets the raw counts for a specified label and threshold. * * If data was not collected for the exact threshold specified, then results * for the highest threshold <= the specified threshold will be returned. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE * @return Array of raw counts for specified label and threshold */ public int[] getCounts(Label label, double threshold) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } return this.counts[label.getIndex()][index]; }
final int[][] buckets = this.counts[label.getIndex()];
final int[][] buckets = this.counts[label.getIndex()];
/** * Sets the raw counts for a specified label and threshold. * * If data is not collected for the exact threshold specified, then counts * for the highest threshold <= the specified threshold will be set. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @param newCounts New count values for the label and threshold * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE */ public void setCounts(Label label, double threshold, int[] newCounts) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } final int[] oldCounts = this.counts[label.getIndex()][index]; if (newCounts.length != oldCounts.length) { throw new IllegalArgumentException ("Array of counts must contain " + oldCounts.length + " elements."); } for (int i = 0; i < oldCounts.length; i++) { oldCounts[i] = newCounts[i]; } }
/** * Sets the raw counts for a specified label and threshold. * * If data is not collected for the exact threshold specified, then counts * for the highest threshold <= the specified threshold will be set. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @param newCounts New count values for the label and threshold * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE */ public void setCounts(Label label, double threshold, int[] newCounts) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } final int[] oldCounts = this.counts[label.getIndex()][index]; if (newCounts.length != oldCounts.length) { throw new IllegalArgumentException ("Array of counts must contain " + oldCounts.length + " elements."); } for (int i = 0; i < oldCounts.length; i++) { oldCounts[i] = newCounts[i]; } }
/** * Sets the raw counts for a specified label and threshold. * * If data is not collected for the exact threshold specified, then counts * for the highest threshold <= the specified threshold will be set. * * @param label Label to get counts for * @param threshold Threshold to get counts for * @param newCounts New count values for the label and threshold * @see #TRUE_POSITIVE * @see #FALSE_POSITIVE * @see #FALSE_NEGATIVE * @see #TRUE_NEGATIVE */ public void setCounts(Label label, double threshold, int[] newCounts) { int index = Arrays.binarySearch(this.thresholds, threshold); if (index < 0) { index = (-index) - 2; } final int[] oldCounts = this.counts[label.getIndex()][index]; if (newCounts.length != oldCounts.length) { throw new IllegalArgumentException ("Array of counts must contain " + oldCounts.length + " elements."); } for (int i = 0; i < oldCounts.length; i++) { oldCounts[i] = newCounts[i]; } }
private int[] toValueArray () { TIntArrayList vals = new TIntArrayList (maxTime () * numSlices ()); for (int t = 0; t < lblseq.size (); t++) { Labels lbls = lblseq.getLabels (t); for (int j = 0; j < lbls.size (); j++) { Label lbl = lbls.get (j); vals.add (lbl.getIndex ()); } } return vals.toNativeArray (); }
private int[] toValueArray () { TIntArrayList vals = new TIntArrayList (maxTime () * numSlices ()); for (int t = 0; t < lblseq.size (); t++) { Labels lbls = lblseq.getLabels (t); for (int j = 0; j < lbls.size (); j++) { Label lbl = lbls.get (j); vals.add (lbl.getIndex ()); } } return vals.toNativeArray (); }
private int[] toValueArray () { TIntArrayList vals = new TIntArrayList (maxTime () * numSlices ()); for (int t = 0; t < lblseq.size (); t++) { Labels lbls = lblseq.getLabels (t); for (int j = 0; j < lbls.size (); j++) { Label lbl = lbls.get (j); vals.add (lbl.getIndex ()); } } return vals.toNativeArray (); }