def buildtree(self,Trainset):
        global serial_no
        serial_no = serial_no+1
        if len(Trainset)==1:
            return numpy.array([serial_no,-1,Trainset[:,5],-1,-1])
        elif 1 > len(Trainset):
            chosen_feature = random.randrange(0,5)
            # print len(Trainset)
            while True:
                chosen_step_1 = random.randrange(0,len(Trainset))
                chosen_step_2 = random.randrange(0,len(Trainset))
                if chosen_step_2!=chosen_step_1:
                    break
            splitval = numpy.mean([Trainset[chosen_step_1][chosen_feature],Trainset[chosen_step_2][chosen_feature]]) 
            (left_data,right_data) = self.split(Trainset, Trainset[:,chosen_feature]<=splitval)
            if(len(left_data)==0 or len(right_data)==0):
                # print "DANGER! being averted"
                return numpy.array([serial_no,-1,numpy.mean(Trainset[:,chosen_feature]),-1,-1])
            current = numpy.array([[serial_no,chosen_feature,splitval,0,0]])
            left_subtree = self.buildtree(left_data)
            right_subtree = self.buildtree(right_data)
            self.tree = self.combine_tree(current,left_subtree,right_subtree)
            
        return self.tree
dataset/ETHPy150Open TheSriram/MLT4Trading/Project 3/Randomforestlearner.py/Randomforestlearner.buildtree/swapped operands of `>`