class_docstr: Base class for inverse covariance estimators.
  
  Provides initialization method, metrics, scoring function,
  and ebic model selection.
  
  Parameters
  -----------
  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.
  
  Attributes
  ----------
  covariance_ : 2D ndarray, shape (n_features, n_features)
      Estimated covariance matrix
  
      This can also be a len(path) list of
      2D ndarray, shape (n_features, n_features)
      (e.g., see mode='path' in QuicGraphLasso)
  
  precision_ : 2D ndarray, shape (n_features, n_features)
      Estimated pseudo-inverse matrix.
  
      This can also be a len(path) list of
      2D ndarray, shape (n_features, n_features)
      (e.g., see mode='path' in QuicGraphLasso)
  
  sample_covariance_ : 2D ndarray, shape (n_features, n_features)
      Estimated sample covariance matrix
  
  lam_scale_ : (float)
      Additional scaling factor on lambda (due to magnitude of
      sample_covariance_ values).
class_docstr_tok: ["Base","class","for","inverse","covariance","estimators",".","Provides","initialization","method",",","metrics",",","scoring","function",",","and","ebic","model","selection",".","Parameters","--","--","--","--","--","-","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",".","Attributes","--","--","--","--","--","covariance_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","covariance","matrix","This","can","also","be","a","len","(","path",")","list","of","2D","ndarray",",","shape","(","n_features",",","n_features",")","(","e.g.",",","see","mode='path","'","in","QuicGraphLasso",")","precision_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","pseudo-inverse","matrix",".","This","can","also","be","a","len","(","path",")","list","of","2D","ndarray",",","shape","(","n_features",",","n_features",")","(","e.g.",",","see","mode='path","'","in","QuicGraphLasso",")","sample_covariance_",":","2D","ndarray",",","shape","(","n_features",",","n_features",")","Estimated","sample","covariance","matrix","lam_scale_",":","(","float",")","Additional","scaling","factor","on","lambda","(","due","to","magnitude","of","sample_covariance_","values",")","."]
docstr: Uses Extended Bayesian Information Criteria for model selection.
  
  Can only be used in path mode (doesn't really make sense otherwise).
  
  See:
  Extended Bayesian Information Criteria for Gaussian Graphical Models
  R. Foygel and M. Drton
  NIPS 2010
  
  Parameters
  ----------
  gamma : (float) \in (0, 1)
      Choice of gamma=0 leads to classical BIC
      Positive gamma leads to stronger penalization of large graphs.
  
  Returns
  -------
  Lambda index with best ebic score.  When multiple ebic scores are the
  same, returns the smallest lambda (largest index) with minimum score.
docstr_tok: ["Uses","Extended","Bayesian","Information","Criteria","for","model","selection",".","Can","only","be","used","in","path","mode","(","does","n't","really","make","sense","otherwise",")",".","See",":","Extended","Bayesian","Information","Criteria","for","Gaussian","Graphical","Models","R.","Foygel","and","M.","Drton","NIPS","2010","Parameters","--","--","--","--","--","gamma",":","(","float",")","\\in","(","0",",","1",")","Choice","of","gamma=0","leads","to","classical","BIC","Positive","gamma","leads","to","stronger","penalization","of","large","graphs",".","Returns","--","--","--","-","Lambda","index","with","best","ebic","score",".","When","multiple","ebic","scores","are","the","same",",","returns","the","smallest","lambda","(","largest","index",")","with","minimum","score","."]
code: def ebic_select(self, gamma=0):
      """Uses Extended Bayesian Information Criteria for model selection.
  
      Can only be used in path mode (doesn't really make sense otherwise).
  
      See:
      Extended Bayesian Information Criteria for Gaussian Graphical Models
      R. Foygel and M. Drton
      NIPS 2010
  
      Parameters
      ----------
      gamma : (float) \in (0, 1)
          Choice of gamma=0 leads to classical BIC
          Positive gamma leads to stronger penalization of large graphs.
  
      Returns
      -------
      Lambda index with best ebic score.  When multiple ebic scores are the
      same, returns the smallest lambda (largest index) with minimum score.
      """
      if not isinstance(self.precision_, list):
          raise ValueError(
              "EBIC requires multiple models to select from."
          )
          return
  
      if not self.is_fitted_:
          return
  
      ebic_scores = self.ebic(gamma=gamma)
      min_indices = np.where(
          np.abs(ebic_scores - ebic_scores.min()) < 1e-10
      )
      return np.max(min_indices)
  
file_path: skggm/inverse_covariance/inverse_covariance.py
imports: from __future__ import absolute_import
  import numpy
  from sklearn.base import BaseEstimator
  from .None import metrics
  from .rank_correlation import spearman_correlation, kendalltau_correlation
label_desc: Use image node_id 7 for calling the InverseCovarianceEstimator obj's underlying member method code with example usage: obj.ebic_select(gamma) and returns: np