use of com.alibaba.alink.operator.common.feature.OneHotModelInfo in project Alink by alibaba.
the class OneHotTrainBatchOpTest method testLazyPrint.
@Test
public void testLazyPrint() throws Exception {
RandomTableSourceBatchOp op = new RandomTableSourceBatchOp().setIdCol("id").setNumCols(40).setNumRows(200L);
OneHotTrainBatchOp qop = new OneHotTrainBatchOp().setSelectedCols(ArrayUtils.removeElements(op.getColNames(), "id")).linkFrom(op);
qop.lazyCollectModelInfo(new Consumer<OneHotModelInfo>() {
@Override
public void accept(OneHotModelInfo oneHotModelInfo) {
for (String s : oneHotModelInfo.getSelectedColsInModel()) {
Assert.assertEquals(oneHotModelInfo.getDistinctTokenNumber(s).intValue(), 200);
}
}
});
qop.lazyPrintModelInfo();
BatchOperator.execute();
}
Aggregations