use of com.alibaba.alink.operator.common.feature.QuantileDiscretizerModelInfo in project Alink by alibaba.
the class QuantileDiscretizerTrainBatchOpTest method testLazyPrint.
@Test
public void testLazyPrint() throws Exception {
RandomTableSourceBatchOp op = new RandomTableSourceBatchOp().setIdCol("id").setNumCols(40).setNumRows(200L);
QuantileDiscretizerTrainBatchOp qop = new QuantileDiscretizerTrainBatchOp().setNumBuckets(20).setSelectedCols(ArrayUtils.removeElements(op.getColNames(), "id")).linkFrom(op);
qop.lazyCollectModelInfo(new Consumer<QuantileDiscretizerModelInfo>() {
@Override
public void accept(QuantileDiscretizerModelInfo quantileDiscretizerModelInfo) {
for (String s : quantileDiscretizerModelInfo.getSelectedColsInModel()) {
System.out.println(s + ":" + JsonConverter.toJson(quantileDiscretizerModelInfo.getCutsArray(s)));
}
}
});
qop.lazyPrintModelInfo();
BatchOperator.execute();
}
Aggregations