Implemented a very dirty hack to format clusters without touching com.sap.sse.datamining

This commit is contained in:
Lennart Hensler
2016-10-21 16:28:47 +02:00
parent 95ed32d3c8
commit 08bed0ed9c
9 changed files with 214 additions and 5 deletions
@@ -0,0 +1,30 @@
package com.sap.sailing.datamining.impl.data;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.Test;
import com.sap.sse.datamining.data.Cluster;
import com.sap.sse.datamining.data.ClusterGroup;
public class TestPercentageClusterFormatter {
private ClusterGroup<Double> percentageClusterGroup;
private PercentageClusterFormatter formatter;
@Before
public void initialize() {
percentageClusterGroup = new LinearDoubleClusterGroup(0.0, 1.0, 0.1, true);
formatter = new PercentageClusterFormatter();
}
@Test
public void testFormat() {
Cluster<Double> cluster = percentageClusterGroup.getClusterFor(0.05);
String formattedCluster = formatter.format(cluster);
assertThat(formattedCluster, is("[0% - 10%["));
}
}