/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(int v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(long v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char */ public void addValue(char v) throws MathIllegalArgumentException { addValue(Character.valueOf(v)); }
/** * Private helper method. * Assumes parameters have been validated. * @param values input data * @param begin index (0-based) of the first array element to include * @param length the number of elements to include * @return array of array of the most frequently occurring element(s) sorted in ascending order. */ private static double[] getMode(double[] values, final int begin, final int length) { // Add the values to the frequency table Frequency freq = new Frequency(); for (int i = begin; i < begin + length; i++) { final double value = values[i]; if (!Double.isNaN(value)) { freq.addValue(Double.valueOf(value)); } } List<Comparable<?>> list = freq.getMode(); // Convert the list to an array of primitive double double[] modes = new double[list.size()]; int i = 0; for(Comparable<?> c : list) { modes[i++] = ((Double) c).doubleValue(); } return modes; }
@Override public void informJobUnassigned(Job unassigned, Collection<String> failedConstraintNames) { if (!this.failedConstraintNamesFrequencyMapping.containsKey(unassigned.getId())) { this.failedConstraintNamesFrequencyMapping.put(unassigned.getId(), new Frequency()); } for (String r : failedConstraintNames) { if (failedConstraintNamesToBeIgnored.contains(r)) continue; this.failedConstraintNamesFrequencyMapping.get(unassigned.getId()).addValue(r); } }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(long v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char */ public void addValue(char v) throws MathIllegalArgumentException { addValue(Character.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(int v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(long v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Long */ public void addValue(int v) throws MathIllegalArgumentException { addValue(Long.valueOf(v)); }
/** * Adds 1 to the frequency count for v. * * @param v the value to add. * @throws MathIllegalArgumentException if the table contains entries not * comparable to Char */ public void addValue(char v) throws MathIllegalArgumentException { addValue(Character.valueOf(v)); }
public void addValue(Integer score){ if(score>=min && score<=max){ freqTable.addValue(score.intValue()); } }
public void addValue(Comparable<?> rowValue, Comparable<?> colValue){ Frequency ft=tableRows.get(rowValue); if(ft==null){ ft=new Frequency(); ft.addValue(colValue); tableRows.put(rowValue,ft); }else{ ft.addValue(colValue); } rowMargin.addValue(rowValue); //addValue row margins colMargin.addValue(colValue); //addValue column margins totalCount++; }
/** * All doubles are converted to integers see page 44, Kolen and Brennan(2004). * * @param score a test score. */ public void addValue(Double score){ int iScore = Double.valueOf(Math.floor(score+0.5)).intValue(); if(iScore>=min && iScore<=max){ freqTable.addValue(iScore); } }
public void count(Object rowValue, Double itemScore){ if(rowValue!=null && rowValue.equals(this.rowValue)){ columns.addValue(itemScore); mean.increment(itemScore); rowTotal++; } }
@Override public void informJobUnassigned(Job unassigned, Collection<String> failedConstraintNames) { if (!this.reasons.containsKey(unassigned.getId())) { this.reasons.put(unassigned.getId(), new Frequency()); } for (String r : failedConstraintNames) { if (constraintsToBeIgnored.contains(r)) continue; this.reasons.get(unassigned.getId()).addValue(r); } }
public void increment(double x, int y){ r.increment(x, (double)y); sdX.increment(x); sdY.increment(y); freqY.addValue(y); }
public ReflexValue frequency(List<ReflexValue> params) { if (params.size() != 1) { throw new ReflexException(-1, "frequency needs one list parameter"); } if (!params.get(0).isList()) { throw new ReflexException(-1, "frequency needs one list parameter"); } Frequency f = new Frequency(); List<ReflexValue> values = params.get(0).asList(); for (ReflexValue v : values) { f.addValue(v.asDouble()); } return new ReflexValue(f); }
public void increment(Object groupValue, Double itemScoreValue){ focalRow.count(groupValue, itemScoreValue); referenceRow.count(groupValue, itemScoreValue); if(focalRow.validCode(groupValue) || referenceRow.validCode(groupValue)){ columnMargin.addValue(itemScoreValue); } }