/** * Adds a value to the observed values<p> * * It's equivalent to <code>add(value, 1)</code><p> * * @param value the observed value */ public void add(double value) { add(value, 1); }
/** * Adds a value to the observed values<p> * * It's equivalent to <code>add(value, 1)</code><p> * * @param value the observed value */ public void add(double value) { add(value, 1); }
private void addWeightedStats(Stats stats, double... values) { assert values.length % 2 == 0; for (int i = 0; i < values.length; i += 2) { stats.add(values[i], values[i + 1]); } }
private void addWeightedStats(Stats stats, double... values) { assert values.length % 2 == 0; for (int i = 0; i < values.length; i += 2) { stats.add(values[i], values[i + 1]); } }
/** * Updates the counters for one more observed distinct value. * * @param value the value that has just been seen * @param count the number of times the value appeared * @param weight the weight mass of the value */ protected void addDistinct(double value, int count, double weight) { if (count > 0) { if (count == 1) { uniqueCount++; } if (value == (int)value) { intCount += count; } else { realCount += count; } if (nominalCounts != null) { nominalCounts[(int) value] = count; nominalWeights[(int) value] = weight; } if (numericStats != null) { //numericStats.add(value, count); numericStats.add(value, weight); numericStats.calculateDerived(); } } distinctCount++; }
private void addWeightedStats(Stats stats, long... values) { assert values.length%2 == 0; for (int i = 0; i < values.length; i += 2) { stats.add(Double.longBitsToDouble(values[i]), Double.longBitsToDouble(values[i + 1]) ); } }
/** * Updates the counters for one more observed distinct value. * * @param value the value that has just been seen * @param count the number of times the value appeared * @param weight the weight mass of the value */ protected void addDistinct(double value, int count, double weight) { if (count > 0) { if (count == 1) { uniqueCount++; } if (value == (int)value) { intCount += count; } else { realCount += count; } if (nominalCounts != null) { nominalCounts[(int) value] = count; nominalWeights[(int) value] = weight; } if (numericStats != null) { //numericStats.add(value, count); numericStats.add(value, weight); numericStats.calculateDerived(); } } distinctCount++; }
private void addWeightedStats(Stats stats, long... values) { assert values.length%2 == 0; for (int i = 0; i < values.length; i += 2) { stats.add(Double.longBitsToDouble(values[i]), Double.longBitsToDouble(values[i + 1]) ); } }
public void addDistinct(double value, int count) { if (count > 0) { if (count == 1) { uniqueCount++; } if (Utils.eq(value, (double)((int)value))) { intCount += count; } else { realCount += count; } if (nominalCounts != null) { nominalCounts[(int)value] = count; } if (numericStats != null) { numericStats.add(value, count); numericStats.calculateDerived(); } } distinctCount++; }
add(value, -weight); return;
/** * Unweighted macro-averaged F-measure. If some classes not present in the * test set, they're just skipped (since recall is undefined there anyway) . * * @return unweighted macro-averaged F-measure. * */ public double unweightedMacroFmeasure() { weka.experiment.Stats rr = new weka.experiment.Stats(); for (int c = 0; c < m_NumClasses; c++) { // skip if no testing positive cases of this class if (numTruePositives(c) + numFalseNegatives(c) > 0) { rr.add(fMeasure(c)); } } rr.calculateDerived(); return rr.mean; }
/** * Unweighted macro-averaged F-measure. If some classes not present in the * test set, they're just skipped (since recall is undefined there anyway) . * * @return unweighted macro-averaged F-measure. * */ public double unweightedMacroFmeasure() { weka.experiment.Stats rr = new weka.experiment.Stats(); for (int c = 0; c < m_NumClasses; c++) { // skip if no testing positive cases of this class if (numTruePositives(c) + numFalseNegatives(c) > 0) { rr.add(fMeasure(c)); } } rr.calculateDerived(); return rr.mean; }
&& (!instance.isMissing(i))) { m_attStats[i].add(instance.value(i), instance.weight());
stats.add(values[i], values[i + 1]); } else { break;
stats.add(values[i], values[i + 1]); } else { break;