Exemplo n.º 1
0
 /**
  * Transforms given binned index (short) from class column into a value from interval [0..N-1]
  * corresponding to a particular predictor class
  */
 public int unmapClass(int clazz) {
   Col c = _c[_c.length - 1];
   if (c._isByte) return clazz;
   else {
     // OK, this is not fully correct bad handle corner-cases like for example dataset uses classes
     // only
     // with 0 and 3. Our API reports that there are 4 classes but in fact there are only 2
     // classes.
     if (clazz >= c._binned2raw.length) clazz = c._binned2raw.length - 1;
     return (int) (c.raw(clazz) - c._min);
   }
 }