protected Value<V> ensureValue(K key){ Value<V> value = get(key); if(value == null){ ValueFactory<V> valueFactory = getValueFactory(); value = valueFactory.newValue(); put(key, value); } return value; } }
@Override public Double getConfidence(String category){ ValueMap<String, V> confidences = getConfidences(); Value<V> confidence = (confidences != null ? confidences.get(category) : null); return Type.CONFIDENCE.getValue(confidence); }
public Report getValueReport(String key){ ValueMap<String, V> values = getValues(); Value<V> value = values.get(key); return ReportUtil.getReport(value); }
@Override public Report getConfidenceReport(String category){ ValueMap<String, V> confidences = getConfidences(); Value<V> confidence = (confidences != null ? confidences.get(category) : null); return ReportUtil.getReport(confidence); }
public Double getValue(String key){ Type type = getType(); ValueMap<String, V> values = getValues(); Value<V> value = values.get(key); return type.getValue(value); }
private Value<V> computeProbability(String category){ ValueMap<String, V> values = getValues(); if(this.sum == null){ throw new EvaluationException("Vote distribution result has not been computed"); } Value<V> probability = values.get(category); if(probability != null){ probability = probability.copy(); if(this.sum.equals(0d)){ throw new UndefinedResultException(); } probability.divide(this.sum); } return probability; } }
Value<V> value = values.get(id); if(value == null){ throw new InvalidAttributeException(neuralOutput, PMMLAttributes.NEURALOUTPUT_OUTPUTNEURON, id);
Value<V> value = values.get(id); if(value == null){ throw new InvalidAttributeException(neuralOutput, PMMLAttributes.NEURALOUTPUT_OUTPUTNEURON, id);
Value<V> input = result.get(id); if(input == null){ throw new InvalidAttributeException(connection, PMMLAttributes.CONNECTION_FROM, id);