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 valuesy_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
- Krivonosov Mikhail
- Khabarova Tatiana
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for regression_bias_corrector-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e50aad1a044e485889dc85b4f577d5ce94dafc5ace1d21d86af3fed80e27165 |
|
MD5 | edb3318e43c232cd82ff3dcb2012df75 |
|
BLAKE2b-256 | 5fff247efefede6712d3510d001f58e1892ecbfe7d732df5e2dfc99ec707ace4 |
Hashes for regression_bias_corrector-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bca8c77b08e54af04862cc5194c96e301c22be0cf99280278f0e269b3436913d |
|
MD5 | 17f9cabec40498a86ab0df8a7535c87b |
|
BLAKE2b-256 | 9b0ee5553f1c8e16f577f478afda7b6da0639e1ae9d22d6dba1d4d1c6f66484a |