from sklearn.linear_model import SGDClassifier

class SGD:
    def __init__(self, loss='hinge', max_iter=1000, tol=1e-3, random_state=42):
        self.model = SGDClassifier(loss=loss, max_iter=max_iter, tol=tol, random_state=random_state)

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

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