@Test
public void test() throws Exception {

	MemSourceBatchOp inOp = new MemSourceBatchOp(Arrays.asList(rows), new String[] {"label", "Y"});
	KMeans train = new KMeans()
		.setVectorCol("Y")
		.setPredictionCol("pred")
		.setK(2);
	ClusterMetrics metrics = new EvalClusterBatchOp(new Params())
		.setPredictionCol("pred")
		.setVectorCol("Y")
		.setLabelCol("label")
		.linkFrom(train.fit(inOp).transform(inOp))
		.collectMetrics();
	Assert.assertEquals(metrics.getVrc(), 12150.00, 0.01);
	Assert.assertEquals(metrics.getCp(), 0.115, 0.01);
	Assert.assertEquals(metrics.getCount().intValue(), 6);
	Assert.assertEquals(metrics.getDb(), 0.014, 0.01);
	Assert.assertEquals(metrics.getSp(), 15.58, 0.01);
	Assert.assertEquals(metrics.getK().intValue(), 2);
	Assert.assertEquals(metrics.getSsb(), 364.5, 0.01);
	Assert.assertEquals(metrics.getSsw(), 0.119, 0.01);
	Assert.assertEquals(metrics.getPurity(), 1.0, 0.01);
	Assert.assertEquals(metrics.getNmi(), 1.0, 0.01);
	Assert.assertEquals(metrics.getAri(), 1.0, 0.01);
	Assert.assertEquals(metrics.getRi(), 1.0, 0.01);
	Assert.assertEquals(metrics.getSilhouetteCoefficient(), 0.99,0.01);
}