code: public static RealVector parseRecord(Record r, Map<Object, Integer> featureIdsReference) {
          if(featureIdsReference.isEmpty()) {
              throw new IllegalArgumentException("The featureIdsReference map should not be empty.");
          }
          
          int d = featureIdsReference.size();
  
          //create an Map-backed vector only if we have available info about configuration.
          RealVector v = (storageEngine != null)?new MapRealVector(d):new OpenMapRealVector(d);
          
          boolean addConstantColumn = featureIdsReference.containsKey(Dataframe.COLUMN_NAME_CONSTANT);
          
  
          if(addConstantColumn) {
              v.setEntry(0, 1.0);  //add the constant column
          }
          for(Map.Entry<Object, Object> entry : r.getX().entrySet()) {
              Object feature = entry.getKey();
              Double value = TypeInference.toDouble(entry.getValue());
              if(value!=null) {
                  Integer featureId = featureIdsReference.get(feature);
                  if(featureId!=null) {//if the feature exists
                      v.setEntry(featureId, value);
                  }
              }
              else {
                  //else the X matrix maintains the 0.0 default value
              }
          }
          
          return v;
      }
docs: Parses a single Record and converts it to RealVector by using an already
  existing mapping between feature names and column ids.
  
  @param r
  @param featureIdsReference
  @return