static public <K, V extends Number> ValueMap<K, V> computeBinomialProbabilities(RegressionModel.NormalizationMethod normalizationMethod, ValueMap<K, V> values){ if(values.size() != 2){ throw new IllegalArgumentException(); } Iterator<Value<V>> valueIt = values.iterator(); Value<V> firstValue = valueIt.next(); // The probability of the first category is calculated normalizeBinaryLogisticClassificationResult(normalizationMethod, firstValue); Value<V> secondValue = valueIt.next(); // The probability of the second category is obtained by subtracting the probability of the first category from 1.0 secondValue.residual(firstValue); return values; }
Iterator<Value<V>> valueIt = values.iterator(); for(int i = 0, max = values.size() - 1; i < max; i++){ Value<V> value = valueIt.next();
Iterator<Value<V>> valueIt = values.iterator(); for(int i = 0, max = values.size() - 1; i < max; i++){ Value<V> value = valueIt.next();