Skip to main content

Implements Double Debias Estimator

Project description

double_debias

Basic Build

This package implements the double debiased estimator from "Double/Debiased Machine Learning for Treatment and Structural Parameters" by Chernozhukov et. al.

installation

pip install double_debias_joe5saia

Usage

This package estimates models of the form y = theta D + g(z) + e where z is a high dimensional object.

from sklearn.ensemble import GradientBoostingRegressor
from sklearn.linear_model import LinearRegression
dd = double_debias(y=np.array([i for i in range(0,10)]), 
                   D= np.array([i//2 for i in range(0,10)]),
                   p.array([[i**2 for i in range(0,10)], [i**3 for i in range(0,10)]]).transpose(),
                   y_method= GradientBoostingRegressor(n_estimators=1000),
                   D_method= LinearRegression(),
                   n_folds=3)
dd.est_theta()

The user initializes the estimator object with the data for y, D, and z along with the method for estimating y ~ g(z) + e and D ~ f(z) + e. The y_method and D_method can be any model from the sklearn library that implements the fit and predict methods. The user may also supply their own class that implements these methods. This class does no parameter tuning or cross validation. Parameter tuning is left up to the user.

Custom Estimator Methods

The user may supply their own estimators if these are not available in sklearn. This module assumes that the class passed has the fit and predict methods, i.e. the following code must work

z = np.array([[i**2 for i in range(0,10)], [i**3 for i in range(0,10)]]).transpose()
y = np.array([i for i in range(0,10)])
m = my_estimator()
m.fit(z, y)
m.predict(z)

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

double_debias-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

double_debias-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: double_debias-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for double_debias-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bef6da2024fffee8116169086b7bcd63ac3a69748735dbc3dda7ed39a7868a3c
MD5 55961b0190b33f1e351fd43973039c1f
BLAKE2b-256 c8df79ee378cd923857469f8c8bb2da87d4bd2a6b6599821d40098fee2a5ac44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: double_debias-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for double_debias-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ea78707b47dda0cf8fc49f0200158fe1c394f4a551f0b501e7d33a462ad0a8
MD5 ff3d1bb132241f3ac8436be654eaffa8
BLAKE2b-256 29679c693ae05bff3524673479b0daef6edeecc4c171df6750776b8f7063253c

See more details on using hashes here.

Supported by

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