Index: branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs
===================================================================
--- branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs	(revision 15420)
+++ branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs	(revision 15425)
@@ -4,4 +4,5 @@
 using System.Threading;
 using HeuristicLab.Algorithms.DataAnalysis.MctsSymbolicRegression.Policies;
+using HeuristicLab.Algorithms.DataAnalysis.MCTSSymbReg;
 using HeuristicLab.Data;
 using HeuristicLab.Optimization;
@@ -14,4 +15,110 @@
   [TestClass()]
   public class MctsSymbolicRegressionTest {
+    #region heuristics
+    [TestMethod]
+    [TestCategory("Algorithms.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void TestHeuristics() {
+      {
+        // a, b ~ U(0, 1) should be trivial
+        var nRand = new MersenneTwister(1234);
+
+        int n = 10000; // large sample so that we can use the thresholds below
+        var a = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var b = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var x = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var y = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+
+        var z = a.Zip(b, (ai, bi) => ai * bi).ToArray();
+
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, b, z) > 0.05); // should be detected as relevant
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, x, z) > 0.05); // a and b > 0 so these should be detected as well
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, x, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(x, y, z) < 0.05);
+      }
+      {
+        // a, b ~ U(1000, 2000) also trivial
+        var nRand = new UniformDistributedRandom(new MersenneTwister(1234), 1000, 2000);
+
+        int n = 10000; // large sample so that we can use the thresholds below
+        var a = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var b = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var x = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var y = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+
+        var z = a.Zip(b, (ai, bi) => ai * bi).ToArray();
+
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, b, z) > 0.05); // should be detected as relevant
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, x, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, x, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(x, y, z) < 0.05);
+      }
+      {
+        // a, b ~ U(-1, 1) 
+        var nRand = new UniformDistributedRandom(new MersenneTwister(1234), -1, 1);
+
+        int n = 10000; // large sample so that we can use the thresholds below
+        var a = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var b = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var x = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var y = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+
+        var z = a.Zip(b, (ai, bi) => ai * bi).ToArray();
+
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, b, z) > 0.05); // should be detected as relevant
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, x, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, y, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, x, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, y, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(x, y, z) < 0.05);
+      }
+      {
+        // a, b ~ N(0, 1)
+        var nRand = new NormalDistributedRandom(new MersenneTwister(1234), 0, 1);
+
+        int n = 10000; // large sample so that we can use the thresholds below
+        var a = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var b = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var x = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var y = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+
+        var z = a.Zip(b, (ai, bi) => ai * bi).ToArray();
+
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, b, z) > 0.05); // should be detected as relevant
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, x, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, y, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, x, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, y, z) < 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(x, y, z) < 0.05);
+      }
+      {
+        // a ~ N(100, 1), b ~ N(-100, 1)
+        var nRand = new NormalDistributedRandom(new MersenneTwister(1234), 0, 1);
+        var aRand = new NormalDistributedRandom(new MersenneTwister(1234), 100, 1);
+        var bRand = new NormalDistributedRandom(new MersenneTwister(1234), -100, 1);
+
+        int n = 10000; // large sample so that we can use the thresholds below
+        var a = Enumerable.Range(0, n).Select(_ => aRand.NextDouble()).ToArray();
+        var b = Enumerable.Range(0, n).Select(_ => bRand.NextDouble()).ToArray();
+        var x = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+        var y = Enumerable.Range(0, n).Select(_ => nRand.NextDouble()).ToArray();
+
+        var z = a.Zip(b, (ai, bi) => ai * bi).ToArray();
+
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, b, z) > 0.05); // should be detected as relevant
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, x, z) > 0.05); // a > 0
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(a, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, x, z) > 0.05); // b < 0
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(b, y, z) > 0.05);
+        Assert.IsTrue(Heuristics.CorrelationForInteraction(x, y, z) < 0.05);
+      }
+    }
+    #endregion
+
+
     #region expression hashing
     [TestMethod]
@@ -790,9 +897,9 @@
       }
 
-      var ds = new Dataset(new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "y" }, 
+      var ds = new Dataset(new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "y" },
         new[] { x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, ys });
 
 
-      var problemData = new RegressionProblemData(ds, new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j"}, "y");
+      var problemData = new RegressionProblemData(ds, new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" }, "y");
 
       problemData.TrainingPartition.Start = 0;
@@ -1118,7 +1225,7 @@
 
       // UCB tuned
-      // var ucbTuned = new UcbTuned();
-      // ucbTuned.C = 1.5; 
-      // mctsSymbReg.Policy = ucbTuned;
+      var ucbTuned = new UcbTuned();
+      ucbTuned.C = 1;
+      mctsSymbReg.Policy = ucbTuned;
 
 
