Search in sources :

Example 11 with Pipeline

use of com.alibaba.alink.pipeline.Pipeline in project Alink by alibaba.

the class LogisticRegressionMixVecTest method batchMixVecTest15.

@Test
public void batchMixVecTest15() {
    BatchOperator<?> trainData = (BatchOperator<?>) getData();
    Pipeline pipeline = new Pipeline().add(new LogisticRegression().setVectorCol("svec2").setWithIntercept(false).setStandardization(false).setLabelCol("labels").setPredictionCol("pred"));
    PipelineModel model = pipeline.fit(trainData);
    model.transform(trainData).collect();
}
Also used : LogisticRegression(com.alibaba.alink.pipeline.classification.LogisticRegression) BatchOperator(com.alibaba.alink.operator.batch.BatchOperator) Pipeline(com.alibaba.alink.pipeline.Pipeline) PipelineModel(com.alibaba.alink.pipeline.PipelineModel) Test(org.junit.Test)

Example 12 with Pipeline

use of com.alibaba.alink.pipeline.Pipeline in project Alink by alibaba.

the class LogisticRegressionMixVecTest method batchMixVecTest8.

@Test
public void batchMixVecTest8() {
    BatchOperator<?> trainData = (BatchOperator<?>) getData();
    Pipeline pipeline = new Pipeline().add(new LogisticRegression().setVectorCol("vec").setWithIntercept(false).setStandardization(true).setLabelCol("labels").setPredictionCol("pred"));
    PipelineModel model = pipeline.fit(trainData);
    model.transform(trainData).collect();
}
Also used : LogisticRegression(com.alibaba.alink.pipeline.classification.LogisticRegression) BatchOperator(com.alibaba.alink.operator.batch.BatchOperator) Pipeline(com.alibaba.alink.pipeline.Pipeline) PipelineModel(com.alibaba.alink.pipeline.PipelineModel) Test(org.junit.Test)

Example 13 with Pipeline

use of com.alibaba.alink.pipeline.Pipeline in project Alink by alibaba.

the class LogisticRegressionMixVecTest method batchMixVecTest6.

@Test
public void batchMixVecTest6() {
    BatchOperator<?> trainData = (BatchOperator<?>) getData();
    Pipeline pipeline = new Pipeline().add(new LogisticRegression().setVectorCol("vec").setWithIntercept(false).setStandardization(false).setLabelCol("labels").setPredictionCol("pred"));
    PipelineModel model = pipeline.fit(trainData);
    model.transform(trainData).collect();
}
Also used : LogisticRegression(com.alibaba.alink.pipeline.classification.LogisticRegression) BatchOperator(com.alibaba.alink.operator.batch.BatchOperator) Pipeline(com.alibaba.alink.pipeline.Pipeline) PipelineModel(com.alibaba.alink.pipeline.PipelineModel) Test(org.junit.Test)

Example 14 with Pipeline

use of com.alibaba.alink.pipeline.Pipeline in project Alink by alibaba.

the class LogisticRegressionMixVecTest method batchMixVecTest12.

@Test
public void batchMixVecTest12() {
    BatchOperator<?> trainData = (BatchOperator<?>) getData();
    Pipeline pipeline = new Pipeline().add(new VectorAssembler().setSelectedCols(new String[] { "svec", "vec", "f0", "f1", "f2", "f3" }).setOutputCol("allvec")).add(new LogisticRegression().setVectorCol("allvec").setWithIntercept(true).setReservedCols(new String[] { "labels", "allvec" }).setLabelCol("labels").setPredictionCol("pred"));
    PipelineModel model = pipeline.fit(trainData);
    model.transform(trainData).collect();
}
Also used : VectorAssembler(com.alibaba.alink.pipeline.dataproc.vector.VectorAssembler) LogisticRegression(com.alibaba.alink.pipeline.classification.LogisticRegression) BatchOperator(com.alibaba.alink.operator.batch.BatchOperator) Pipeline(com.alibaba.alink.pipeline.Pipeline) PipelineModel(com.alibaba.alink.pipeline.PipelineModel) Test(org.junit.Test)

Example 15 with Pipeline

use of com.alibaba.alink.pipeline.Pipeline in project Alink by alibaba.

the class LogisticRegressionMixVecTest method batchMixVecTest23.

@Test
public void batchMixVecTest23() {
    BatchOperator<?> trainData = (BatchOperator<?>) getData();
    Pipeline pipeline = new Pipeline().add(new LogisticRegression().setVectorCol("svec2").setWithIntercept(true).setStandardization(false).setLabelCol("labels").setPredictionCol("pred"));
    PipelineModel model = pipeline.fit(trainData);
    model.transform(trainData).collect();
}
Also used : LogisticRegression(com.alibaba.alink.pipeline.classification.LogisticRegression) BatchOperator(com.alibaba.alink.operator.batch.BatchOperator) Pipeline(com.alibaba.alink.pipeline.Pipeline) PipelineModel(com.alibaba.alink.pipeline.PipelineModel) Test(org.junit.Test)

Aggregations

Pipeline (com.alibaba.alink.pipeline.Pipeline)63 Test (org.junit.Test)38 PipelineModel (com.alibaba.alink.pipeline.PipelineModel)34 LogisticRegression (com.alibaba.alink.pipeline.classification.LogisticRegression)20 Row (org.apache.flink.types.Row)18 BatchOperator (com.alibaba.alink.operator.batch.BatchOperator)16 MemSourceBatchOp (com.alibaba.alink.operator.batch.source.MemSourceBatchOp)16 VectorAssembler (com.alibaba.alink.pipeline.dataproc.vector.VectorAssembler)11 AkSourceBatchOp (com.alibaba.alink.operator.batch.source.AkSourceBatchOp)10 CollectSinkStreamOp (com.alibaba.alink.operator.stream.sink.CollectSinkStreamOp)9 EvalBinaryClassBatchOp (com.alibaba.alink.operator.batch.evaluation.EvalBinaryClassBatchOp)8 MemSourceStreamOp (com.alibaba.alink.operator.stream.source.MemSourceStreamOp)7 File (java.io.File)5 ArrayList (java.util.ArrayList)5 EvalMultiClassBatchOp (com.alibaba.alink.operator.batch.evaluation.EvalMultiClassBatchOp)4 StandardScaler (com.alibaba.alink.pipeline.dataproc.StandardScaler)4 Stopwatch (com.alibaba.alink.common.utils.Stopwatch)3 CsvSourceBatchOp (com.alibaba.alink.operator.batch.source.CsvSourceBatchOp)3 KMeans (com.alibaba.alink.pipeline.clustering.KMeans)3 VectorToTensor (com.alibaba.alink.pipeline.dataproc.VectorToTensor)3