def newEnt(self,bags:Distribution):
     res=0
     for i in range(bags.numBags()):
         for j in range(bags.numClasses()):
             res=res+self.lnFunc(bags.perClassPerBag(i,j))
         res=res-self.lnFunc(bags.perBag(i))
     return -(res/math.log(2))
 def oldEnt(self,bags:Distribution):
     res=0
     for j in range(bags.numClasses()):
         res=res+self.lnFunc(bags.perClass(j))
     return (self.lnFunc(bags.total())-res)/math.log(2)