human
2. Leaf node - Gives prediction"
Please write code following the instructions in jupyter notebook style.
 What is a code to 2?
assistant
#Here is code to 2.

"""
A Leaf node classifies data.
This holds a dictionary of class (e.g., "Apple") -> number of time it 
appears in the rows from the training data that reach this leaf.
"""

class Leaf:
    def __init__(self, rows):
        self.predictions = class_counts(rows)