Search in sources :

Example 1 with C45

use of com.alibaba.alink.pipeline.classification.C45 in project Alink by alibaba.

the class RandomForestTrainBatchOpTest method testC45Pipeline.

@Test
public void testC45Pipeline() throws Exception {
    C45 c45 = new C45().setFeatureCols(featureColNames).setCategoricalCols(categoricalColNames).setLabelCol(labelColName).setPredictionCol("c45_test_result").setPredictionDetailCol("c45_test_detail");
    Pipeline pipeline = new Pipeline().add(c45);
    BatchOperator<?> output = pipeline.fit(input).transform(input);
    output.lazyPrint(-1);
    BatchOperator<?> output1 = BatchOperator.fromTable(output.getOutputTable());
    output1.lazyPrint(-1);
    AlgoOperator<?> outputStream = pipeline.fit(input).transform(inputStream);
    outputStream.print();
    MLEnvironmentFactory.getDefault().getStreamExecutionEnvironment().execute();
}
Also used : C45(com.alibaba.alink.pipeline.classification.C45) Pipeline(com.alibaba.alink.pipeline.Pipeline) Test(org.junit.Test)

Aggregations

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