water.fvec.Frame.numCols()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中water.fvec.Frame.numCols()方法的一些代码示例,展示了Frame.numCols()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.numCols()方法的具体详情如下:
包路径:water.fvec.Frame
类名称:Frame
方法名:numCols

Frame.numCols介绍

暂无

代码示例

代码示例来源:origin: h2oai/h2o-3

public ForwardSolveInPlace(DataInfo ainfo, double[][] L) {
 assert L != null && L.length == L[0].length && L.length == ainfo._adaptedFrame.numCols();
 _ainfo = ainfo;
 _ncols = ainfo._adaptedFrame.numCols();
 _L = L;
}

代码示例来源:origin: h2oai/h2o-3

public SMulTask(DataInfo ainfo, int ncolQ, int ncolExp) {
 _ainfo = ainfo;
 _ncolA = ainfo._adaptedFrame.numCols();
 _ncolExp = ncolExp;   // when call from GLRM or PCA
 _ncolQ = ncolQ;
}

代码示例来源:origin: h2oai/h2o-3

public ForwardSolve(DataInfo ainfo, double[][] L) {
 assert L != null && L.length == L[0].length && L.length == ainfo._adaptedFrame.numCols();
 _ainfo = ainfo;
 _ncols = ainfo._adaptedFrame.numCols();
 _L = L;
 _sse = 0;
}

代码示例来源:origin: h2oai/h2o-3

public BMulInPlaceTask(DataInfo xinfo, double[][] yt, int nColsExp) {
 assert yt != null && yt[0].length == nColsExp;
 _xinfo = xinfo;
 _ncolX = xinfo._adaptedFrame.numCols();
 _yt = yt;
}

代码示例来源:origin: h2oai/h2o-3

public FrameMetadata(UserFeedback userFeedback, Frame fr, int response, String datasetName) {
 _datasetName=datasetName;
 _fr=fr;
 _response=response;
 _cols = new ColMeta[_fr.numCols()];
 _userFeedback = userFeedback;
}

代码示例来源:origin: h2oai/h2o-3

private Chunk[] getScoringChunks(Chunk[] allChunks) {
 if (_preds == null)
  return allChunks;
 Chunk[] chks = new Chunk[allChunks.length - _preds.numCols()];
 System.arraycopy(allChunks, 0, chks, 0, chks.length);
 return chks;
}

代码示例来源:origin: h2oai/h2o-3

public BMulInPlaceTask(DataInfo xinfo, double[][] yt) {
 assert yt != null && yt[0].length == numColsExp(xinfo._adaptedFrame,true);
 _xinfo = xinfo;
 _ncolX = xinfo._adaptedFrame.numCols();
 _yt = yt;
}

代码示例来源:origin: h2oai/h2o-3

@Override
 int prep(Frame fr) {
  return fr.numCols() - 1;
 }
},

代码示例来源:origin: h2oai/h2o-3

@Override
 int prep(Frame fr) {
  return fr.numCols() - 1;
 }
},

代码示例来源:origin: h2oai/h2o-3

public SMulTask(DataInfo ainfo, int ncolQ) {
 _ainfo = ainfo;
 _ncolA = ainfo._adaptedFrame.numCols();
 _ncolExp = numColsExp(ainfo._adaptedFrame,true);
 _ncolQ = ncolQ;
}

代码示例来源:origin: h2oai/h2o-3

@Override
 int prep(Frame fr) {
  return fr.numCols() - 1;
 }
},

代码示例来源:origin: h2oai/h2o-3

public static double[][] expandCats(double[][] sdata, DataInfo dinfo) {
 if (sdata == null || dinfo._cats == 0) return sdata;
 assert sdata[0].length == dinfo._adaptedFrame.numCols();
 // Column count for expanded matrix
 int catsexp = dinfo._catOffsets[dinfo._catOffsets.length-1];
 double[][] cexp = new double[sdata.length][catsexp + dinfo._nums];
 for (int i = 0; i < sdata.length; i++)
  LinearAlgebraUtils.expandRow(sdata[i], dinfo, cexp[i], false);
 return cexp;
}

代码示例来源:origin: h2oai/h2o-3

@Override
 int prep(Frame fr) {
  return fr.numCols() - 1;
 }
},

代码示例来源:origin: h2oai/h2o-3

private void convertToModel(Frame preTrained, Word2VecModel model) {
  if (_parms._vec_size != preTrained.numCols() - 1) {
   throw new IllegalStateException("Frame with pre-trained model doesn't conform to the specified vector length.");
  }
  WordVectorConverter result = new WordVectorConverter(_job, _parms._vec_size, (int) preTrained.numRows()).doAll(preTrained);
  model.buildModelOutput(result._words, result._syn0);
 }
}

代码示例来源:origin: h2oai/h2o-3

public void setResponseTransform(TransformType t){
 _response_transform = t;
 if(t == TransformType.NONE) {
  _normRespMul = null;
  _normRespSub = null;
 } else {
  _normRespMul = MemoryManager.malloc8d(_responses);
  _normRespSub = MemoryManager.malloc8d(_responses);
  setTransform(t,_normRespMul,_normRespSub,_adaptedFrame.numCols()-_responses,_responses);
 }
}

代码示例来源:origin: h2oai/h2o-3

@Override public void map(Chunk[] cs) {
  int off=checkMe.numCols();
  for(int i=0;i<off;++i) {
   for(int r=0;r<cs[0]._len;++r) {
    double check = cs[i].atd(r);
    double gold  = cs[i+off].atd(r);
    if( Math.abs(check-gold) > 1e-12 )
     throw new RuntimeException("bonk");
   }
  }
 }
}.doAll(vecs);

代码示例来源:origin: h2oai/h2o-3

@Override protected void checkMemoryFootPrint_impl() {
 long mem_usage = 8 /*doubles*/ * _parms._k * _train.numCols() * (_parms._standardize ? 2 : 1);
 long max_mem = H2O.SELF._heartbeat.get_free_mem();
 if (mem_usage > max_mem) {
  String msg = "Centroids won't fit in the driver node's memory ("
      + PrettyPrint.bytes(mem_usage) + " > " + PrettyPrint.bytes(max_mem)
      + ") - try reducing the number of columns and/or the number of categorical factors.";
  error("_train", msg);
 }
}

代码示例来源:origin: h2oai/h2o-3

private static double[][] frameToMatrix(Frame f) {
 double[][] rows = new double[(int) f.numRows()][];
 for (int r = 0; r < rows.length; r++) {
  rows[r] = new double[f.numCols()];
 }
 for (int c = 0; c < f.numCols(); c++) {
  Vec.Reader vecReader = f.vec(c).new Reader();
  for (int r = 0; r < rows.length; r++)
   rows[r][c] = vecReader.at(r);
 }
 return rows;
}

代码示例来源:origin: h2oai/h2o-3

private static Chunk[] chunks(DataInfo dinfo, int chunkId) {
 Chunk[] cs = new Chunk[dinfo._adaptedFrame.numCols()];
 for (int i = 0; i < cs.length; i++)
  cs[i] = dinfo._adaptedFrame.vec(i).chunkForChunkIdx(chunkId);
 return cs;
}

代码示例来源:origin: h2oai/h2o-3

@BeforeClass
public static void setup() {
 stall_till_cloudsize(1);
 _covtype = parse_test_file("smalldata/covtype/covtype.20k.data");
 _covtype.replace(_covtype.numCols()-1,_covtype.lastVec().toCategoricalVec()).remove();
 Key[] keys = new Key[]{Key.make("train"),Key.make("test")};
 H2O.submitTask(new FrameSplitter(_covtype, new double[]{.8},keys,null)).join();
 _train = DKV.getGet(keys[0]);
 _test = DKV.getGet(keys[1]);
}

相关文章