use of com.alibaba.alink.operator.stream.source.TableSourceStreamOp in project Alink by alibaba.
the class BisectingKMeansTest method before.
@Before
public void before() {
Row[] rows = new Row[] { Row.of(0, "0 0 0"), Row.of(1, "0.1 0.1 0.1"), Row.of(2, "0.2 0.2 0.2"), Row.of(3, "9 9 9"), Row.of(4, "9.1 9.1 9.1"), Row.of(5, "9.2 9.2 9.2") };
inputBatchOp = new TableSourceBatchOp(MLEnvironmentFactory.getDefault().createBatchTable(rows, new String[] { "id", "vector" }));
inputStreamOp = new TableSourceStreamOp(MLEnvironmentFactory.getDefault().createStreamTable(rows, new String[] { "id", "vector" }));
expectedPrediction = new long[] { 0, 0, 0, 1, 1, 1 };
}
use of com.alibaba.alink.operator.stream.source.TableSourceStreamOp in project Alink by alibaba.
the class KMeansTest method before.
@Before
public void before() {
Row[] rows = new Row[] { Row.of(0, "0 0 0"), Row.of(1, "0.1 0.1 0.1"), Row.of(2, "0.2 0.2 0.2"), Row.of(3, "9 9 9"), Row.of(4, "9.1 9.1 9.1"), Row.of(5, "9.2 9.2 9.2") };
inputBatchOp = new TableSourceBatchOp(MLEnvironmentFactory.getDefault().createBatchTable(rows, new String[] { "id", "vector" }));
inputStreamOp = new TableSourceStreamOp(MLEnvironmentFactory.getDefault().createStreamTable(rows, new String[] { "id", "vector" }));
expectedPrediction = new double[] { 0.173, 0, 0.173, 0.173, 0, 0.173 };
}
Aggregations