public NearestNeighborModelEvaluator(PMML pmml, NearestNeighborModel nearestNeighborModel){
super(pmml, nearestNeighborModel);
ComparisonMeasure comparisoonMeasure = nearestNeighborModel.getComparisonMeasure();
if(comparisoonMeasure == null){
throw new MissingElementException(nearestNeighborModel, PMMLElements.NEARESTNEIGHBORMODEL_COMPARISONMEASURE);
}
TrainingInstances trainingInstances = nearestNeighborModel.getTrainingInstances();
if(trainingInstances == null){
throw new MissingElementException(nearestNeighborModel, PMMLElements.NEARESTNEIGHBORMODEL_TRAININGINSTANCES);
}
InstanceFields instanceFields = trainingInstances.getInstanceFields();
if(instanceFields == null){
throw new MissingElementException(trainingInstances, PMMLElements.TRAININGINSTANCES_INSTANCEFIELDS);
}
if(!instanceFields.hasInstanceFields()){
throw new MissingElementException(instanceFields, PMMLElements.INSTANCEFIELDS_INSTANCEFIELDS);
}
KNNInputs knnInputs = nearestNeighborModel.getKNNInputs();
if(knnInputs == null){
throw new MissingElementException(nearestNeighborModel, PMMLElements.NEARESTNEIGHBORMODEL_KNNINPUTS);
}
if(!knnInputs.hasKNNInputs()){
throw new MissingElementException(knnInputs, PMMLElements.KNNINPUTS_KNNINPUTS);
}
}