public void PerformBinaryNumericDataSplit() { // Given var testData = TestDataBuilder.BuildSmallDataFrameNumbersOnly(); var expectedPositiveData = testData.GetSubsetByRows(new[] { 1, 2 }); var expectedNegativeData = testData.GetSubsetByRows(new[] { 0 }); var splitCriterion = new BinarySplittingParams("Col1", 5, null); // When var splitResults = BinaryNumericDataSplitter.SplitData(testData, splitCriterion); var actualPositiveData = splitResults.First().SplittedDataFrame; var actualNegativeData = splitResults.Last().SplittedDataFrame; // Then Assert.IsTrue(expectedPositiveData.ContentEquals(actualPositiveData)); Assert.IsTrue(actualNegativeData.ContentEquals(expectedNegativeData)); }
public void PerformBinaryDiscreteDataSplit() { // Given var testData = TestDataBuilder.ReadWeatherDataWithCategoricalAttributes(); var expectedPositiveData = testData.GetSubsetByRows(new[] { 3, 4, 5, 9, 13 }); var expectedNegativeData = testData.GetSubsetByRows(new[] { 0, 1, 2, 6, 7, 8, 10, 11, 12 }); var splitCriteria = new BinarySplittingParams("Outlook", "Rainy", "Play"); // When var splitResults = BinaryDiscreteDataSplitter.SplitData(testData, splitCriteria); var actualPositiveData = splitResults.First().SplittedDataFrame; var actualNegativeData = splitResults.Last().SplittedDataFrame; // Then Assert.IsTrue(expectedPositiveData.ContentEquals(actualPositiveData)); Assert.IsTrue(actualNegativeData.ContentEquals(expectedNegativeData)); }