Exemplo n.º 1
0
    def write_pretty(self, out=sys.stdout, spacing=2):
        mat2, rlabels, clabels = self.getMatrix(rowheader=None)

        mat = []

        # get headers
        mat.append(clabels)

        # get data
        mat.extend(mat2)

        util.printcols(mat, spacing=spacing, out=out)
Exemplo n.º 2
0
    def write_pretty(self, out=sys.stdout, spacing=2):
        mat2, rlabels, clabels = self.getMatrix(rowheader=None)

        mat = []
        
        # get headers
        mat.append(clabels)
        
        # get data
        mat.extend(mat2)
        
        util.printcols(mat, spacing=spacing, out=out)
Exemplo n.º 3
0
def printVisitedTrees(visited):
    if len(visited) == 0:
        return
    nleaves = len(visited.values()[0][1].leaves())
    
    debug("\n\nmost likily trees out of %d visited (%.2e total): " % \
          (len(visited), numPossibleTrees(nleaves)))
    
    mat = [[key, logl, 
           tree.data["error"], 
           tree.data["baserate"],
           count]
           for key, (logl, tree, count) in visited.iteritems()]
    mat.sort(key=lambda x: x[1], reverse=True)
    
    util.printcols([["TREE", "LOGL", "ERROR", "BASERATE", "COUNT"]] + 
                   mat[:80], spacing=4, out=DEBUG)
    debug()

    mat.sort(key=lambda x: x[2])
    util.printcols([["TREE", "LOGL", "ERROR", "BASERATE", "COUNT"]] + 
                   mat[:80], spacing=4, out=DEBUG)
    debug()