code: @Override
      protected void _predict(Dataframe newData) {
          //read model params
          ModelParameters modelParameters = knowledgeBase.getModelParameters();
          
          Map<Object, Double> thitas = modelParameters.getThitas();
          Map<Object, Integer> featureIds = modelParameters.getFeatureIds();
  
          int d = thitas.size();
          
          RealVector coefficients = new OpenMapRealVector(d);
          for(Map.Entry<Object, Double> entry : thitas.entrySet()) {
              Integer featureId = featureIds.get(entry.getKey());
              coefficients.setEntry(featureId, entry.getValue());
          }
          
          Map<Integer, Integer> recordIdsReference = new HashMap<>(); //use a mapping between recordIds and rowIds in Matrix
          DataframeMatrix matrixDataset = DataframeMatrix.parseDataset(newData, recordIdsReference, featureIds);
          
          RealMatrix X = matrixDataset.getX();
          
          RealVector Y = X.operate(coefficients);
          for(Map.Entry<Integer, Record> e : newData.entries()) {
              Integer rId = e.getKey();
              Record r = e.getValue();
              int rowId = recordIdsReference.get(rId);
              newData._unsafe_set(rId, new Record(r.getX(), r.getY(), Y.getEntry(rowId), r.getYPredictedProbabilities()));
          }
          
          //recordIdsReference = null;
          //matrixDataset = null;
      }
docs: {@inheritDoc}