def train(model, X, y):
    """
    Model trainer for models and pipelines that adhere to the sklearn API.

    Args:
        model (sklearn.model): model that adheres to sklearn model API
        X (DataFrame): feature matrix
        y (DataFrame): target variable

    Returns:
        trained_model (sklearn.model): trained model
    """
    trained_model = model.fit(X, y)
    return trained_model