class_docstr: Orthogonal Matching Pursuit model (OMP)
  
  Parameters
  ----------
  n_nonzero_coefs : int, optional
      Desired number of non-zero entries in the solution. If None (by
      default) this value is set to 10% of n_features.
  
  tol : float, optional
      Maximum norm of the residual. If not None, overrides n_nonzero_coefs.
  
  fit_intercept : boolean, optional
      whether to calculate the intercept for this model. If set
      to false, no intercept will be used in calculations
      (e.g. data is expected to be already centered).
  
  normalize : boolean, optional, default False
      If True, the regressors X will be normalized before regression.
      This parameter is ignored when `fit_intercept` is set to `False`.
      When the regressors are normalized, note that this makes the
      hyperparameters learnt more robust and almost independent of the number
      of samples. The same property is not valid for standardized data.
      However, if you wish to standardize, please use
      `preprocessing.StandardScaler` before calling `fit` on an estimator
      with `normalize=False`.
  
  precompute : {True, False, 'auto'}, default 'auto'
      Whether to use a precomputed Gram and Xy matrix to speed up
      calculations. Improves performance when `n_targets` or `n_samples` is
      very large. Note that if you already have such matrices, you can pass
      them directly to the fit method.
  
  Read more in the :ref:`User Guide <omp>`.
  
  Attributes
  ----------
  coef_ : array, shape (n_features,) or (n_features, n_targets)
      parameter vector (w in the formula)
  
  intercept_ : float or array, shape (n_targets,)
      independent term in decision function.
  
  n_iter_ : int or array-like
      Number of active features across every target.
  
  Notes
  -----
  Orthogonal matching pursuit was introduced in G. Mallat, Z. Zhang,
  Matching pursuits with time-frequency dictionaries, IEEE Transactions on
  Signal Processing, Vol. 41, No. 12. (December 1993), pp. 3397-3415.
  (http://blanche.polytechnique.fr/~mallat/papiers/MallatPursuit93.pdf)
  
  This implementation is based on Rubinstein, R., Zibulevsky, M. and Elad,
  M., Efficient Implementation of the K-SVD Algorithm using Batch Orthogonal
  Matching Pursuit Technical Report - CS Technion, April 2008.
  http://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf
  
  See also
  --------
  orthogonal_mp
  orthogonal_mp_gram
  lars_path
  Lars
  LassoLars
  decomposition.sparse_encode
class_docstr_tok: ["Orthogonal","Matching","Pursuit","model","(","OMP",")","Parameters","--","--","--","--","--","n_nonzero_coefs",":","int",",","optional","Desired","number","of","non-zero","entries","in","the","solution",".","If","None","(","by","default",")","this","value","is","set","to","10","%","of","n_features",".","tol",":","float",",","optional","Maximum","norm","of","the","residual",".","If","not","None",",","overrides","n_nonzero_coefs",".","fit_intercept",":","boolean",",","optional","whether","to","calculate","the","intercept","for","this","model",".","If","set","to","false",",","no","intercept","will","be","used","in","calculations","(","e.g",".","data","is","expected","to","be","already","centered",")",".","normalize",":","boolean",",","optional",",","default","False","If","True",",","the","regressors","X","will","be","normalized","before","regression",".","This","parameter","is","ignored","when","`","fit_intercept","`","is","set","to","`","False","`",".","When","the","regressors","are","normalized",",","note","that","this","makes","the","hyperparameters","learnt","more","robust","and","almost","independent","of","the","number","of","samples",".","The","same","property","is","not","valid","for","standardized","data",".","However",",","if","you","wish","to","standardize",",","please","use","`","preprocessing.StandardScaler","`","before","calling","`","fit","`","on","an","estimator","with","`","normalize=False","`",".","precompute",":","{","True",",","False",",","'auto","'","}",",","default","'auto'","Whether","to","use","a","precomputed","Gram","and","Xy","matrix","to","speed","up","calculations",".","Improves","performance","when","`","n_targets","`","or","`","n_samples","`","is","very","large",".","Note","that","if","you","already","have","such","matrices",",","you","can","pass","them","directly","to","the","fit","method",".","Read","more","in","the",":","ref",":","`","User","Guide","<","omp",">","`",".","Attributes","--","--","--","--","--","coef_",":","array",",","shape","(","n_features",",",")","or","(","n_features",",","n_targets",")","parameter","vector","(","w","in","the","formula",")","intercept_",":","float","or","array",",","shape","(","n_targets",",",")","independent","term","in","decision","function",".","n_iter_",":","int","or","array-like","Number","of","active","features","across","every","target",".","Notes","--","--","-","Orthogonal","matching","pursuit","was","introduced","in","G.","Mallat",",","Z.","Zhang",",","Matching","pursuits","with","time-frequency","dictionaries",",","IEEE","Transactions","on","Signal","Processing",",","Vol",".","41",",","No",".","12",".","(","December","1993",")",",","pp",".","3397-3415",".","(","http",":","\/\/blanche.polytechnique.fr\/~mallat\/papiers\/MallatPursuit93.pdf",")","This","implementation","is","based","on","Rubinstein",",","R.",",","Zibulevsky",",","M.","and","Elad",",","M.",",","Efficient","Implementation","of","the","K-SVD","Algorithm","using","Batch","Orthogonal","Matching","Pursuit","Technical","Report","-","CS","Technion",",","April","2008.","http",":","\/\/www.cs.technion.ac.il\/~ronrubin\/Publications\/KSVD-OMP-v2.pdf","See","also","--","--","--","--","orthogonal_mp","orthogonal_mp_gram","lars_path","Lars","LassoLars","decomposition.sparse_encode"]
docstr: Fit the model using X, y as training data.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Training data.
  
  y : array-like, shape (n_samples,) or (n_samples, n_targets)
      Target values.
  
  
  Returns
  -------
  self : object
      returns an instance of self.
docstr_tok: ["Fit","the","model","using","X",",","y","as","training","data",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","Training","data",".","y",":","array-like",",","shape","(","n_samples",",",")","or","(","n_samples",",","n_targets",")","Target","values",".","Returns","--","--","--","-","self",":","object","returns","an","instance","of","self","."]
code: def fit(self, X, y):
      """Fit the model using X, y as training data.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Training data.
  
      y : array-like, shape (n_samples,) or (n_samples, n_targets)
          Target values.
  
  
      Returns
      -------
      self : object
          returns an instance of self.
      """
      X, y = check_X_y(X, y, multi_output=True, y_numeric=True)
      n_features = X.shape[1]
  
      X, y, X_offset, y_offset, X_scale, Gram, Xy = _pre_fit(
          X,
          y,
          None,
          self.precompute,
          self.normalize,
          self.fit_intercept,
          copy=True,
      )
  
      if y.ndim == 1:
          y = y[:, np.newaxis]
  
      if self.n_nonzero_coefs is None and self.tol is None:
          # default for n_nonzero_coefs is 0.1 * n_features
          # but at least one.
          self.n_nonzero_coefs_ = max(int(0.1 * n_features), 1)
      else:
          self.n_nonzero_coefs_ = self.n_nonzero_coefs
  
      if Gram is False:
          coef_, self.n_iter_ = orthogonal_mp(
              X,
              y,
              self.n_nonzero_coefs_,
              self.tol,
              precompute=False,
              copy_X=True,
              return_n_iter=True,
          )
      else:
          norms_sq = (
              np.sum(y**2, axis=0) if self.tol is not None else None
          )
  
          coef_, self.n_iter_ = orthogonal_mp_gram(
              Gram,
              Xy=Xy,
              n_nonzero_coefs=self.n_nonzero_coefs_,
              tol=self.tol,
              norms_squared=norms_sq,
              copy_Gram=True,
              copy_Xy=True,
              return_n_iter=True,
          )
      self.coef_ = coef_.T
      self._set_intercept(X_offset, y_offset, X_scale)
      return self
  
imports: import warnings
  from distutils.version import LooseVersion
  import numpy
  from scipy import linalg
  from scipy.linalg.lapack import get_lapack_funcs
  from .base import LinearModel, _pre_fit
  from ..base import RegressorMixin
  from ..utils import as_float_array, check_array, check_X_y
  from ..model_selection import check_cv
  from ..externals.joblib import Parallel, delayed
  import scipy
label_desc: Use image node_id 2 for calling the OrthogonalMatchingPursuit obj's underlying member method code with example usage: obj.fit(X, y) and returns: self