class_docstr: No frills vanilla OLS estimator implemented through the normal equation.
  
  MWE of a Scikit-learn estimator.
  
  OLS is a simple estimator designed to allow for total control over
  predictions in unit testing. It implements OLS through the Normal
  Equation, no learning takes place. The ``offset`` option allows
  the user to offset weights by a scalar value, if different instances
  should be differentiated in their predictions.
  
  Parameters
  ----------
  offset : float (default = 0)
      scalar value to add to the coefficient vector after fitting.
  
  Examples
  --------
  
  Asserting the OLS passes the Scikit-learn estimator test
  
  >>> from sklearn.utils.estimator_checks import check_estimator
  >>> from mlens.utils.dummy import OLS
  >>> check_estimator(OLS)
  
  OLS comparison with Scikit-learn's LinearRegression
  
  >>> from numpy.testing import assert_array_equal
  >>> from mlens.utils.dummy import OLS
  >>> from sklearn.linear_model import LinearRegression
  >>> from sklearn.datasets import load_boston
  >>> X, y = load_boston(True)
  >>>
  >>> lr = LinearRegression(False)
  >>> lr.fit(X, y)
  >>>
  >>> ols = OLS()
  >>> ols.fit(X, y)
  >>>
  >>> assert_array_equal(lr.coef_, ols.coef_)
class_docstr_tok: ["No","frills","vanilla","OLS","estimator","implemented","through","the","normal","equation",".","MWE","of","a","Scikit-learn","estimator",".","OLS","is","a","simple","estimator","designed","to","allow","for","total","control","over","predictions","in","unit","testing",".","It","implements","OLS","through","the","Normal","Equation",",","no","learning","takes","place",".","The","``","offset","``","option","allows","the","user","to","offset","weights","by","a","scalar","value",",","if","different","instances","should","be","differentiated","in","their","predictions",".","Parameters","--","--","--","--","--","offset",":","float","(","default","=","0",")","scalar","value","to","add","to","the","coefficient","vector","after","fitting",".","Examples","--","--","--","--","Asserting","the","OLS","passes","the","Scikit-learn","estimator","test",">",">",">","from","sklearn.utils.estimator_checks","import","check_estimator",">",">",">","from","mlens.utils.dummy","import","OLS",">",">",">","check_estimator","(","OLS",")","OLS","comparison","with","Scikit-learn","'s","LinearRegression",">",">",">","from","numpy.testing","import","assert_array_equal",">",">",">","from","mlens.utils.dummy","import","OLS",">",">",">","from","sklearn.linear_model","import","LinearRegression",">",">",">","from","sklearn.datasets","import","load_boston",">",">",">","X",",","y","=","load_boston","(","True",")",">",">",">",">",">",">","lr","=","LinearRegression","(","False",")",">",">",">","lr.fit","(","X",",","y",")",">",">",">",">",">",">","ols","=","OLS","(",")",">",">",">","ols.fit","(","X",",","y",")",">",">",">",">",">",">","assert_array_equal","(","lr.coef_",",","ols.coef_",")"]
docstr: Fit coefficient vector.
docstr_tok: ["Fit","coefficient","vector","."]
code: def fit(self, X, y):
      """Fit coefficient vector."""
      X, y = check_X_y(X, y, dtype="float64")
      y = np.asarray(y, dtype=X.dtype)
  
      O = np.linalg.lstsq(X, y, rcond=None)
  
      self.coef_ = O[0] + self.offset
      self.resid_ = O[1]
  
      return self
  
file_path: mlens/mlens/utils/dummy.py
imports: from __future__ import division, print_function
  import numpy
  from .exceptions import NotFittedError
  from ..externals.sklearn.base import BaseEstimator, TransformerMixin
label_desc: Use image node_id 2 for calling the OLS obj's underlying member method code with example usage: obj.fit(X, y) and returns: self