use of water.fvec.TestFrameBuilder in project h2o-3 by h2oai.
the class AstMatchTest method makeTestFrame.
private Frame makeTestFrame() {
Random rnd = new Random();
final int len = 45000;
double[] numData = new double[len];
String[] strData = new String[len];
String[] catData = new String[len];
for (int i = 0; i < len; i++) {
char c = (char) ('A' + rnd.nextInt('Z' - 'A'));
numData[i] = c >= 'B' && c <= 'D' ? 1 : -1;
strData[i] = "s" + Character.toString(c);
catData[i] = "c" + Character.toString(c);
}
return new TestFrameBuilder().withName("data").withColNames("Expected", "Str", "Cat").withVecTypes(Vec.T_NUM, Vec.T_STR, Vec.T_CAT).withDataForCol(0, numData).withDataForCol(1, strData).withDataForCol(2, catData).withChunkLayout(10000, 10000, 20000, 5000).build();
}
use of water.fvec.TestFrameBuilder in project h2o-3 by h2oai.
the class AstRectangleScalarAssignTest method makeTestFrame.
private Frame makeTestFrame() {
Random rnd = new Random();
final int len = 43978;
double[] numData = new double[len];
String[] strData = new String[len];
String[] catData = new String[len];
for (int i = 0; i < len; i++) {
numData[i] = rnd.nextDouble();
strData[i] = "s" + Character.toString((char) ('A' + rnd.nextInt('Z' - 'A')));
catData[i] = "c" + Character.toString((char) ('0' + rnd.nextInt('9' - '0')));
}
return new TestFrameBuilder().withName("data").withColNames("Num", "Str", "Cat").withVecTypes(Vec.T_NUM, Vec.T_STR, Vec.T_CAT).withDataForCol(0, numData).withDataForCol(1, strData).withDataForCol(2, catData).withChunkLayout(10000, 10000, 20000, 3978).build();
}
Aggregations