Member-only story

Is sklearn’s Huber Regressor better than LinearRegression?

Crystal X
4 min readJul 21, 2023

--

For the last two days I have been working on a machine learning concept, but was unable to progress because it required more memory than my tiny computer and free version of Google Colab could accommodate. Because I was at a crossroad in my machine learning activity, I decided to try out another model that was similar, the HuberRegressor.

Scikit-learn’s HuberRegressor is a linear regression model that combines the best attributes of both ordinary least squares (OLS) regression and robust regression. It is designed to be less sensitive to outliers compared to OLS regression, making it more suitable for datasets with noise or outliers.

The HuberRegressor loss function is a combination of the squared loss (similar to OLS) for data points close to the prediction and the absolute loss (similar to L1 regression or Lasso) for data points far from the prediction. This combination of squared and absolute loss functions results in a more robust regression model that is less influenced by extreme outliers.

Here are the key features of Scikit-learn’s HuberRegressor:

  1. Robustness to Outliers: HuberRegressor reduces the impact of outliers on the regression model, making it more robust to noisy data.
  2. Tunable Sensitivity: The robustness of the HuberRegressor can…

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

Responses (2)