docs: @SuppressWarnings (
  		value = {"fallthrough"}
  	)
  	static
  	public Map<FieldName, ?> evaluate(Map<FieldName, ?> predictions, ModelEvaluationContext context){
  		ModelEvaluator<?> modelEvaluator = context.getModelEvaluator();
  
  		Model model = modelEvaluator.getModel();
  
  		Output output = model.getOutput();
  		if(output == null || !output.hasOutputFields()){
  			return predictions;
  		}
  
  		OutputMap result = new OutputMap(predictions);
  
  		List<OutputField> outputFields = output.getOutputFields();
  
  		Predicate<OutputField> outputFilter = modelEvaluator.ensureOutputFilter();
  
  		outputFields:
  		for(OutputField outputField : outputFields){
  			FieldName targetName = outputField.getTargetField();
  
  			Object targetValue = null;
  
  			ResultFeature resultFeature = outputField.getResultFeature();
  
  			String segmentId = outputField.getSegmentId();
  
  			SegmentResult segmentPredictions = null;
  
  			// Load the target value of the specified segment
  			if(segmentId != null){
  
  				if(!(model instanceof MiningModel)){
  					throw new InvalidAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_SEGMENTID, segmentId);
  				}
  
  				MiningModelEvaluationContext miningModelContext = (MiningModelEvaluationContext)context;
  
  				segmentPredictions = miningModelContext.getResult(segmentId);
  
  				// "If there is no Segment matching segmentId or if the predicate of the matching Segment evaluated to false, then the result delivered by this OutputField is missing"
  				if(segmentPredictions == null){
  					continue outputFields;
  				} // End if
  
  				if(targetName != null){
  
  					if(!segmentPredictions.containsKey(targetName)){
  						throw new MissingValueException(targetName, outputField);
  					}
  
  					targetValue = segmentPredictions.get(targetName);
  				} else
  
  				{
  					targetValue = segmentPredictions.getTargetValue();
  				}
  			} else
  
  			// Load the target value
  			{
  				switch(resultFeature){
  					case ENTITY_ID:
  						{
  							// "Result feature entityId returns the id of the winning segment"
  							if(model instanceof MiningModel){
  								targetValue = TypeUtil.cast(HasEntityId.class, predictions);
  
  								break;
  							}
  						}
  						// Falls through
  					default:
  						{
  							if(targetName == null){
  								targetName = modelEvaluator.getTargetName();
  							} // End if
  
  							if(!predictions.containsKey(targetName)){
  								throw new MissingValueException(targetName, outputField);
  							}
  
  							targetValue = predictions.get(targetName);
  						}
  						break;
  				}
  			}
  
  			// "If the target value is missing, then the result delivered by this OutputField is missing"
  			if(targetValue == null){
  				continue outputFields;
  			}
  
  			Object value;
  
  			// Perform the requested computation on the target value
  			switch(resultFeature){
  				case PREDICTED_VALUE:
  					{
  						value = getPredictedValue(targetValue);
  					}
  					break;
  				case PREDICTED_DISPLAY_VALUE:
  					{
  						if(segmentId != null){
  							throw new UnsupportedElementException(outputField);
  						}
  
  						TargetField targetField = modelEvaluator.findTargetField(targetName);
  						if(targetField == null){
  							throw new MissingFieldException(targetName, outputField);
  						}
  
  						value = getPredictedDisplayValue(targetValue, targetField);
  					}
  					break;
  				case TRANSFORMED_VALUE:
  				case DECISION:
  					{
  						if(segmentId != null){
  							Object name = outputField.getValue();
  							if(name == null){
  								throw new MissingAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_VALUE);
  							}
  
  							name = TypeUtil.format(name);
  
  							Expression expression = outputField.getExpression();
  							if(expression != null){
  								throw new MisplacedElementException(expression);
  							}
  
  							value = segmentPredictions.get(FieldName.create((String)name));
  
  							break;
  						}
  
  						value = FieldValueUtil.getValue(ExpressionUtil.evaluateExpressionContainer(outputField, context));
  					}
  					break;
  				case PROBABILITY:
  					{
  						value = getProbability(targetValue, outputField);
  					}
  					break;
  				case CONFIDENCE:
  					{
  						if(targetValue instanceof HasRuleValues){
  							value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.CONFIDENCE);
  
  							break;
  						}
  
  						value = getConfidence(targetValue, outputField);
  					}
  					break;
  				case RESIDUAL:
  					{
  						if(segmentId != null){
  							throw new UnsupportedElementException(outputField);
  						}
  
  						FieldValue expectedTargetValue = context.evaluate(targetName);
  						if(FieldValueUtil.isMissing(expectedTargetValue)){
  							throw new MissingValueException(targetName, outputField);
  						}
  
  						TargetField targetField = modelEvaluator.findTargetField(targetName);
  						if(targetField == null){
  							throw new MissingFieldException(targetName, outputField);
  						}
  
  						OpType opType = targetField.getOpType();
  						switch(opType){
  							case CONTINUOUS:
  								value = getContinuousResidual(targetValue, expectedTargetValue);
  								break;
  							case CATEGORICAL:
  							case ORDINAL:
  								value = getDiscreteResidual(targetValue, expectedTargetValue);
  								break;
  							default:
  								throw new InvalidElementException(outputField);
  						}
  					}
  					break;
  				case CLUSTER_ID:
  					{
  						value = getClusterId(targetValue);
  					}
  					break;
  				case ENTITY_ID:
  					{
  						if(targetValue instanceof HasRuleValues){
  							value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.RULE_ID);
  
  							break;
  						}
  
  						value = getEntityId(targetValue, outputField);
  					}
  					break;
  				case AFFINITY:
  					{
  						value = getAffinity(targetValue, outputField);
  					}
  					break;
  				case CLUSTER_AFFINITY:
  				case ENTITY_AFFINITY:
  					{
  						Object entityId = outputField.getValue();
  
  						// Select the specified entity instead of the winning entity
  						if(entityId != null){
  							value = getAffinity(targetValue, outputField);
  
  							break;
  						}
  
  						value = getEntityAffinity(targetValue);
  					}
  					break;
  				case REASON_CODE:
  					{
  						value = getReasonCode(targetValue, outputField);
  					}
  					break;
  				case RULE_VALUE:
  					{
  						value = getRuleValue(targetValue, outputField);
  					}
  					break;
  				case ANTECEDENT:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.ANTECEDENT);
  					}
  					break;
  				case CONSEQUENT:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.CONSEQUENT);
  					}
  					break;
  				case RULE:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.RULE);
  					}
  					break;
  				case RULE_ID:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.RULE_ID);
  					}
  					break;
  				case SUPPORT:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.SUPPORT);
  					}
  					break;
  				case LIFT:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.LIFT);
  					}
  					break;
  				case LEVERAGE:
  					{
  						value = getRuleValue(targetValue, outputField, OutputField.RuleFeature.LEVERAGE);
  					}
  					break;
  				case REPORT:
  					{
  						FieldName reportName = outputField.getReportField();
  						if(reportName == null){
  							throw new MissingAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_REPORTFIELD);
  						}
  
  						OutputField reportOutputField = modelEvaluator.getOutputField(reportName);
  						if(reportOutputField == null){
  							throw new MissingFieldException(reportName);
  						}
  
  						value = getReport(targetValue, reportOutputField);
  					}
  					break;
  				case WARNING:
  					{
  						value = context.getWarnings();
  					}
  					break;
  				default:
  					throw new UnsupportedAttributeException(outputField, resultFeature);
  			}
  
  			FieldName outputName = outputField.getName();
  			if(outputName == null){
  				throw new MissingAttributeException(outputField, PMMLAttributes.OUTPUTFIELD_NAME);
  			}
  
  			TypeInfo typeInfo = new TypeInfo(){
  
  				@Override
  				public DataType getDataType(){
  					DataType dataType = outputField.getDataType();
  					if(dataType == null){
  
  						if(value instanceof Collection){
  							Collection<?> values = (Collection<?>)value;
  
  							dataType = TypeUtil.getDataType(values);
  						} else
  
  						{
  							dataType = TypeUtil.getDataType(value);
  						}
  					}
  
  					return dataType;
  				}
  
  				@Override
  				public OpType getOpType(){
  					OpType opType = outputField.getOpType();
  					if(opType == null){
  						DataType dataType = getDataType();
  
  						opType = TypeUtil.getOpType(dataType);
  					}
  
  					return opType;
  				}
  
  				@Override
  				public List<?> getOrdering(){
  					List<?> ordering = FieldUtil.getValidValues(outputField);
  
  					return ordering;
  				}
  			};
  
  			FieldValue outputValue = FieldValueUtil.create(typeInfo, value);
  
  			// The result of one output field becomes available to other output fields
  			context.declare(outputName, outputValue);
  
  			if(outputFilter.test(outputField)){
  				result.putPublic(outputName, FieldValueUtil.getValue(outputValue));
  			} else
  
  			{
  				result.putPrivate(outputName, FieldValueUtil.getValue(outputValue));
  			}
  		}
  
  		return result;
  	}