class_docstr: Computes a sparse inverse covariance matrix estimation using quadratic
  approximation.
  
  The inverse covariance is estimated the sample covariance estimate
  $S$ as an input such that:
  
  $T_hat = max_{\Theta} logdet(Theta) - Trace(ThetaS) - \lambda|\Theta|_1 $
  
  Parameters
  -----------
  lam : scalar or 2D ndarray, shape (n_features, n_features) (default=0.5)
      Regularization parameters per element of the inverse covariance matrix.
  
      If a scalar lambda is used, a penalty matrix will be generated
      containing lambda for all values in both upper and lower triangles
      and zeros along the diagonal.  This differs from the scalar graphical
      lasso by the diagonal. To replicate the scalar formulation you must
      manualy pass in lam * np.ones((n_features, n_features)).
  
  mode : one of 'default', 'path', or 'trace'
      Computation mode.
  
  tol : float (default=1e-6)
      Convergence threshold.
  
  max_iter : int (default=1000)
      Maximum number of Newton iterations.
  
  Theta0 : 2D ndarray, shape (n_features, n_features) (default=None)
      Initial guess for the inverse covariance matrix. If not provided, the
      diagonal identity matrix is used.
  
  Sigma0 : 2D ndarray, shape (n_features, n_features) (default=None)
      Initial guess for the covariance matrix. If not provided the diagonal
      identity matrix is used.
  
  path : array of floats (default=None)
      In "path" mode, an array of float values for scaling lam.
      The path must be sorted largest to smallest.  This class will auto sort
      this, in which case indices correspond to self.path_
  
  method : 'quic' or 'bigquic', ... (default=quic)
      Currently only 'quic' is supported.
  
  verbose : integer
      Used in quic routine.
  
  score_metric : one of 'log_likelihood' (default), 'frobenius', 'spectral',
                'kl', or 'quadratic'
      Used for computing self.score().
  
  init_method : one of 'corrcoef', 'cov', 'spearman', 'kendalltau',
      or a custom function.
      Computes initial covariance and scales lambda appropriately.
      Using the custom function extends graphical model estimation to
      distributions beyond the multivariate Gaussian.
      The `spearman` or `kendalltau` options extend inverse covariance
      estimation to nonparanormal and transelliptic graphical models.
      Custom function must return ((n_features, n_features) ndarray, float)
      where the scalar parameter will be used to scale the penalty lam.
  
  auto_scale : bool
      If True, will compute self.lam_scale_ = max off-diagonal value when
      init_method='cov'.
      If false, then self.lam_scale_ = 1.
      lam_scale_ is used to scale user-supplied self.lam during fit.
  
  Methods
  ----------
  lam_at_index(lidx) :  Compute the scaled lambda used at index lidx.
      The parameter lidx is ignored when mode='default'.  Can use self.lam_
      for convenience in this case.
  
  Attributes
  ----------
  covariance_ : 2D ndarray, shape (n_features, n_features)
      Estimated covariance matrix
      If mode='path', this is 2D ndarray, shape (len(path), n_features ** 2)
  
  precision_ : 2D ndarray, shape (n_features, n_features)
      Estimated pseudo-inverse matrix.
      If mode='path', this is 2D ndarray, shape (len(path), n_features ** 2)
  
  sample_covariance_ : 2D ndarray, shape (n_features, n_features)
      Estimated sample covariance matrix
  
  lam_ : (float) or 2D ndarray, shape (n_features, n_features)
      When mode='default', this is the lambda used in fit (lam * lam_scale_)
  
  lam_scale_ : (float)
      Additional scaling factor on lambda (due to magnitude of
      sample_covariance_ values).
  
  path_ : None or array of floats
      Sorted (largest to smallest) path.  This will be None if not in path
      mode.
  
  opt_ :
  
  cputime_ :
  
  iters_ :
  
  duality_gap_ :
class_docstr_tok: ["Computes","a","sparse","inverse","covariance","matrix","estimation","using","quadratic","approximation",".","The","inverse","covariance","is","estimated","the","sample","covariance","estimate","$","S","$","as","an","input","such","that",":","$","T_hat","=","max_","{","\\Theta","}","logdet","(","Theta",")","-","Trace","(","ThetaS",")","-","\\lambda|\\Theta|_1","$","Parameters","--","--","--","--","--","-","lam",":","scalar","or","2D","ndarray",",","shape","(","n_features",",","n_features",")","(","default=0.5",")","Regularization","parameters","per","element","of","the","inverse","covariance","matrix",".","If","a","scalar","lambda","is","used",",","a","penalty","matrix","will","be","generated","containing","lambda","for","all","values","in","both","upper","and","lower","triangles","and","zeros","along","the","diagonal",".","This","differs","from","the","scalar","graphical","lasso","by","the","diagonal",".","To","replicate","the","scalar","formulation","you","must","manualy","pass","in","lam","*","np.ones","(","(","n_features",",","n_features",")",")",".","mode",":","one","of","'default","'",",","'path","'",",","or","'trace'","Computation","mode",".","tol",":","float","(","default=1e-6",")","Convergence","threshold",".","max_iter",":","int","(","default=1000",")","Maximum","number","of","Newton","iterations",".","Theta0",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","(","default=None",")","Initial","guess","for","the","inverse","covariance","matrix",".","If","not","provided",",","the","diagonal","identity","matrix","is","used",".","Sigma0",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","(","default=None",")","Initial","guess","for","the","covariance","matrix",".","If","not","provided","the","diagonal","identity","matrix","is","used",".","path",":","array","of","floats","(","default=None",")","In","``","path","''","mode",",","an","array","of","float","values","for","scaling","lam",".","The","path","must","be","sorted","largest","to","smallest",".","This","class","will","auto","sort","this",",","in","which","case","indices","correspond","to","self.path_","method",":","'quic","'","or","'bigquic","'",",","...","(","default=quic",")","Currently","only","'quic","'","is","supported",".","verbose",":","integer","Used","in","quic","routine",".","score_metric",":","one","of","'log_likelihood","'","(","default",")",",","'frobenius","'",",","'spectral","'",",","'kl","'",",","or","'quadratic'","Used","for","computing","self.score","(",")",".","init_method",":","one","of","'corrcoef","'",",","'cov","'",",","'spearman","'",",","'kendalltau","'",",","or","a","custom","function",".","Computes","initial","covariance","and","scales","lambda","appropriately",".","Using","the","custom","function","extends","graphical","model","estimation","to","distributions","beyond","the","multivariate","Gaussian",".","The","`","spearman","`","or","`","kendalltau","`","options","extend","inverse","covariance","estimation","to","nonparanormal","and","transelliptic","graphical","models",".","Custom","function","must","return","(","(","n_features",",","n_features",")","ndarray",",","float",")","where","the","scalar","parameter","will","be","used","to","scale","the","penalty","lam",".","auto_scale",":","bool","If","True",",","will","compute","self.lam_scale_","=","max","off-diagonal","value","when","init_method='cov","'",".","If","false",",","then","self.lam_scale_","=","1.","lam_scale_","is","used","to","scale","user-supplied","self.lam","during","fit",".","Methods","--","--","--","--","--","lam_at_index","(","lidx",")",":","Compute","the","scaled","lambda","used","at","index","lidx",".","The","parameter","lidx","is","ignored","when","mode='default","'",".","Can","use","self.lam_","for","convenience","in","this","case",".","Attributes","--","--","--","--","--","covariance_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","covariance","matrix","If","mode='path","'",",","this","is","2D","ndarray",",","shape","(","len","(","path",")",",","n_features","*","*","2",")","precision_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","pseudo-inverse","matrix",".","If","mode='path","'",",","this","is","2D","ndarray",",","shape","(","len","(","path",")",",","n_features","*","*","2",")","sample_covariance_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","sample","covariance","matrix","lam_",":","(","float",")","or","2D","ndarray",",","shape","(","n_features",",","n_features",")","When","mode='default","'",",","this","is","the","lambda","used","in","fit","(","lam","*","lam_scale_",")","lam_scale_",":","(","float",")","Additional","scaling","factor","on","lambda","(","due","to","magnitude","of","sample_covariance_","values",")",".","path_",":","None","or","array","of","floats","Sorted","(","largest","to","smallest",")","path",".","This","will","be","None","if","not","in","path","mode",".","opt_",":","cputime_",":","iters_",":","duality_gap_",":"]
code: def __init__(
      self,
      lam=0.5,
      mode="default",
      tol=1e-6,
      max_iter=1000,
      Theta0=None,
      Sigma0=None,
      path=None,
      method="quic",
      verbose=0,
      score_metric="log_likelihood",
      init_method="corrcoef",
      auto_scale=True,
  ):
      # quic-specific params
      self.lam = lam
      self.mode = mode
      self.tol = tol
      self.max_iter = max_iter
      self.Theta0 = Theta0
      self.Sigma0 = Sigma0
      self.method = method
      self.verbose = verbose
      self.path = path
  
      if self.mode == "path" and path is None:
          raise ValueError("path required in path mode.")
          return
  
      super(QuicGraphicalLasso, self).__init__(
          score_metric=score_metric,
          init_method=init_method,
          auto_scale=auto_scale,
      )
  
imports: from __future__ import absolute_import
  import sys
  import time
  import operator
  import numpy
  from functools import partial
  from sklearn.covariance import EmpiricalCovariance
  from sklearn.utils import check_array, as_float_array, deprecated
  from numpy.testing import assert_array_almost_equal
  from joblib import Parallel, delayed
  from sklearn.model_selection import cross_val_score, RepeatedKFold
  from .None import pyquic
  from .inverse_covariance import InverseCovarianceEstimator, _init_coefs, _compute_error, _validate_path
label_desc: Use image node_id 1 to create a new QuicGraphicalLasso object from inherited base classes: InverseCovarianceEstimator with example: obj = QuicGraphicalLasso(lam, mode, tol, max_iter, Theta0, Sigma0, path, method, verbose, score_metric, init_method, auto_scale)