public void Can_get_gain_grid_with_classification_error() { var matrix = GetDataSet(); var tree = new DecisionTreeNode(matrix); var grid = tree.GetInformationGain(DisorderType.ClassificationError); Assert.IsNotNull(grid); Assert.AreEqual(3, grid.Count); Assert.AreEqual(1, grid.First().Key); Assert.AreEqual(2, grid.Last().Key); }
public void Can_get_gain_grid_with_gini_impurity() { var matrix = GetDataSet(); var tree = new DecisionTreeNode(matrix); var grid = tree.GetInformationGain(DisorderType.GiniImpurity); Assert.IsNotNull(grid); Assert.AreEqual(3, grid.Count); Assert.AreEqual(0, grid.First().Key); Assert.AreEqual(1, grid.Last().Key); }