Changeset 8834
- Timestamp:
- 10/23/12 10:28:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/StatisticCalculatorsTest.cs
r8355 r8834 146 146 var xs = new double[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 }; 147 147 var ys = new double[] { 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 }; 148 var d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);148 var d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 149 149 Assert.AreEqual(error, OnlineCalculatorError.None); 150 150 Assert.AreEqual(d, 1.0, 1E-5); … … 152 152 // perfect negative dependency 153 153 ys = xs.Select(x => -x).ToArray(); 154 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);154 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 155 155 Assert.AreEqual(error, OnlineCalculatorError.None); 156 156 Assert.AreEqual(d, 1.0, 1E-5); … … 159 159 xs = new double[] { 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 5.0 }; 160 160 ys = new double[] { 2.0, 2.0, 3.0, 3.0, 4.0, 4.0, 5.0, 5.0, 6.0, 6.0, 6.0 }; 161 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);161 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 162 162 Assert.AreEqual(error, OnlineCalculatorError.None); 163 163 Assert.AreEqual(d, 0.6783, 1E-5); … … 166 166 xs = new double[] { 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 6.0, 6.0 }; 167 167 ys = xs.Select(x => x * x).ToArray(); 168 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);168 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 169 169 Assert.AreEqual(error, OnlineCalculatorError.None); 170 170 Assert.AreEqual(d, 0.75, 1E-5); … … 173 173 xs = new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; 174 174 ys = new double[] { 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0 }; 175 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);175 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 176 176 Assert.AreEqual(error, OnlineCalculatorError.None); 177 177 Assert.AreEqual(d, -0.3516, 1E-4); … … 184 184 185 185 // independent 186 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);186 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 187 187 Assert.AreEqual(error, OnlineCalculatorError.None); 188 188 Assert.AreEqual(d, -0.00023, 1E-5); … … 192 192 ys = xs.Select(x => x * x).ToArray(); 193 193 194 d = HoeffdingsDependenceCalculator.Calculate (xs, ys, out error);194 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(xs, ys, out error); 195 195 Assert.AreEqual(error, OnlineCalculatorError.None); 196 196 Assert.AreEqual(d, 0.25071, 1E-5); 197 197 198 198 // symmetric? 199 d = HoeffdingsDependenceCalculator.Calculate (ys, xs, out error);199 d = HoeffdingsDependenceCalculator.CalculateHoeffdings(ys, xs, out error); 200 200 Assert.AreEqual(error, OnlineCalculatorError.None); 201 201 Assert.AreEqual(d, 0.25071, 1E-5);
Note: See TracChangeset
for help on using the changeset viewer.