Skip to main content

Robust linear regression (Huber, LAD, RANSAC, Theil–Sen) for Orange.

Project description

Robust Regression for Orange

This Orange add-on adds two widgets for learning how regression behaves when a data set contains outliers.

Ordinary linear regression fits the line or plane that minimizes squared error. That makes large errors very influential: a few unusual rows can pull the model away from the main pattern. Robust regression methods reduce that effect in different ways.

Widgets

Robust Regression

Fits a robust linear regression learner. The widget currently includes:

  • Huber: behaves like ordinary least squares for small residuals, but gives less influence to large residuals.
  • Least Absolute Deviation: fits by absolute error when the quantile is 0.5, so it targets the conditional median rather than the conditional mean. You can change the quantile to fit lower or upper conditional quantiles.
  • RANSAC: repeatedly fits candidate models from small subsets, then keeps the model supported by the largest group of inliers.
  • Theil-Sen: estimates slopes from many small subsets and combines them in a way that is resistant to outliers.

The widget outputs a learner for Test and Score and Predictions. If you connect a data set with a continuous target variable, it also outputs a fitted model, a coefficient table, and an annotated data table.

Robust Scale

Centers continuous features by the median and scales them by a quantile range, usually the interquartile range. This is useful when large values should not determine the scale of a feature.

Suggested Workflow

  1. Add File or Datasets.
  2. Add Select Columns and choose a continuous target variable.
  3. Add Robust Regression.
  4. Connect Robust Regression to Test and Score or Predictions.
  5. Connect the Annotated Data output to Data Table to inspect residuals.
  6. Connect the Coefficients output to Data Table to inspect fitted terms.

The demo workflow in docs/examples/robust-regression-demo.ows shows this layout:

Orange workflow using Robust Regression

One set of widget settings looks like this:

Robust Regression widget settings

What To Inspect

The Annotated Data output adds:

  • the model prediction for each row;
  • the residual, computed as actual value minus prediction;
  • a RANSAC inlier flag when RANSAC is selected.

The Coefficients output lists the intercept and fitted coefficients when the selected method exposes them. These are useful for comparing robust fits with ordinary linear regression on the same data.

Notes

Do not use Robust Scale before Robust Regression if the regression widget's internal scaling checkbox is also enabled, because that scales continuous features twice.

Developer setup and release notes are in DEVELOPMENT.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orange3_robust-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orange3_robust-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file orange3_robust-0.1.0.tar.gz.

File metadata

  • Download URL: orange3_robust-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for orange3_robust-0.1.0.tar.gz
Algorithm Hash digest
SHA256 63cd72ef868e664cce11ec702762a03e85652e2a0568303b9cc0b77753babadf
MD5 b48affaff7516d669348415f28438954
BLAKE2b-256 f70ab1ab414109197642385b9c84fc1548e90ac9fe22137a4d5f4c2158f2b917

See more details on using hashes here.

File details

Details for the file orange3_robust-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: orange3_robust-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for orange3_robust-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb3f0c7d55743e226b06af1eeebc040c376aa746bb6f1897861ea85a427a913f
MD5 8c02f8143f1a5243e2adc7a499b03ecf
BLAKE2b-256 e37d6de981aaf78bf3bba6bb5ae79acdb72e7acc7a692d0450f56d84f22a65b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page