Search in sources :

Example 1 with LinearRegPredictStreamOp

use of com.alibaba.alink.operator.stream.regression.LinearRegPredictStreamOp in project Alink by alibaba.

the class Chap01 method c_5_3.

static void c_5_3() throws Exception {
    MemSourceStreamOp pred_set = new MemSourceStreamOp(new Integer[] { 2018, 2019 }, "x");
    BatchOperator<?> lr_model = new AkSourceBatchOp().setFilePath(DATA_DIR + "gmv_reg.model");
    LinearRegPredictStreamOp predictor = new LinearRegPredictStreamOp(lr_model).setPredictionCol("pred");
    pred_set.select("x, x*x AS x2").link(predictor).print();
    StreamOperator.execute();
}
Also used : MemSourceStreamOp(com.alibaba.alink.operator.stream.source.MemSourceStreamOp) LinearRegPredictStreamOp(com.alibaba.alink.operator.stream.regression.LinearRegPredictStreamOp) AkSourceBatchOp(com.alibaba.alink.operator.batch.source.AkSourceBatchOp)

Aggregations

AkSourceBatchOp (com.alibaba.alink.operator.batch.source.AkSourceBatchOp)1 LinearRegPredictStreamOp (com.alibaba.alink.operator.stream.regression.LinearRegPredictStreamOp)1 MemSourceStreamOp (com.alibaba.alink.operator.stream.source.MemSourceStreamOp)1