Search in sources :

Example 1 with Id3

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();
}
Also used : Id3(com.alibaba.alink.pipeline.classification.Id3) Pipeline(com.alibaba.alink.pipeline.Pipeline) Test(org.junit.Test)

Aggregations

Pipeline (com.alibaba.alink.pipeline.Pipeline)1 Id3 (com.alibaba.alink.pipeline.classification.Id3)1 Test (org.junit.Test)1