class_docstr: Ordinary least squares Linear Regression.
  
  LinearRegression fits a linear model with coefficients w = (w1, ..., wp)
  to minimize the residual sum of squares between the observed targets in
  the dataset, and the targets predicted by the linear approximation.
  
  Parameters
  ----------
  fit_intercept : bool, default=True
      Whether to calculate the intercept for this model. If set
      to False, no intercept will be used in calculations
      (i.e. data is expected to be centered).
  
  copy_X : bool, default=True
      If True, X will be copied; else, it may be overwritten.
  
  n_jobs : int, default=None
      The number of jobs to use for the computation. This will only provide
      speedup in case of sufficiently large problems, that is if firstly
      `n_targets > 1` and secondly `X` is sparse or if `positive` is set
      to `True`. ``None`` means 1 unless in a
      :obj:`joblib.parallel_backend` context. ``-1`` means using all
      processors. See :term:`Glossary <n_jobs>` for more details.
  
  positive : bool, default=False
      When set to ``True``, forces the coefficients to be positive. This
      option is only supported for dense arrays.
  
      .. versionadded:: 0.24
  
  Attributes
  ----------
  coef_ : array of shape (n_features, ) or (n_targets, n_features)
      Estimated coefficients for the linear regression problem.
      If multiple targets are passed during the fit (y 2D), this
      is a 2D array of shape (n_targets, n_features), while if only
      one target is passed, this is a 1D array of length n_features.
  
  rank_ : int
      Rank of matrix `X`. Only available when `X` is dense.
  
  singular_ : array of shape (min(X, y),)
      Singular values of `X`. Only available when `X` is dense.
  
  intercept_ : float or array of shape (n_targets,)
      Independent term in the linear model. Set to 0.0 if
      `fit_intercept = False`.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  Ridge : Ridge regression addresses some of the
      problems of Ordinary Least Squares by imposing a penalty on the
      size of the coefficients with l2 regularization.
  Lasso : The Lasso is a linear model that estimates
      sparse coefficients with l1 regularization.
  ElasticNet : Elastic-Net is a linear regression
      model trained with both l1 and l2 -norm regularization of the
      coefficients.
  
  Notes
  -----
  From the implementation point of view, this is just plain Ordinary
  Least Squares (scipy.linalg.lstsq) or Non Negative Least Squares
  (scipy.optimize.nnls) wrapped as a predictor object.
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.linear_model import LinearRegression
  >>> X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]])
  >>> # y = 1 * x_0 + 2 * x_1 + 3
  >>> y = np.dot(X, np.array([1, 2])) + 3
  >>> reg = LinearRegression().fit(X, y)
  >>> reg.score(X, y)
  1.0
  >>> reg.coef_
  array([1., 2.])
  >>> reg.intercept_
  3.0...
  >>> reg.predict(np.array([[3, 5]]))
  array([16.])
class_docstr_tok: ["Ordinary","least","squares","Linear","Regression",".","LinearRegression","fits","a","linear","model","with","coefficients","w","=","(","w1",",","...",",","wp",")","to","minimize","the","residual","sum","of","squares","between","the","observed","targets","in","the","dataset",",","and","the","targets","predicted","by","the","linear","approximation",".","Parameters","--","--","--","--","--","fit_intercept",":","bool",",","default=True","Whether","to","calculate","the","intercept","for","this","model",".","If","set","to","False",",","no","intercept","will","be","used","in","calculations","(","i.e",".","data","is","expected","to","be","centered",")",".","copy_X",":","bool",",","default=True","If","True",",","X","will","be","copied",";","else",",","it","may","be","overwritten",".","n_jobs",":","int",",","default=None","The","number","of","jobs","to","use","for","the","computation",".","This","will","only","provide","speedup","in","case","of","sufficiently","large","problems",",","that","is","if","firstly","`","n_targets",">","1","`","and","secondly","`","X","`","is","sparse","or","if","`","positive","`","is","set","to","`","True","`",".","``","None","``","means","1","unless","in","a",":","obj",":","`","joblib.parallel_backend","`","context",".","``","-1","``","means","using","all","processors",".","See",":","term",":","`","Glossary","<","n_jobs",">","`","for","more","details",".","positive",":","bool",",","default=False","When","set","to","``","True","``",",","forces","the","coefficients","to","be","positive",".","This","option","is","only","supported","for","dense","arrays",".","..","versionadded",":",":","0.24","Attributes","--","--","--","--","--","coef_",":","array","of","shape","(","n_features",",",")","or","(","n_targets",",","n_features",")","Estimated","coefficients","for","the","linear","regression","problem",".","If","multiple","targets","are","passed","during","the","fit","(","y","2D",")",",","this","is","a","2D","array","of","shape","(","n_targets",",","n_features",")",",","while","if","only","one","target","is","passed",",","this","is","a","1D","array","of","length","n_features",".","rank_",":","int","Rank","of","matrix","`","X","`",".","Only","available","when","`","X","`","is","dense",".","singular_",":","array","of","shape","(","min","(","X",",","y",")",",",")","Singular","values","of","`","X","`",".","Only","available","when","`","X","`","is","dense",".","intercept_",":","float","or","array","of","shape","(","n_targets",",",")","Independent","term","in","the","linear","model",".","Set","to","0.0","if","`","fit_intercept","=","False","`",".","n_features_in_",":","int","Number","of","features","seen","during",":","term",":","`","fit","`",".","..","versionadded",":",":","0.24","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during",":","term",":","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","1.0","See","Also","--","--","--","--","Ridge",":","Ridge","regression","addresses","some","of","the","problems","of","Ordinary","Least","Squares","by","imposing","a","penalty","on","the","size","of","the","coefficients","with","l2","regularization",".","Lasso",":","The","Lasso","is","a","linear","model","that","estimates","sparse","coefficients","with","l1","regularization",".","ElasticNet",":","Elastic-Net","is","a","linear","regression","model","trained","with","both","l1","and","l2","-norm","regularization","of","the","coefficients",".","Notes","--","--","-","From","the","implementation","point","of","view",",","this","is","just","plain","Ordinary","Least","Squares","(","scipy.linalg.lstsq",")","or","Non","Negative","Least","Squares","(","scipy.optimize.nnls",")","wrapped","as","a","predictor","object",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.linear_model","import","LinearRegression",">",">",">","X","=","np.array","(","[","[","1",",","1","]",",","[","1",",","2","]",",","[","2",",","2","]",",","[","2",",","3","]","]",")",">",">",">","#","y","=","1","*","x_0","+","2","*","x_1","+","3",">",">",">","y","=","np.dot","(","X",",","np.array","(","[","1",",","2","]",")",")","+","3",">",">",">","reg","=","LinearRegression","(",")",".fit","(","X",",","y",")",">",">",">","reg.score","(","X",",","y",")","1.0",">",">",">","reg.coef_","array","(","[","1.",",","2",".","]",")",">",">",">","reg.intercept_","3.0","...",">",">",">","reg.predict","(","np.array","(","[","[","3",",","5","]","]",")",")","array","(","[","16",".","]",")"]
code: def __init__(
      self,
      *,
      fit_intercept=True,
      copy_X=True,
      n_jobs=None,
      positive=False,
  ):
      self.fit_intercept = fit_intercept
      self.copy_X = copy_X
      self.n_jobs = n_jobs
      self.positive = positive
  
imports: import numbers
  import warnings
  from abc import ABCMeta, abstractmethod
  from numbers import Integral
  import numpy
  import scipy.sparse
  from scipy import linalg, optimize, sparse
  from scipy.sparse.linalg import lsqr
  from scipy.special import expit
  from ..base import BaseEstimator, ClassifierMixin, MultiOutputMixin, RegressorMixin, _fit_context
  from ..utils import check_array, check_random_state
  from ..utils._array_api import get_namespace
  from ..utils._seq_dataset import ArrayDataset32, ArrayDataset64, CSRDataset32, CSRDataset64
  from ..utils.extmath import safe_sparse_dot
  from ..utils.parallel import Parallel, delayed
  from ..utils.sparsefuncs import mean_variance_axis
  from ..utils.validation import FLOAT_DTYPES, _check_sample_weight, check_is_fitted
label_desc: Use image node_id 1 to create a new LinearRegression object from inherited base classes: MultiOutputMixin, RegressorMixin, LinearModel with example: obj = LinearRegression()