class_docstr: Sparse inverse covariance estimation with an l1-penalized estimator.
  
  Read more in the :ref:`User Guide <sparse_inverse_covariance>`.
  
  .. versionchanged:: v0.20
      GraphLasso has been renamed to GraphicalLasso
  
  Parameters
  ----------
  alpha : float, default=0.01
      The regularization parameter: the higher alpha, the more
      regularization, the sparser the inverse covariance.
      Range is (0, inf].
  
  mode : {'cd', 'lars'}, default='cd'
      The Lasso solver to use: coordinate descent or LARS. Use LARS for
      very sparse underlying graphs, where p > n. Elsewhere prefer cd
      which is more numerically stable.
  
  covariance : "precomputed", default=None
      If covariance is "precomputed", the input data in `fit` is assumed
      to be the covariance matrix. If `None`, the empirical covariance
      is estimated from the data `X`.
  
      .. versionadded:: 1.3
  
  tol : float, default=1e-4
      The tolerance to declare convergence: if the dual gap goes below
      this value, iterations are stopped. Range is (0, inf].
  
  enet_tol : float, default=1e-4
      The tolerance for the elastic net solver used to calculate the descent
      direction. This parameter controls the accuracy of the search direction
      for a given column update, not of the overall parameter estimate. Only
      used for mode='cd'. Range is (0, inf].
  
  max_iter : int, default=100
      The maximum number of iterations.
  
  verbose : bool, default=False
      If verbose is True, the objective function and dual gap are
      plotted at each iteration.
  
  eps : float, default=eps
      The machine-precision regularization in the computation of the
      Cholesky diagonal factors. Increase this for very ill-conditioned
      systems. Default is `np.finfo(np.float64).eps`.
  
      .. versionadded:: 1.3
  
  assume_centered : bool, default=False
      If True, data are not centered before computation.
      Useful when working with data whose mean is almost, but not exactly
      zero.
      If False, data are centered before computation.
  
  Attributes
  ----------
  location_ : ndarray of shape (n_features,)
      Estimated location, i.e. the estimated mean.
  
  covariance_ : ndarray of shape (n_features, n_features)
      Estimated covariance matrix
  
  precision_ : ndarray of shape (n_features, n_features)
      Estimated pseudo inverse matrix.
  
  n_iter_ : int
      Number of iterations run.
  
  costs_ : list of (objective, dual_gap) pairs
      The list of values of the objective function and the dual gap at
      each iteration. Returned only if return_costs is True.
  
      .. versionadded:: 1.3
  
  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
  --------
  graphical_lasso : L1-penalized covariance estimator.
  GraphicalLassoCV : Sparse inverse covariance with
      cross-validated choice of the l1 penalty.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.covariance import GraphicalLasso
  >>> true_cov = np.array([[0.8, 0.0, 0.2, 0.0],
  ...                      [0.0, 0.4, 0.0, 0.0],
  ...                      [0.2, 0.0, 0.3, 0.1],
  ...                      [0.0, 0.0, 0.1, 0.7]])
  >>> np.random.seed(0)
  >>> X = np.random.multivariate_normal(mean=[0, 0, 0, 0],
  ...                                   cov=true_cov,
  ...                                   size=200)
  >>> cov = GraphicalLasso().fit(X)
  >>> np.around(cov.covariance_, decimals=3)
  array([[0.816, 0.049, 0.218, 0.019],
         [0.049, 0.364, 0.017, 0.034],
         [0.218, 0.017, 0.322, 0.093],
         [0.019, 0.034, 0.093, 0.69 ]])
  >>> np.around(cov.location_, decimals=3)
  array([0.073, 0.04 , 0.038, 0.143])
class_docstr_tok: ["Sparse","inverse","covariance","estimation","with","an","l1-penalized","estimator",".","Read","more","in","the",":","ref",":","`","User","Guide","<","sparse_inverse_covariance",">","`",".","..","versionchanged",":",":","v0.20","GraphLasso","has","been","renamed","to","GraphicalLasso","Parameters","--","--","--","--","--","alpha",":","float",",","default=0.01","The","regularization","parameter",":","the","higher","alpha",",","the","more","regularization",",","the","sparser","the","inverse","covariance",".","Range","is","(","0",",","inf","]",".","mode",":","{","'cd","'",",","'lars","'","}",",","default='cd'","The","Lasso","solver","to","use",":","coordinate","descent","or","LARS",".","Use","LARS","for","very","sparse","underlying","graphs",",","where","p",">","n.","Elsewhere","prefer","cd","which","is","more","numerically","stable",".","covariance",":","``","precomputed","''",",","default=None","If","covariance","is","``","precomputed","''",",","the","input","data","in","`","fit","`","is","assumed","to","be","the","covariance","matrix",".","If","`","None","`",",","the","empirical","covariance","is","estimated","from","the","data","`","X","`",".","..","versionadded",":",":","1.3","tol",":","float",",","default=1e-4","The","tolerance","to","declare","convergence",":","if","the","dual","gap","goes","below","this","value",",","iterations","are","stopped",".","Range","is","(","0",",","inf","]",".","enet_tol",":","float",",","default=1e-4","The","tolerance","for","the","elastic","net","solver","used","to","calculate","the","descent","direction",".","This","parameter","controls","the","accuracy","of","the","search","direction","for","a","given","column","update",",","not","of","the","overall","parameter","estimate",".","Only","used","for","mode='cd","'",".","Range","is","(","0",",","inf","]",".","max_iter",":","int",",","default=100","The","maximum","number","of","iterations",".","verbose",":","bool",",","default=False","If","verbose","is","True",",","the","objective","function","and","dual","gap","are","plotted","at","each","iteration",".","eps",":","float",",","default=eps","The","machine-precision","regularization","in","the","computation","of","the","Cholesky","diagonal","factors",".","Increase","this","for","very","ill-conditioned","systems",".","Default","is","`","np.finfo","(","np.float64",")",".eps","`",".","..","versionadded",":",":","1.3","assume_centered",":","bool",",","default=False","If","True",",","data","are","not","centered","before","computation",".","Useful","when","working","with","data","whose","mean","is","almost",",","but","not","exactly","zero",".","If","False",",","data","are","centered","before","computation",".","Attributes","--","--","--","--","--","location_",":","ndarray","of","shape","(","n_features",",",")","Estimated","location",",","i.e",".","the","estimated","mean",".","covariance_",":","ndarray","of","shape","(","n_features",",","n_features",")","Estimated","covariance","matrix","precision_",":","ndarray","of","shape","(","n_features",",","n_features",")","Estimated","pseudo","inverse","matrix",".","n_iter_",":","int","Number","of","iterations","run",".","costs_",":","list","of","(","objective",",","dual_gap",")","pairs","The","list","of","values","of","the","objective","function","and","the","dual","gap","at","each","iteration",".","Returned","only","if","return_costs","is","True",".","..","versionadded",":",":","1.3","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","--","--","--","--","graphical_lasso",":","L1-penalized","covariance","estimator",".","GraphicalLassoCV",":","Sparse","inverse","covariance","with","cross-validated","choice","of","the","l1","penalty",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.covariance","import","GraphicalLasso",">",">",">","true_cov","=","np.array","(","[","[","0.8",",","0.0",",","0.2",",","0.0","]",",","...","[","0.0",",","0.4",",","0.0",",","0.0","]",",","...","[","0.2",",","0.0",",","0.3",",","0.1","]",",","...","[","0.0",",","0.0",",","0.1",",","0.7","]","]",")",">",">",">","np.random.seed","(","0",")",">",">",">","X","=","np.random.multivariate_normal","(","mean=","[","0",",","0",",","0",",","0","]",",","...","cov=true_cov",",","...","size=200",")",">",">",">","cov","=","GraphicalLasso","(",")",".fit","(","X",")",">",">",">","np.around","(","cov.covariance_",",","decimals=3",")","array","(","[","[","0.816",",","0.049",",","0.218",",","0.019","]",",","[","0.049",",","0.364",",","0.017",",","0.034","]",",","[","0.218",",","0.017",",","0.322",",","0.093","]",",","[","0.019",",","0.034",",","0.093",",","0.69","]","]",")",">",">",">","np.around","(","cov.location_",",","decimals=3",")","array","(","[","0.073",",","0.04",",","0.038",",","0.143","]",")"]
code: def __init__(
      self,
      alpha=0.01,
      *,
      mode="cd",
      covariance=None,
      tol=1e-4,
      enet_tol=1e-4,
      max_iter=100,
      verbose=False,
      eps=np.finfo(np.float64).eps,
      assume_centered=False,
  ):
      super().__init__(
          tol=tol,
          enet_tol=enet_tol,
          max_iter=max_iter,
          mode=mode,
          verbose=verbose,
          eps=eps,
          assume_centered=assume_centered,
      )
      self.alpha = alpha
      self.covariance = covariance
  
imports: import operator
  import sys
  import time
  import warnings
  from numbers import Integral, Real
  import numpy
  from scipy import linalg
  from ..base import _fit_context
  from ..exceptions import ConvergenceWarning
  from ..linear_model import _cd_fast
  from ..linear_model import lars_path_gram
  from ..model_selection import check_cv, cross_val_score
  from ..utils._param_validation import Interval, StrOptions, validate_params
  from ..utils.parallel import Parallel, delayed
  from ..utils.validation import _is_arraylike_not_scalar, check_random_state, check_scalar
  from .None import EmpiricalCovariance, empirical_covariance, log_likelihood
label_desc: Use image node_id 1 to create a new GraphicalLasso object from inherited base classes: BaseGraphicalLasso with example: obj = GraphicalLasso(alpha)