/** * Returns the standard deviation of a numeric attribute * * @param attIndex the index of the attribute * @return the standard deviation * @throws Exception if an error occurs */ protected double getStandardDev(int attIndex) { //throws Exception { // if (!m_clusterInstances.attribute(attIndex).isNumeric()) { //throw new Exception("getStandardDev: attribute is not numeric"); // } m_attStats[attIndex].numericStats.calculateDerived(); double stdDev = m_attStats[attIndex].numericStats.stdDev; if (Double.isNaN(stdDev) || Double.isInfinite(stdDev)) { return m_acuity; } return Math.max(m_acuity, stdDev); }
xStats.calculateDerived(); yStats.calculateDerived(); differencesStats.calculateDerived();
xStats.calculateDerived(); yStats.calculateDerived(); differencesStats.calculateDerived();
/** * Returns the standard deviation of a numeric attribute * * @param attIndex the index of the attribute * @return the standard deviation * @throws Exception if an error occurs */ protected double getStandardDev(int attIndex) throws Exception { if (!m_clusterInstances.attribute(attIndex).isNumeric()) { throw new Exception("getStandardDev: attribute is not numeric"); } m_attStats[attIndex].numericStats.calculateDerived(); double stdDev = m_attStats[attIndex].numericStats.stdDev; if (Double.isNaN(stdDev) || Double.isInfinite(stdDev)) { return m_acuity; } return Math.max(m_acuity, stdDev); }
/** * 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++; }
/** * Returns the standard deviation of a numeric attribute * * @param attIndex the index of the attribute * @return the standard deviation * @throws Exception if an error occurs */ protected double getStandardDev(int attIndex) throws Exception { if (!m_clusterInstances.attribute(attIndex).isNumeric()) { throw new Exception("getStandardDev: attribute is not numeric"); } m_attStats[attIndex].numericStats.calculateDerived(); double stdDev = m_attStats[attIndex].numericStats.stdDev; if (Double.isNaN(stdDev) || Double.isInfinite(stdDev)) { return m_acuity; } return Math.max(m_acuity, stdDev); }
xStats.calculateDerived(); yStats.calculateDerived(); differencesStats.calculateDerived();
xStats.calculateDerived(); yStats.calculateDerived(); differencesStats.calculateDerived();
/** * 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++; }
ps.calculateDerived(); System.err.println(ps); } catch (Exception ex) {
ps.calculateDerived(); System.err.println(ps); } catch (Exception ex) {
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++; }
/** * 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; }
stats.calculateDerived(); subtracted1.calculateDerived(); subtracted2.calculateDerived();
stats.calculateDerived(); subtracted1.calculateDerived(); subtracted2.calculateDerived();
subtractWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); addWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); subtractWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); subtractWeightedStats(test, weightedValues1); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0);
subtractWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); addWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); subtractWeightedStats(test, negativeWeights); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0); subtractWeightedStats(test, weightedValues1); reference.calculateDerived(); test.calculateDerived(); checkStats(test, descr, reference, 0.0);
&& input.classIndex() != i) { m_attStats[i].calculateDerived();
&& input.classIndex() != i) { m_attStats[i].calculateDerived();