code: @Override
      protected void _predict(Dataframe newData) {
          Map<List<Object>, Double> similarities = knowledgeBase.getModelParameters().getSimilarities();
          
          //generate recommendation for each record in the list
          for(Map.Entry<Integer, Record> e : newData.entries()) {
              Integer rId = e.getKey();
              Record r = e.getValue();
              Map<Object, Double> recommendations = new HashMap<>();
              
              Map<Object, Double> simSums = new HashMap<>();
              for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
                  Object row = entry.getKey();
                  Double score = TypeInference.toDouble(entry.getValue());
                  
                  for(Map.Entry<List<Object>, Double> entry2 : similarities.entrySet()) {
                      List<Object> tpk = entry2.getKey();
                      if(!tpk.get(0).equals(row)) {
                          continue; //filter the irrelevant two pair key combinations that do not include the row
                      }
                      
                      Object column = tpk.get(1);
                      
                      Double previousRecValue = recommendations.getOrDefault(column, 0.0);
                      Double previousSimsumValue = simSums.getOrDefault(column, 0.0);
                      
                      Double similarity = entry2.getValue();
  
                      recommendations.put(column, previousRecValue+similarity*score);
                      simSums.put(column, previousSimsumValue+similarity);
                  }
              }
              
              for(Map.Entry<Object, Double> entry : recommendations.entrySet()) {
                  Object column = entry.getKey();
                  Double score = entry.getValue();
                  
                  recommendations.put(column, score/simSums.get(column));
              }
              //simSums = null;
              
              recommendations = MapMethods.sortNumberMapByValueDescending(recommendations);
              newData._unsafe_set(rId, new Record(r.getX(), r.getY(), recommendations.keySet().iterator().next(), new AssociativeArray((Map)recommendations)));
          }
      }
docs: {@inheritDoc}