code: @Override
      public Prediction _predictRecord(Record r) {
          ModelParameters modelParameters = knowledgeBase.getModelParameters();
          Map<Integer, Cluster> clusterMap = modelParameters.getClusterMap();
          
          AssociativeArray clusterDistances = new AssociativeArray();
          for(Map.Entry<Integer, Cluster> e : clusterMap.entrySet()) {
              Integer clusterId = e.getKey();
              Cluster c= e.getValue();
              double distance = calculateDistance(r, c.getCentroid());
              clusterDistances.put(clusterId, distance);
          }
  
          Descriptives.normalize(clusterDistances);
          
          return new Prediction(getSelectedClusterFromDistances(clusterDistances), clusterDistances);
      }
docs: {@inheritDoc}