@@ -0,0 +1,1452 @@
+import unittest%0Aimport BayesianDataStructure%0Aimport jgraph%0A%0Aclass mytest(unittest.TestCase):%0A    def testInit(self):%0A        node1 = BayesianDataStructure.Node(%22CarType%22, 10000, %5B%22suv%22, %22sedan%22%5D, %5B7000, 3000%5D)%0A%0A    def ftestDataParser(self):%0A        dp = BayesianDataStructure.DataParser()%0A        dp.readCsvFile(r%22D:%5Cprojects%5Cdata_compression%5CBayesianNetworkPython%5CDATA%5CAggUsage_OneDriveForBusiness_Aggregated_selectColumns.txt%22, True, 300000)%0A        Measurements = map(lambda x: float(x), dp.ColumnVals%5B-1%5D)%0A        bynt = BayesianDataStructure.BayesianNetwork(dp.ColumnNames%5B:-1%5D, dp.ColumnVals%5B:-1%5D, Measurements)%0A        %0A        bynt.Draft()%0A        print bynt.BasicGraph%0A        bynt.Thickening()%0A        print bynt.BasicGraph%0A%0A    def testCMI(self):%0A        vals = %5B%5B%22chn%22, %22chn%22, %22us%22%5D, %5B%22suv%22, %22suv%22, %22crv%22%5D, %5B%22small%22, %22big%22, %22small%22%5D%5D%0A        #col0 col1 0.5004024, col0 col2 == col1 col2%0A        bynt = BayesianDataStructure.BayesianNetwork(%5B%22col0%22, %22col1%22, %22col2%22%5D, vals, %5B300, 500, 200%5D)%0A        bynt.Draft()%0A        #print bynt.BasicGraph%0A        bynt.Thickening()%0A        #print bynt.BasicGraph%0A        print bynt.BasicGraph.Connections%0A        self.assertEqual(%22%25.7f%22 %25 bynt.BasicGraph.Connections%5B0%5D%5B1%5D, %220.7219281%22)%0A        self.assertEqual(bynt.BasicGraph.Connections%5B0%5D%5B2%5D, bynt.BasicGraph.Connections%5B1%5D%5B2%5D)%0A%0A    def testDrawGraph(self):%0A        jgraph.draw(%5B(1,2), (2,3), (3,4)%5D) %0A%0Aif __name__ == %22__main__%22:%0A    unittest.main()%0A

Create BayesianDataStructureTest.py