Skip to main content

Bias correction of regression ML models

Project description

Regression bias corrector

Package is aimed to correct regression fit by any machine learning model that underestimate high values and overestimate low values of outcome variable (1D case). The problem usually arises in case when metrics like MSE and MAE shows better results in biased predictions.

Algorithm

Now is implemeneted only linear correction for 1D case by the Linear Regression approach.

The idea is to linearly transform the y_pred to change the coefficient of linear regression between y_true and y_pred to 1. It is corresponds to the diagonal on plane y_true and y_pred that means equal pace of increasing y_pred with increasing y_true.

  • y_true - actual values
  • y_pred - predicted values

How to install

git clone https://github.com/mike-live/regression-bias-corrector.git
pip install .

How to use

# Import Linear Bias corrector
from regression-bias-corrector import LinearBiasCorrector

# Create instance of corrector
corrector = LinearBiasCorrector()

# Fit corrector on actual outcome variable and on predicted values of the model for train dataset
# y_train - actual values
# y_train_pred - predicted values
corrector.fit(y_train, y_train_pred)

# correct predicted values on test dataset
# y_test_pred - predicted values by model on test dataset
y_test_pred_unbiased = corrector.predict(y_test_pred)

# y_test_pred_unbiased - unbiased predicted values on test

Authors

Lobachevsky University

  1. Krivonosov Mikhail
  2. Khabarova Tatiana

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

regression_bias_corrector-0.0.2.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

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

regression_bias_corrector-0.0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file regression_bias_corrector-0.0.2.tar.gz.

File metadata

File hashes

Hashes for regression_bias_corrector-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0e50aad1a044e485889dc85b4f577d5ce94dafc5ace1d21d86af3fed80e27165
MD5 edb3318e43c232cd82ff3dcb2012df75
BLAKE2b-256 5fff247efefede6712d3510d001f58e1892ecbfe7d732df5e2dfc99ec707ace4

See more details on using hashes here.

Provenance

The following attestation bundles were made for regression_bias_corrector-0.0.2.tar.gz:

Publisher: release_pypi.yml on mike-live/regression-bias-corrector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file regression_bias_corrector-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for regression_bias_corrector-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bca8c77b08e54af04862cc5194c96e301c22be0cf99280278f0e269b3436913d
MD5 17f9cabec40498a86ab0df8a7535c87b
BLAKE2b-256 9b0ee5553f1c8e16f577f478afda7b6da0639e1ae9d22d6dba1d4d1c6f66484a

See more details on using hashes here.

Provenance

The following attestation bundles were made for regression_bias_corrector-0.0.2-py3-none-any.whl:

Publisher: release_pypi.yml on mike-live/regression-bias-corrector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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