use of com.alibaba.alink.pipeline.classification.Id3 in project Alink by alibaba.
the class RandomForestTrainBatchOpTest method testId3Pipeline.
@Test
public void testId3Pipeline() throws Exception {
Id3 id3 = new Id3().setFeatureCols(featureColNames).setCategoricalCols(categoricalColNames).setLabelCol(labelColName).setPredictionCol("id3_test_result").setPredictionDetailCol("id3_test_detail");
Pipeline pipeline = new Pipeline().add(id3);
BatchOperator<?> output = pipeline.fit(input).transform(input);
output.lazyPrint(-1);
BatchOperator<?> output1 = BatchOperator.fromTable(output.getOutputTable());
output1.lazyPrint(-1);
StreamOperator<?> outputStream = pipeline.fit(input).transform(inputStream);
outputStream.print();
MLEnvironmentFactory.getDefault().getStreamExecutionEnvironment().execute();
}