use of com.alibaba.alink.operator.batch.nlp.DocCountVectorizerTrainBatchOp in project Alink by alibaba.
the class DocCountVectorizerTest method testInitializer.
@Test
public void testInitializer() {
DocCountVectorizerModel model = new DocCountVectorizerModel();
Assert.assertEquals(model.getParams().size(), 0);
DocCountVectorizer op = new DocCountVectorizer(new Params());
Assert.assertEquals(op.getParams().size(), 0);
BatchOperator<?> b = new DocCountVectorizerTrainBatchOp();
Assert.assertEquals(b.getParams().size(), 0);
b = new DocCountVectorizerTrainBatchOp(new Params());
Assert.assertEquals(b.getParams().size(), 0);
b = new DocCountVectorizerPredictBatchOp();
Assert.assertEquals(b.getParams().size(), 0);
b = new DocCountVectorizerPredictBatchOp(new Params());
Assert.assertEquals(b.getParams().size(), 0);
StreamOperator<?> s = new DocCountVectorizerPredictStreamOp(b);
Assert.assertEquals(s.getParams().size(), 0);
s = new DocCountVectorizerPredictStreamOp(b, new Params());
Assert.assertEquals(s.getParams().size(), 0);
}
use of com.alibaba.alink.operator.batch.nlp.DocCountVectorizerTrainBatchOp in project Alink by alibaba.
the class DocCountVectorizerTest method testException.
@Test(expected = RuntimeException.class)
public void testException() throws Exception {
BatchOperator<?> data = new MemSourceBatchOp(rows, new String[] { "id", "sentence", "label" });
DocCountVectorizerTrainBatchOp op = new DocCountVectorizerTrainBatchOp().setSelectedCol("sentence").setMinDF(2.).setMaxDF(1.).setFeatureType("TF").linkFrom(data);
op.collect();
}
Aggregations