from sklearn.tree import DecisionTreeClassifier

class J48:
    def __init__(self, criterion='gini', max_depth=None, random_state=42):
        self.model = DecisionTreeClassifier(criterion=criterion, max_depth=max_depth, random_state=random_state)

    def fit(self, X, y):
        self.model.fit(X, y)

    def predict(self, X):
        return self.model.predict(X)
