class_docstr: Bayesian ARD regression.
  
  Fit the weights of a regression model, using an ARD prior. The weights of
  the regression model are assumed to be in Gaussian distributions.
  Also estimate the parameters lambda (precisions of the distributions of the
  weights) and alpha (precision of the distribution of the noise).
  The estimation is done by an iterative procedures (Evidence Maximization)
  
  Read more in the :ref:`User Guide <bayesian_regression>`.
  
  Parameters
  ----------
  max_iter : int, default=None
      Maximum number of iterations. If `None`, it corresponds to `max_iter=300`.
  
      .. versionchanged:: 1.3
  
  tol : float, default=1e-3
      Stop the algorithm if w has converged.
  
  alpha_1 : float, default=1e-6
      Hyper-parameter : shape parameter for the Gamma distribution prior
      over the alpha parameter.
  
  alpha_2 : float, default=1e-6
      Hyper-parameter : inverse scale parameter (rate parameter) for the
      Gamma distribution prior over the alpha parameter.
  
  lambda_1 : float, default=1e-6
      Hyper-parameter : shape parameter for the Gamma distribution prior
      over the lambda parameter.
  
  lambda_2 : float, default=1e-6
      Hyper-parameter : inverse scale parameter (rate parameter) for the
      Gamma distribution prior over the lambda parameter.
  
  compute_score : bool, default=False
      If True, compute the objective function at each step of the model.
  
  threshold_lambda : float, default=10 000
      Threshold for removing (pruning) weights with high precision from
      the computation.
  
  fit_intercept : bool, default=True
      Whether to calculate the intercept for this model. If set
      to false, no intercept will be used in calculations
      (i.e. data is expected to be centered).
  
  copy_X : bool, default=True
      If True, X will be copied; else, it may be overwritten.
  
  verbose : bool, default=False
      Verbose mode when fitting the model.
  
  n_iter : int
      Maximum number of iterations.
  
      .. deprecated:: 1.3
         `n_iter` is deprecated in 1.3 and will be removed in 1.5. Use
         `max_iter` instead.
  
  Attributes
  ----------
  coef_ : array-like of shape (n_features,)
      Coefficients of the regression model (mean of distribution)
  
  alpha_ : float
     estimated precision of the noise.
  
  lambda_ : array-like of shape (n_features,)
     estimated precisions of the weights.
  
  sigma_ : array-like of shape (n_features, n_features)
      estimated variance-covariance matrix of the weights
  
  scores_ : float
      if computed, value of the objective function (to be maximized)
  
  n_iter_ : int
      The actual number of iterations to reach the stopping criterion.
  
      .. versionadded:: 1.3
  
  intercept_ : float
      Independent term in decision function. Set to 0.0 if
      ``fit_intercept = False``.
  
  X_offset_ : float
      If `fit_intercept=True`, offset subtracted for centering data to a
      zero mean. Set to np.zeros(n_features) otherwise.
  
  X_scale_ : float
      Set to np.ones(n_features).
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  BayesianRidge : Bayesian ridge regression.
  
  Notes
  -----
  For an example, see :ref:`examples/linear_model/plot_ard.py
  <sphx_glr_auto_examples_linear_model_plot_ard.py>`.
  
  References
  ----------
  D. J. C. MacKay, Bayesian nonlinear modeling for the prediction
  competition, ASHRAE Transactions, 1994.
  
  R. Salakhutdinov, Lecture notes on Statistical Machine Learning,
  http://www.utstat.toronto.edu/~rsalakhu/sta4273/notes/Lecture2.pdf#page=15
  Their beta is our ``self.alpha_``
  Their alpha is our ``self.lambda_``
  ARD is a little different than the slide: only dimensions/features for
  which ``self.lambda_ < self.threshold_lambda`` are kept and the rest are
  discarded.
  
  Examples
  --------
  >>> from sklearn import linear_model
  >>> clf = linear_model.ARDRegression()
  >>> clf.fit([[0,0], [1, 1], [2, 2]], [0, 1, 2])
  ARDRegression()
  >>> clf.predict([[1, 1]])
  array([1.])
class_docstr_tok: ["Bayesian","ARD","regression",".","Fit","the","weights","of","a","regression","model",",","using","an","ARD","prior",".","The","weights","of","the","regression","model","are","assumed","to","be","in","Gaussian","distributions",".","Also","estimate","the","parameters","lambda","(","precisions","of","the","distributions","of","the","weights",")","and","alpha","(","precision","of","the","distribution","of","the","noise",")",".","The","estimation","is","done","by","an","iterative","procedures","(","Evidence","Maximization",")","Read","more","in","the",":","ref",":","`","User","Guide","<","bayesian_regression",">","`",".","Parameters","--","--","--","--","--","max_iter",":","int",",","default=None","Maximum","number","of","iterations",".","If","`","None","`",",","it","corresponds","to","`","max_iter=300","`",".","..","versionchanged",":",":","1.3","tol",":","float",",","default=1e-3","Stop","the","algorithm","if","w","has","converged",".","alpha_1",":","float",",","default=1e-6","Hyper-parameter",":","shape","parameter","for","the","Gamma","distribution","prior","over","the","alpha","parameter",".","alpha_2",":","float",",","default=1e-6","Hyper-parameter",":","inverse","scale","parameter","(","rate","parameter",")","for","the","Gamma","distribution","prior","over","the","alpha","parameter",".","lambda_1",":","float",",","default=1e-6","Hyper-parameter",":","shape","parameter","for","the","Gamma","distribution","prior","over","the","lambda","parameter",".","lambda_2",":","float",",","default=1e-6","Hyper-parameter",":","inverse","scale","parameter","(","rate","parameter",")","for","the","Gamma","distribution","prior","over","the","lambda","parameter",".","compute_score",":","bool",",","default=False","If","True",",","compute","the","objective","function","at","each","step","of","the","model",".","threshold_lambda",":","float",",","default=10","000","Threshold","for","removing","(","pruning",")","weights","with","high","precision","from","the","computation",".","fit_intercept",":","bool",",","default=True","Whether","to","calculate","the","intercept","for","this","model",".","If","set","to","false",",","no","intercept","will","be","used","in","calculations","(","i.e",".","data","is","expected","to","be","centered",")",".","copy_X",":","bool",",","default=True","If","True",",","X","will","be","copied",";","else",",","it","may","be","overwritten",".","verbose",":","bool",",","default=False","Verbose","mode","when","fitting","the","model",".","n_iter",":","int","Maximum","number","of","iterations",".","..","deprecated",":",":","1.3","`","n_iter","`","is","deprecated","in","1.3","and","will","be","removed","in","1.5",".","Use","`","max_iter","`","instead",".","Attributes","--","--","--","--","--","coef_",":","array-like","of","shape","(","n_features",",",")","Coefficients","of","the","regression","model","(","mean","of","distribution",")","alpha_",":","float","estimated","precision","of","the","noise",".","lambda_",":","array-like","of","shape","(","n_features",",",")","estimated","precisions","of","the","weights",".","sigma_",":","array-like","of","shape","(","n_features",",","n_features",")","estimated","variance-covariance","matrix","of","the","weights","scores_",":","float","if","computed",",","value","of","the","objective","function","(","to","be","maximized",")","n_iter_",":","int","The","actual","number","of","iterations","to","reach","the","stopping","criterion",".","..","versionadded",":",":","1.3","intercept_",":","float","Independent","term","in","decision","function",".","Set","to","0.0","if","``","fit_intercept","=","False","``",".","X_offset_",":","float","If","`","fit_intercept=True","`",",","offset","subtracted","for","centering","data","to","a","zero","mean",".","Set","to","np.zeros","(","n_features",")","otherwise",".","X_scale_",":","float","Set","to","np.ones","(","n_features",")",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","BayesianRidge",":","Bayesian","ridge","regression",".","Notes","--","--","-","For","an","example",",","see",":","ref",":","`","examples\/linear_model\/plot_ard.py","<","sphx_glr_auto_examples_linear_model_plot_ard.py",">","`",".","References","--","--","--","--","--","D.","J.","C.","MacKay",",","Bayesian","nonlinear","modeling","for","the","prediction","competition",",","ASHRAE","Transactions",",","1994",".","R.","Salakhutdinov",",","Lecture","notes","on","Statistical","Machine","Learning",",","http",":","\/\/www.utstat.toronto.edu\/~rsalakhu\/sta4273\/notes\/Lecture2.pdf","#","page=15","Their","beta","is","our","``","self.alpha_","``","Their","alpha","is","our","``","self.lambda_","``","ARD","is","a","little","different","than","the","slide",":","only","dimensions\/features","for","which","``","self.lambda_","<","self.threshold_lambda","``","are","kept","and","the","rest","are","discarded",".","Examples","--","--","--","--",">",">",">","from","sklearn","import","linear_model",">",">",">","clf","=","linear_model.ARDRegression","(",")",">",">",">","clf.fit","(","[","[","0,0","]",",","[","1",",","1","]",",","[","2",",","2","]","]",",","[","0",",","1",",","2","]",")","ARDRegression","(",")",">",">",">","clf.predict","(","[","[","1",",","1","]","]",")","array","(","[","1",".","]",")"]
code: def _update_sigma(self, X, alpha_, lambda_, keep_lambda):
      # See slides as referenced in the docstring note
      # this function is used when n_samples >= n_features and will
      # invert a matrix of shape (n_features, n_features)
      X_keep = X[:, keep_lambda]
      gram = np.dot(X_keep.T, X_keep)
      eye = np.eye(gram.shape[0], dtype=X.dtype)
      sigma_inv = lambda_[keep_lambda] * eye + alpha_ * gram
      sigma_ = pinvh(sigma_inv)
      return sigma_
  
imports: import warnings
  from math import log
  from numbers import Integral, Real
  import numpy
  from scipy import linalg
  from scipy.linalg import pinvh
  from ..base import RegressorMixin, _fit_context
  from ..utils._param_validation import Hidden, Interval, StrOptions
  from ..utils.extmath import fast_logdet
  from ..utils.validation import _check_sample_weight
  from ._base import LinearModel, _preprocess_data, _rescale_data
label_desc: Use image node_id 4 for calling the ARDRegression obj's underlying member method code with example usage: obj._update_sigma(X, alpha_, lambda_, keep_lambda) and returns: sigma_