Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Fix ErrorBasedPruning unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YakanMS committed May 26, 2016
1 parent 4af4897 commit 38e11e7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ namespace Accord.Tests.MachineLearning
using Accord.Statistics.Filters;
using Accord.Math;
using Accord.Tests.MachineLearning.Properties;
using Accord.MachineLearning.DecisionTrees.Learning;
using Accord.MachineLearning.DecisionTrees.Learning;


[TestFixture]
public class ErrorBasedpruningTest
{
Expand Down Expand Up @@ -84,9 +84,9 @@ public void RunTest()
foreach (var node in tree)
nodeCount2++;

Assert.AreEqual(0.25459770114942532, error);
Assert.AreEqual(0.28922413793103446, error);
Assert.AreEqual(447, nodeCount);
Assert.AreEqual(193, nodeCount2);
Assert.AreEqual(424, nodeCount2);
}


Expand All @@ -109,14 +109,14 @@ public void RunTest3()
actual[i] = nodeCount2;
}

double[] expected = { 447, 193, 145, 140, 124, 117, 109, 103, 95, 87 };
double[] expected = { 447, 424, 410, 402, 376, 362, 354, 348, 336, 322 };

for (int i = 0; i < actual.Length; i++)
Assert.AreEqual(expected[i], actual[i]);
}

private static void repeat(double[][] inputs, int[] outputs,
DecisionTree tree, int training, double threshold,
private static void repeat(double[][] inputs, int[] outputs,
DecisionTree tree, int training, double threshold,
out int nodeCount2)
{
int nodeCount = 0;
Expand Down

0 comments on commit 38e11e7

Please sign in to comment.