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: Computes the score between cov/prec of sample covariance of X_test
  and X via 'score_metric'.
  
  Note: We want to maximize score so we return the negative error.
  
  Parameters
  ----------
  X_test : array-like, shape = [n_samples, n_features]
      Test data of which we compute the likelihood, where n_samples is
      the number of samples and n_features is the number of features.
      X_test is assumed to be drawn from the same distribution than
      the data used in fit (including centering).
  
  y : not used.
  
  Returns
  -------
  result : float or list of floats
      The negative of the min error between `self.covariance_` and
      the sample covariance of X_test.
docstr_tok: ["Computes","the","score","between","cov\/prec","of","sample","covariance","of","X_test","and","X","via","'score_metric","'",".","Note",":","We","want","to","maximize","score","so","we","return","the","negative","error",".","Parameters","--","--","--","--","--","X_test",":","array-like",",","shape","=","[","n_samples",",","n_features","]","Test","data","of","which","we","compute","the","likelihood",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","X_test","is","assumed","to","be","drawn","from","the","same","distribution","than","the","data","used","in","fit","(","including","centering",")",".","y",":","not","used",".","Returns","--","--","--","-","result",":","float","or","list","of","floats","The","negative","of","the","min","error","between","`","self.covariance_","`","and","the","sample","covariance","of","X_test","."]
code: def score(self, X_test, y=None):
      """Computes the score between cov/prec of sample covariance of X_test
      and X via 'score_metric'.
  
      Note: We want to maximize score so we return the negative error.
  
      Parameters
      ----------
      X_test : array-like, shape = [n_samples, n_features]
          Test data of which we compute the likelihood, where n_samples is
          the number of samples and n_features is the number of features.
          X_test is assumed to be drawn from the same distribution than
          the data used in fit (including centering).
  
      y : not used.
  
      Returns
      -------
      result : float or list of floats
          The negative of the min error between `self.covariance_` and
          the sample covariance of X_test.
      """
      if isinstance(self.precision_, list):
          print("Warning: returning a list of scores.")
  
      S_test, lam_scale_test = _init_coefs(
          X_test, method=self.init_method
      )
      error = self.cov_error(S_test, score_metric=self.score_metric)
  
      # maximize score with -error
      return -error
  
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 4 for calling the InverseCovarianceEstimator obj's underlying member method code with example usage: obj.score(X_test, y) and returns: unknown