Exemplo n.º 1
0
 public final int getCategoricalIdFromInteraction(int cid, int val) {
   InteractionWrappedVec v;
   if ((v = (InteractionWrappedVec) _adaptedFrame.vec(cid)).isCategorical())
     return getCategoricalId(cid, val);
   assert v.domains() != null
       : "No domain levels found for interactions! cid: " + cid + " val: " + val;
   if (val >= _numOffsets[cid + 1]) { // previously unseen interaction (aka new domain level)
     assert _valid
         : "interaction value out of bounds, got "
             + val
             + ", next cat starts at "
             + _numOffsets[cid + 1];
     val = v.mode();
   }
   return val < 0 ? -1 : val + _numOffsets[cid];
 }