flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trohrm...@apache.org
Subject flink git commit: [hotfix] [ml] Use the FlinkTestBase ExecutionEnvironment in StochasticOutlierSelectionITSuite
Date Mon, 23 Jan 2017 14:44:03 GMT
Repository: flink
Updated Branches:
  refs/heads/master 0de2bc35b -> 32e1675aa


[hotfix] [ml] Use the FlinkTestBase ExecutionEnvironment in StochasticOutlierSelectionITSuite

The FlinkTestBase instantiates a Flink cluster with the right setup (logging, parallelism).
This cluster should be used by calling ExecutionEnvironment.getExecutionEnvironment from
within the test method. Calling this method in the constructor won't create the right
ExecutionEnvironment, because the before method of FlinkTestBase has not been executed.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/32e1675a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/32e1675a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/32e1675a

Branch: refs/heads/master
Commit: 32e1675aa38eec4a15272d62977dfe3ddbe92401
Parents: 0de2bc3
Author: Till Rohrmann <trohrmann@apache.org>
Authored: Mon Jan 23 15:33:49 2017 +0100
Committer: Till Rohrmann <trohrmann@apache.org>
Committed: Mon Jan 23 15:43:43 2017 +0100

----------------------------------------------------------------------
 .../flink/ml/outlier/StochasticOutlierSelectionITSuite.scala | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/32e1675a/flink-libraries/flink-ml/src/test/scala/org/apache/flink/ml/outlier/StochasticOutlierSelectionITSuite.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-ml/src/test/scala/org/apache/flink/ml/outlier/StochasticOutlierSelectionITSuite.scala
b/flink-libraries/flink-ml/src/test/scala/org/apache/flink/ml/outlier/StochasticOutlierSelectionITSuite.scala
index dc43278..4ddab22 100644
--- a/flink-libraries/flink-ml/src/test/scala/org/apache/flink/ml/outlier/StochasticOutlierSelectionITSuite.scala
+++ b/flink-libraries/flink-ml/src/test/scala/org/apache/flink/ml/outlier/StochasticOutlierSelectionITSuite.scala
@@ -45,8 +45,6 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers with
Flin
   val maxIterations = 5000
   val parameters = new StochasticOutlierSelection().setPerplexity(perplexity).parameters
 
-  val env = ExecutionEnvironment.getExecutionEnvironment
-
   it should "Compute the perplexity of the vector and return the correct error" in {
     val vector = BreezeDenseVector(Array(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 9.0, 10.0))
 
@@ -73,6 +71,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers with
Flin
   }
 
   it should "Compute the distance matrix and give symmetrical distances" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val data = env.fromCollection(List(
       BreezeLabeledVector(0, BreezeDenseVector(Array(1.0, 3.0))),
@@ -89,6 +88,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers with
Flin
   }
 
   it should "Compute the distance matrix and give the correct distances" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val expectedDistanceMatrix = Array(
       Array(Math.sqrt(2.0), Math.sqrt(10.0)),
@@ -113,6 +113,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers
with Flin
   }
 
   it should "Computing the affinity matrix and return the correct affinity" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val data = env.fromCollection(List(
       BreezeLabeledVector(0, BreezeDenseVector(Array(1.0, 1.0))),
@@ -144,6 +145,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers
with Flin
   }
 
   it should "Compute the binding probabilities and return the correct probabilities" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val expectedBindingProbabilityMatrix = Array(
       Array(0.00000000000000000, 0.3659685430819966, 0.36596854308199660,
@@ -183,6 +185,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers
with Flin
 
 
   it should "Compute the product of the vector, should return the correct values" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val data = env.fromCollection(List(
       BreezeLabeledVector(0, BreezeDenseVector(0.5, 0.3)),
@@ -207,6 +210,7 @@ class StochasticOutlierSelectionITSuite extends FlatSpec with Matchers
with Flin
   }
 
   it should "Verifying the output of the SOS algorithm assign the one true outlier" in {
+    val env = ExecutionEnvironment.getExecutionEnvironment
 
     val data = env.fromCollection(List(
       LabeledVector(0.0, DenseVector(1.0, 1.0)),


Mime
View raw message