Skip to content

Commit

Permalink
Cleaning up Divisive Cluster test and avoiding spurious failure chanc…
Browse files Browse the repository at this point in the history
…e. Removing print statement from DGC that should not have been
  • Loading branch information
EdwardRaff committed Nov 12, 2017
1 parent eea7344 commit 0ef1558
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ else if (splitEvaluation[z] == Double.NEGATIVE_INFINITY)//at most 2 will hit thi
{
bestKEval = bestSplitVal;
bestK = k;
System.out.println("Best k is now " + k + " at " + bestKEval);
// System.out.println("Best k is now " + k + " at " + bestKEval);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
import jsat.classifiers.DataPoint;
import jsat.clustering.kmeans.ElkanKMeans;
import jsat.clustering.evaluation.DaviesBouldinIndex;
import jsat.clustering.kmeans.HamerlyKMeans;
import jsat.clustering.kmeans.NaiveKMeans;
import jsat.distributions.Uniform;
import jsat.linear.distancemetrics.DistanceMetric;
import jsat.linear.distancemetrics.EuclideanDistance;
import jsat.utils.GridDataGenerator;
import jsat.utils.IntSet;
import jsat.utils.SystemInfo;
import jsat.utils.random.RandomUtil;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

Expand All @@ -39,9 +43,9 @@ public DivisiveGlobalClustererTest()
@BeforeClass
public static void setUpClass() throws Exception
{
GridDataGenerator gdg = new GridDataGenerator(new Uniform(-0.15, 0.15), new Random(12), 2, 2);
GridDataGenerator gdg = new GridDataGenerator(new Uniform(-0.05, 0.05), RandomUtil.getRandom(), 2, 2);
easyData = gdg.generateData(60);
ex = Executors.newFixedThreadPool(10);
ex = Executors.newFixedThreadPool(SystemInfo.LogicalCores);
}

@AfterClass
Expand All @@ -53,7 +57,7 @@ public static void tearDownClass() throws Exception
public void setUp()
{
DistanceMetric dm = new EuclideanDistance();
dgc = new DivisiveGlobalClusterer(new ElkanKMeans(dm), new DaviesBouldinIndex(dm));
dgc = new DivisiveGlobalClusterer(new HamerlyKMeans(), new DaviesBouldinIndex(dm));
}

@After
Expand Down

0 comments on commit 0ef1558

Please sign in to comment.