IGNITE-11028: [ML] Flaky test(KeepBinaryTest)
authorYuriBabak <y.chief@gmail.com>
Tue, 22 Jan 2019 13:43:06 +0000 (16:43 +0300)
committerYury Babak <ybabak@gridgain.com>
Tue, 22 Jan 2019 13:43:06 +0000 (16:43 +0300)
This closes #5882

modules/ml/src/test/java/org/apache/ignite/ml/common/KeepBinaryTest.java

index 3af62bd..1d1103f 100644 (file)
@@ -88,8 +88,9 @@ public class KeepBinaryTest extends GridCommonAbstractTest {
 
         KMeansModel kmdl = trainer.fit(datasetBuilder, featureExtractor, lbExtractor);
 
-        assertTrue(kmdl.predict(VectorUtils.num2Vec(0.0)) == 0);
-        assertTrue(kmdl.predict(VectorUtils.num2Vec(10.0)) == 1);
+        Integer zeroCentre = kmdl.predict(VectorUtils.num2Vec(0.0));
+
+        assertTrue(kmdl.getCenters()[zeroCentre].get(0) == 0);
     }
 
     /**