Skip to main content

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)

Release files for double-debias 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for double-debias 0.0.5
File Size Uploaded
double_debias-0.0.5.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for double-debias 0.0.5
File Interpreter ABI Platform
double_debias-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size:10.1 kB

Release files / double_debias-0.0.5.tar.gz

Download URL double_debias-0.0.5.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96372903d2021a22eecc15bac71bccac348c33a1e51b147bcaf5ac1bf2b4cba9
BLAKE2b-256 checksum
How to use checksums
8cce74257b20b32a7821a877c591037ca4a928dbbfca1fcde3136e5bccf8d95e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / double_debias-0.0.5-py3-none-any.whl

Download URL double_debias-0.0.5-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ade1f2349209b6da25ae5a7cd061ed9c34b9d203343b461c137bd2ad6d95f84
BLAKE2b-256 checksum
How to use checksums
a64cef961365adda2f4a21ff5cb227c8a83281a5fe6d1dab4d6e7a6799301eb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page