human
I am working on the file "DecisionTree_Math_Fruits.ipynb".
The first task is:
Let's write a class for a question which can be asked to partition the data
Each object of a question class holds a column_no and a col_value 
 Eg. column_no = 0 denotes color and so col_value can be Green, Yellow or Red
 We can write a method which would compare the feature value of example with the feature value of Question
Can you write Python code for it?
assistant
#Here is Python code to compare the feature value of example with the feature value of Question
.

class Question:
    def __init__(self,col, val):
        self.col = col
        self.val = val
        
    def match(self,example):
        # Compare the feature value in an example to the
        # feature value in this question.
        value = example[self.col]
        if is_numeric(value):
            return value >= self.val
        else:
            return value == self.val
    
    def __repr__(self):
        # method to print the question in a readable format.
        condition = "=="
        if is_numeric(self.val):
            condition = ">="
        return "Is %s %s %s?" % (
            header[self.col], condition, str(self.val))