class_docstr: Cross-validated Orthogonal Matching Pursuit model (OMP)
  
  Parameters
  ----------
  copy : bool, optional
      Whether the design matrix X must be copied by the algorithm. A false
      value is only helpful if X is already Fortran-ordered, otherwise a
      copy is made anyway.
  
  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`.
  
  max_iter : integer, optional
      Maximum numbers of iterations to perform, therefore maximum features
      to include. 10% of ``n_features`` but at least 5 if available.
  
  cv : int, cross-validation generator or an iterable, optional
      Determines the cross-validation splitting strategy.
      Possible inputs for cv are:
  
      - None, to use the default 3-fold cross-validation,
      - integer, to specify the number of folds.
      - An object to be used as a cross-validation generator.
      - An iterable yielding train/test splits.
  
      For integer/None inputs, :class:`KFold` is used.
  
      Refer :ref:`User Guide <cross_validation>` for the various
      cross-validation strategies that can be used here.
  
  n_jobs : integer, optional
      Number of CPUs to use during the cross validation. If ``-1``, use
      all the CPUs
  
  verbose : boolean or integer, optional
      Sets the verbosity amount
  
  Read more in the :ref:`User Guide <omp>`.
  
  Attributes
  ----------
  intercept_ : float or array, shape (n_targets,)
      Independent term in decision function.
  
  coef_ : array, shape (n_features,) or (n_features, n_targets)
      Parameter vector (w in the problem formulation).
  
  n_nonzero_coefs_ : int
      Estimated number of non-zero coefficients giving the best mean squared
      error over the cross-validation folds.
  
  n_iter_ : int or array-like
      Number of active features across every target for the model refit with
      the best hyperparameters got by cross-validating across all folds.
  
  See also
  --------
  orthogonal_mp
  orthogonal_mp_gram
  lars_path
  Lars
  LassoLars
  OrthogonalMatchingPursuit
  LarsCV
  LassoLarsCV
  decomposition.sparse_encode
class_docstr_tok: ["Cross-validated","Orthogonal","Matching","Pursuit","model","(","OMP",")","Parameters","--","--","--","--","--","copy",":","bool",",","optional","Whether","the","design","matrix","X","must","be","copied","by","the","algorithm",".","A","false","value","is","only","helpful","if","X","is","already","Fortran-ordered",",","otherwise","a","copy","is","made","anyway",".","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","`",".","max_iter",":","integer",",","optional","Maximum","numbers","of","iterations","to","perform",",","therefore","maximum","features","to","include",".","10","%","of","``","n_features","``","but","at","least","5","if","available",".","cv",":","int",",","cross-validation","generator","or","an","iterable",",","optional","Determines","the","cross-validation","splitting","strategy",".","Possible","inputs","for","cv","are",":","-","None",",","to","use","the","default","3-fold","cross-validation",",","-","integer",",","to","specify","the","number","of","folds",".","-","An","object","to","be","used","as","a","cross-validation","generator",".","-","An","iterable","yielding","train\/test","splits",".","For","integer\/None","inputs",",",":","class",":","`","KFold","`","is","used",".","Refer",":","ref",":","`","User","Guide","<","cross_validation",">","`","for","the","various","cross-validation","strategies","that","can","be","used","here",".","n_jobs",":","integer",",","optional","Number","of","CPUs","to","use","during","the","cross","validation",".","If","``","-1","``",",","use","all","the","CPUs","verbose",":","boolean","or","integer",",","optional","Sets","the","verbosity","amount","Read","more","in","the",":","ref",":","`","User","Guide","<","omp",">","`",".","Attributes","--","--","--","--","--","intercept_",":","float","or","array",",","shape","(","n_targets",",",")","Independent","term","in","decision","function",".","coef_",":","array",",","shape","(","n_features",",",")","or","(","n_features",",","n_targets",")","Parameter","vector","(","w","in","the","problem","formulation",")",".","n_nonzero_coefs_",":","int","Estimated","number","of","non-zero","coefficients","giving","the","best","mean","squared","error","over","the","cross-validation","folds",".","n_iter_",":","int","or","array-like","Number","of","active","features","across","every","target","for","the","model","refit","with","the","best","hyperparameters","got","by","cross-validating","across","all","folds",".","See","also","--","--","--","--","orthogonal_mp","orthogonal_mp_gram","lars_path","Lars","LassoLars","OrthogonalMatchingPursuit","LarsCV","LassoLarsCV","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]
      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","]","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]
          Target values.
  
      Returns
      -------
      self : object
          returns an instance of self.
      """
      X, y = check_X_y(
          X, y, y_numeric=True, ensure_min_features=2, estimator=self
      )
      X = as_float_array(X, copy=False, force_all_finite=False)
      cv = check_cv(self.cv, classifier=False)
      max_iter = (
          min(max(int(0.1 * X.shape[1]), 5), X.shape[1])
          if not self.max_iter
          else self.max_iter
      )
      cv_paths = Parallel(n_jobs=self.n_jobs, verbose=self.verbose)(
          delayed(_omp_path_residues)(
              X[train],
              y[train],
              X[test],
              y[test],
              self.copy,
              self.fit_intercept,
              self.normalize,
              max_iter,
          )
          for train, test in cv.split(X)
      )
  
      min_early_stop = min(fold.shape[0] for fold in cv_paths)
      mse_folds = np.array(
          [
              (fold[:min_early_stop] ** 2).mean(axis=1)
              for fold in cv_paths
          ]
      )
      best_n_nonzero_coefs = np.argmin(mse_folds.mean(axis=0)) + 1
      self.n_nonzero_coefs_ = best_n_nonzero_coefs
      omp = OrthogonalMatchingPursuit(
          n_nonzero_coefs=best_n_nonzero_coefs,
          fit_intercept=self.fit_intercept,
          normalize=self.normalize,
      )
      omp.fit(X, y)
      self.coef_ = omp.coef_
      self.intercept_ = omp.intercept_
      self.n_iter_ = omp.n_iter_
      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 OrthogonalMatchingPursuitCV obj's underlying member method code with example usage: obj.fit(X, y) and returns: self