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();
}
Aggregations