class_docstr: L2-regularized linear regression model that is robust to outliers.
  
  The Huber Regressor optimizes the squared loss for the samples where
  ``|(y - Xw - c) / sigma| < epsilon`` and the absolute loss for the samples
  where ``|(y - Xw - c) / sigma| > epsilon``, where the model coefficients
  ``w``, the intercept ``c`` and the scale ``sigma`` are parameters
  to be optimized. The parameter sigma makes sure that if y is scaled up
  or down by a certain factor, one does not need to rescale epsilon to
  achieve the same robustness. Note that this does not take into account
  the fact that the different features of X may be of different scales.
  
  The Huber loss function has the advantage of not being heavily influenced
  by the outliers while not completely ignoring their effect.
  
  Read more in the :ref:`User Guide <huber_regression>`
  
  .. versionadded:: 0.18
  
  Parameters
  ----------
  epsilon : float, default=1.35
      The parameter epsilon controls the number of samples that should be
      classified as outliers. The smaller the epsilon, the more robust it is
      to outliers. Epsilon must be in the range `[1, inf)`.
  
  max_iter : int, default=100
      Maximum number of iterations that
      ``scipy.optimize.minimize(method="L-BFGS-B")`` should run for.
  
  alpha : float, default=0.0001
      Strength of the squared L2 regularization. Note that the penalty is
      equal to ``alpha * ||w||^2``.
      Must be in the range `[0, inf)`.
  
  warm_start : bool, default=False
      This is useful if the stored attributes of a previously used model
      has to be reused. If set to False, then the coefficients will
      be rewritten for every call to fit.
      See :term:`the Glossary <warm_start>`.
  
  fit_intercept : bool, default=True
      Whether or not to fit the intercept. This can be set to False
      if the data is already centered around the origin.
  
  tol : float, default=1e-05
      The iteration will stop when
      ``max{|proj g_i | i = 1, ..., n}`` <= ``tol``
      where pg_i is the i-th component of the projected gradient.
  
  Attributes
  ----------
  coef_ : array, shape (n_features,)
      Features got by optimizing the L2-regularized Huber loss.
  
  intercept_ : float
      Bias.
  
  scale_ : float
      The value by which ``|y - Xw - c|`` is scaled down.
  
  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
  
  n_iter_ : int
      Number of iterations that
      ``scipy.optimize.minimize(method="L-BFGS-B")`` has run for.
  
      .. versionchanged:: 0.20
  
          In SciPy <= 1.0.0 the number of lbfgs iterations may exceed
          ``max_iter``. ``n_iter_`` will now report at most ``max_iter``.
  
  outliers_ : array, shape (n_samples,)
      A boolean mask which is set to True where the samples are identified
      as outliers.
  
  See Also
  --------
  RANSACRegressor : RANSAC (RANdom SAmple Consensus) algorithm.
  TheilSenRegressor : Theil-Sen Estimator robust multivariate regression model.
  SGDRegressor : Fitted by minimizing a regularized empirical loss with SGD.
  
  References
  ----------
  .. [1] Peter J. Huber, Elvezio M. Ronchetti, Robust Statistics
         Concomitant scale estimates, pg 172
  .. [2] Art B. Owen (2006), A robust hybrid of lasso and ridge regression.
         https://statweb.stanford.edu/~owen/reports/hhu.pdf
  
  Examples
  --------
  >>> import numpy as np
  >>> from sklearn.linear_model import HuberRegressor, LinearRegression
  >>> from sklearn.datasets import make_regression
  >>> rng = np.random.RandomState(0)
  >>> X, y, coef = make_regression(
  ...     n_samples=200, n_features=2, noise=4.0, coef=True, random_state=0)
  >>> X[:4] = rng.uniform(10, 20, (4, 2))
  >>> y[:4] = rng.uniform(10, 20, 4)
  >>> huber = HuberRegressor().fit(X, y)
  >>> huber.score(X, y)
  -7.284...
  >>> huber.predict(X[:1,])
  array([806.7200...])
  >>> linear = LinearRegression().fit(X, y)
  >>> print("True coefficients:", coef)
  True coefficients: [20.4923...  34.1698...]
  >>> print("Huber coefficients:", huber.coef_)
  Huber coefficients: [17.7906... 31.0106...]
  >>> print("Linear Regression coefficients:", linear.coef_)
  Linear Regression coefficients: [-1.9221...  7.0226...]
class_docstr_tok: ["L2-regularized","linear","regression","model","that","is","robust","to","outliers",".","The","Huber","Regressor","optimizes","the","squared","loss","for","the","samples","where","``","|","(","y","-","Xw","-","c",")","\/","sigma|","<","epsilon","``","and","the","absolute","loss","for","the","samples","where","``","|","(","y","-","Xw","-","c",")","\/","sigma|",">","epsilon","``",",","where","the","model","coefficients","``","w","``",",","the","intercept","``","c","``","and","the","scale","``","sigma","``","are","parameters","to","be","optimized",".","The","parameter","sigma","makes","sure","that","if","y","is","scaled","up","or","down","by","a","certain","factor",",","one","does","not","need","to","rescale","epsilon","to","achieve","the","same","robustness",".","Note","that","this","does","not","take","into","account","the","fact","that","the","different","features","of","X","may","be","of","different","scales",".","The","Huber","loss","function","has","the","advantage","of","not","being","heavily","influenced","by","the","outliers","while","not","completely","ignoring","their","effect",".","Read","more","in","the",":","ref",":","`","User","Guide","<","huber_regression",">","`","..","versionadded",":",":","0.18","Parameters","--","--","--","--","--","epsilon",":","float",",","default=1.35","The","parameter","epsilon","controls","the","number","of","samples","that","should","be","classified","as","outliers",".","The","smaller","the","epsilon",",","the","more","robust","it","is","to","outliers",".","Epsilon","must","be","in","the","range","`","[","1",",","inf",")","`",".","max_iter",":","int",",","default=100","Maximum","number","of","iterations","that","``","scipy.optimize.minimize","(","method=","''","L-BFGS-B","''",")","``","should","run","for",".","alpha",":","float",",","default=0.0001","Strength","of","the","squared","L2","regularization",".","Note","that","the","penalty","is","equal","to","``","alpha","*","||w||^2","``",".","Must","be","in","the","range","`","[","0",",","inf",")","`",".","warm_start",":","bool",",","default=False","This","is","useful","if","the","stored","attributes","of","a","previously","used","model","has","to","be","reused",".","If","set","to","False",",","then","the","coefficients","will","be","rewritten","for","every","call","to","fit",".","See",":","term",":","`","the","Glossary","<","warm_start",">","`",".","fit_intercept",":","bool",",","default=True","Whether","or","not","to","fit","the","intercept",".","This","can","be","set","to","False","if","the","data","is","already","centered","around","the","origin",".","tol",":","float",",","default=1e-05","The","iteration","will","stop","when","``","max","{","|proj","g_i","|","i","=","1",",","...",",","n","}","``","<","=","``","tol","``","where","pg_i","is","the","i-th","component","of","the","projected","gradient",".","Attributes","--","--","--","--","--","coef_",":","array",",","shape","(","n_features",",",")","Features","got","by","optimizing","the","L2-regularized","Huber","loss",".","intercept_",":","float","Bias",".","scale_",":","float","The","value","by","which","``","|y","-","Xw","-","c|","``","is","scaled","down",".","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","n_iter_",":","int","Number","of","iterations","that","``","scipy.optimize.minimize","(","method=","''","L-BFGS-B","''",")","``","has","run","for",".","..","versionchanged",":",":","0.20","In","SciPy","<","=","1.0.0","the","number","of","lbfgs","iterations","may","exceed","``","max_iter","``",".","``","n_iter_","``","will","now","report","at","most","``","max_iter","``",".","outliers_",":","array",",","shape","(","n_samples",",",")","A","boolean","mask","which","is","set","to","True","where","the","samples","are","identified","as","outliers",".","See","Also","--","--","--","--","RANSACRegressor",":","RANSAC","(","RANdom","SAmple","Consensus",")","algorithm",".","TheilSenRegressor",":","Theil-Sen","Estimator","robust","multivariate","regression","model",".","SGDRegressor",":","Fitted","by","minimizing","a","regularized","empirical","loss","with","SGD",".","References","--","--","--","--","--","..","[","1","]","Peter","J.","Huber",",","Elvezio","M.","Ronchetti",",","Robust","Statistics","Concomitant","scale","estimates",",","pg","172","..","[","2","]","Art","B.","Owen","(","2006",")",",","A","robust","hybrid","of","lasso","and","ridge","regression",".","https",":","\/\/statweb.stanford.edu\/~owen\/reports\/hhu.pdf","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.linear_model","import","HuberRegressor",",","LinearRegression",">",">",">","from","sklearn.datasets","import","make_regression",">",">",">","rng","=","np.random.RandomState","(","0",")",">",">",">","X",",","y",",","coef","=","make_regression","(","...","n_samples=200",",","n_features=2",",","noise=4.0",",","coef=True",",","random_state=0",")",">",">",">","X","[",":4","]","=","rng.uniform","(","10",",","20",",","(","4",",","2",")",")",">",">",">","y","[",":4","]","=","rng.uniform","(","10",",","20",",","4",")",">",">",">","huber","=","HuberRegressor","(",")",".fit","(","X",",","y",")",">",">",">","huber.score","(","X",",","y",")","-7.284","...",">",">",">","huber.predict","(","X","[",":1",",","]",")","array","(","[","806.7200","...","]",")",">",">",">","linear","=","LinearRegression","(",")",".fit","(","X",",","y",")",">",">",">","print","(","``","True","coefficients",":","''",",","coef",")","True","coefficients",":","[","20.4923","...","34.1698","...","]",">",">",">","print","(","``","Huber","coefficients",":","''",",","huber.coef_",")","Huber","coefficients",":","[","17.7906","...","31.0106","...","]",">",">",">","print","(","``","Linear","Regression","coefficients",":","''",",","linear.coef_",")","Linear","Regression","coefficients",":","[","-1.9221","...","7.0226","...","]"]
code: def __init__(
      self,
      *,
      epsilon=1.35,
      max_iter=100,
      alpha=0.0001,
      warm_start=False,
      fit_intercept=True,
      tol=1e-05,
  ):
      self.epsilon = epsilon
      self.max_iter = max_iter
      self.alpha = alpha
      self.warm_start = warm_start
      self.fit_intercept = fit_intercept
      self.tol = tol
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/linear_model/_huber.py
imports: from numbers import Integral, Real
  import numpy
  from scipy import optimize
  from ..base import BaseEstimator, RegressorMixin, _fit_context
  from ..utils import axis0_safe_slice
  from ..utils._param_validation import Interval
  from ..utils.extmath import safe_sparse_dot
  from ..utils.optimize import _check_optimize_result
  from ..utils.validation import _check_sample_weight
  from ._base import LinearModel
label_desc: Use image node_id 1 to create a new HuberRegressor object from inherited base classes: LinearModel, RegressorMixin, BaseEstimator with example: obj = HuberRegressor()