Skip to main content

A set of Regression Wrappers that combats bias in data for machine learning models through custom regularization techniques.

Project description

Bias Wrappers

Wrappers for standard multioutput machine learning regressors that apply regularization to training to produce better testing results, with a bias factor. Used mainly to combat bias on seemingly random/biased data. Default models are Linear Regression, however, you can input your own machine learning models with the model param.

BiasRegressorC1 uses a progressive regularization method to calculate a penalty to add to data, to prevent overfitting or underfitting due to noise via bias (explicit regularization).

BiasRegressorC2 uses another regression model to fit on incorrect predictions and correct answers, to identify patterns of overfitting or underfitting and arrive at a more correct answer (implicit regularization).

Fixes

0.5.1

Redid a lot more of the C1 method to allow for more subtle changes in the right direction: it now closely matches the FakeWrapper but is a lil different. Also, removed features from the postModel of C2 to allow for more pure error learning. Also, renamed FakeWrapper to RandomWrapper.

0.5.0

Redid most of the C1 method to allow multi-output and specialized penalties through regularization. Also, created a "Fake Wrapper" that applies random penalties from 0 to 1 to test the C1 method fairly, proving the use of the specific penalties. Also, improved compatibility with native sklearn commands for metrics and model selection.

0.4.1

Small fixes regarding integration with some data, should work for all dimensions in the event of layered array for y_preds. Also, changed the dataset to use the default sklearn diabetes dataset instead of a Friedman problem, and rewrote some commands for clarity.

0.4.0

Made many fixes to original BiasRegressor, now BiasRegressorC1, and added a second one incorporating machine learning regularization through generated features.

0.3.1

Fixed Array/List Contradiction in regression, removed classifier for code compatibility, and removed a few print statements.

Removed classifier because the formula used only benefits regression problems.

Instructions

  1. Install the package with pip:
pip install biaswrappers
  1. Python Quickstart:
# Import one of the regressors from the package, regressor
from biaswrappers import regressor
from biaswrappers.baseline_tests import test_regression

# Initialize cregressor and...
# Specify a model class (or multiple, for C2) with a fit and predict method as a param.
my_regressor = regressor.BiasRegressorC1()

# Look at the baseline_tests module for easy tests
test_regression(model=my_regressor) # No return values, just prints results

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

biaswrappers-0.5.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

biaswrappers-0.5.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file biaswrappers-0.5.1.tar.gz.

File metadata

  • Download URL: biaswrappers-0.5.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for biaswrappers-0.5.1.tar.gz
Algorithm Hash digest
SHA256 046fb237f8a241b12a6315941972eaab21e0915dcea5762173b152076382831e
MD5 e1ee363150e80793dbae5b7e9f022fe7
BLAKE2b-256 15a3f077fe2aa29209917e6a532ea6fd19a1d302cb8279bd8152cab915e85477

See more details on using hashes here.

File details

Details for the file biaswrappers-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: biaswrappers-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for biaswrappers-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69627af8183994a06e8bddbfad4a41db83b37adf4715be51aa07bff91b429920
MD5 ce1625e6dbd96e1672fa908d1b3c8aba
BLAKE2b-256 b608ae569026563ac57999f14ec67605e740a09b2a66f867ce9c1a7c847d808f

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