class_docstr: Two-stage adaptive estimator.
  
  a) Compute the first estimate with an estimator of your choice
     (self.estimator).  This estimate must produce a single precision_
     output.
  
  b) The resulting coefficients are used to generate adaptive weights and
     the QuicGraphicalLasso is refit with these weights.
  
  See:
      "High dimensional covariance estimation based on Gaussian graphical
      models"
      S. Zhou, P. R{"u}htimann, M. Xu, and P. B{"u}hlmann
  
      "Relaxed Lasso"
      N. Meinshausen, December 2006.
  
  Parameters
  -----------
  estimator : GraphicalLasso instance with model selection
              (default=QuicGraphicalLassoCV())
      After being fit, estimator.precision_ must either be a matrix.
  
  method : one of 'binary', 'inverse_squared', 'inverse' (default='binary')
      binary: non-zero where estimator was zero, 1 else
              (gelato, "relaxed lasso")
      inverse_squared: 1/|coefficient|^2  (glasso)
      inverse: 1/|coefficient|
  
  Attributes
  ----------
  estimator_ : QuicGraphicalLasso instance
      The final estimator refit with adaptive weights.
  
  lam_ : 2D ndarray, shape (n_features, n_features)
      Adaptive weight matrix generated.
code: def _inverse_squared_weights(self, estimator):
      n_features, _ = estimator.precision_.shape
      lam = np.zeros((n_features, n_features))
      mask = estimator.precision_ != 0
      lam[mask] = 1.0 / (np.abs(estimator.precision_[mask]) ** 2)
      mask_0 = estimator.precision_ == 0
      lam[mask_0] = np.max(
          lam[mask].flat
      )  # non-zero in appropriate range
      lam[np.diag_indices(n_features)] = 0
      return lam
  
file_path: skggm/inverse_covariance/adaptive_graph_lasso.py
imports: from __future__ import absolute_import
  import numpy
  from sklearn.utils import check_array, as_float_array, deprecated
  from sklearn.base import BaseEstimator
  from .None import QuicGraphicalLasso, QuicGraphicalLassoCV, InverseCovarianceEstimator
label_desc: Use image node_id 3 for calling the AdaptiveGraphicalLasso obj's underlying member method code with example usage: obj._inverse_squared_weights(estimator) and returns: lam