<commit_before>from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import sys
import matplotlib.cm as cm
import matplotlib as mpl
from math import exp

def plotTree(treeDumpFileName,dim1=0,dim2=1,radiusOfSphere=None):
    """
    A function for plotting the tree.

    @param treeDumpFileName file name of the tree-dump
    @param dim1 plot dimension 1
    @param dim2 plot dimension 2
    """
    tree = np.loadtxt(treeDumpFileName,delimiter=",")

    if len(tree.shape) == 1:
        tree = tree.reshape([1,tree.shape[0]])

    # col 0 tree-index
    # col 1 split-dimension
    # col 2 points-size
    # col 3 weight min
    # col 4 weight max
    # col 5 weight mean
    # col 6 weight std-dvn
    # col 7 volume of the node
    # col 8 node-characterstic
    # col 9 acceptance ratio of the node
    # ----------------------------------
    # col 10 -> end node min and node max

    startCol = 10;

    numDims = (len(tree[0]) - startCol)/2

    print("numDims ",numDims)

    numPts = tree[:,2]
    wtMin = tree[:,3]
    wtMax = tree[:,4]

    # what column should be used for heat map
    heatMapPropertyCol = 4

    minWeight = exp(np.min(tree[np.where(numPts>0) ,heatMapPropertyCol]))
    maxWeight = exp(np.max(tree[np.where(numPts>0) ,heatMapPropertyCol]))

    norm = mpl.colors.Normalize(vmin=minWeight, vmax=maxWeight)
    cmap = cm.Spectral_r

    for nodeInfo in tree:
        #if int(nodeInfo[1]) == int(dim1) or int(nodeInfo[1]) == int(dim2):
        b1Min = nodeInfo[startCol+dim1]
        b2Min = nodeInfo[startCol+dim2]

        b1Max = nodeInfo[startCol+numDims+dim1]<commit_msg>plot colum now the lik min<commit_after>from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import sys
import matplotlib.cm as cm
import matplotlib as mpl
from math import exp

def plotTree(treeDumpFileName,dim1=0,dim2=1,radiusOfSphere=None):
    """
    A function for plotting the tree.

    @param treeDumpFileName file name of the tree-dump
    @param dim1 plot dimension 1
    @param dim2 plot dimension 2
    """
    tree = np.loadtxt(treeDumpFileName,delimiter=",")

    if len(tree.shape) == 1:
        tree = tree.reshape([1,tree.shape[0]])

    # col 0 tree-index
    # col 1 split-dimension
    # col 2 points-size
    # col 3 weight min
    # col 4 weight max
    # col 5 weight mean
    # col 6 weight std-dvn
    # col 7 volume of the node
    # col 8 node-characterstic
    # col 9 acceptance ratio of the node
    # ----------------------------------
    # col 10 -> end node min and node max

    startCol = 10;

    numDims = (len(tree[0]) - startCol)/2

    print("numDims ",numDims)

    numPts = tree[:,2]
    wtMin = tree[:,3]
    wtMax = tree[:,4]

    # what column should be used for heat map
    heatMapPropertyCol = 3

    minWeight = exp(np.min(tree[np.where(numPts>0) ,heatMapPropertyCol]))
    maxWeight = exp(np.max(tree[np.where(numPts>0) ,heatMapPropertyCol]))

    norm = mpl.colors.Normalize(vmin=minWeight, vmax=maxWeight)
    cmap = cm.Spectral_r

    for nodeInfo in tree:
        #if int(nodeInfo[1]) == int(dim1) or int(nodeInfo[1]) == int(dim2):
        b1Min = nodeInfo[startCol+dim1]
        b2Min = nodeInfo[startCol+dim2]

        b1Max = nodeInfo[startCol+numDims+dim1]
{'fraction_non_alphanumeric': 0.12397447584320875, 'fraction_numerical': 0.026131874810088117, 'mean_word_length': 2.7665903890160184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6735959', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1103, 'n_words': 318}