<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fit(self, X, y):
 """ Learn the hyperparameters of a Bayesian linear regressor. Parameters X : ndarray (N, d) array input dataset (N samples, d dimensions). y : ndarray (N,) array targets (N samples) Returns ------- self Notes ----- This actually optimises the evidence lower bound on log marginal likelihood, rather than log marginal likelihood directly. In the case of a full posterior convariance matrix, this bound is tight and the exact solution will be found (modulo local minima for the hyperparameters). This uses the python logging module for displaying learning status. To view these messages have something like, .. code :: import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) in your calling code. """

        X, y = check_X_y(X, y)

        self.obj_ = -np.inf

        # Make list of parameters and decorate optimiser to undestand this
        params = [self.var, self.basis.regularizer, self.basis.params]
        nmin = structured_minimizer(logtrick_minimizer(minimize))

        # Close over objective and learn parameters
        elbo = partial(StandardLinearModel._elbo, self, X, y)
        res = nmin(elbo,
                   params,
                   method='L-BFGS-B',
                   jac=True,
                   tol=self.tol,
                   options={'maxiter': self.maxiter, 'maxcor': 100},
                   random_state=self.random_,
                   nstarts=self.nstarts
                   )

        # Upack learned parameters and report
        self.var_, self.regularizer_, self.hypers_ = res.x

        log.info("Done! ELBO = {}, var = {}, reg = {}, hypers = {}, "
                 "message = {}."
                 .format(-res['fun'],
                         self.var_,
                         self.regularizer_,
                         self.hypers_,
                         res.message)
                 )

        return self