machine learning for instrumental variable (IV) regression
Project description
mliv
from mliv.dataset.demand import gen_data
from mliv.utils import CausalDataset
gen_data()
data = CausalDataset('./Data/Demand/0.5_1.0_0.0_10000/1/')
from mliv.inference import Vanilla2SLS
from mliv.inference import Poly2SLS
from mliv.inference import NN2SLS
from mliv.inference import OneSIV
from mliv.inference import KernelIV
from mliv.inference import DualIV
from mliv.inference import DFL
from mliv.inference import AGMM
from mliv.inference import DeepGMM
from mliv.inference import DFIV
try:
from mliv.inference import DeepIV
except:
pass
for mod in [OneSIV,KernelIV,DualIV,DFL,AGMM,DeepGMM,DFIV,Vanilla2SLS,Poly2SLS,NN2SLS]:
try:
model = mod()
model.config['num'] = 100
model.config['epochs'] = 10
model.fit(data)
print(mod)
except:
print('Error: ...')
try:
model = DeepIV()
model.config['num'] = 100
model.config['epochs'] = 10
model.fit(data)
print(mod)
except:
print(f'Error: ...{mod}...')
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
mliv-0.0.1.tar.gz
(41.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
mliv-0.0.1-py3-none-any.whl
(53.7 kB
view details)
File details
Details for the file mliv-0.0.1.tar.gz.
File metadata
- Download URL: mliv-0.0.1.tar.gz
- Upload date:
- Size: 41.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17fbdeeb93694844f24a2f26aa10a2400807c221f6494894a316c2343f3233a5
|
|
| MD5 |
8ea9c5ae6af2618b39eae7567c78218b
|
|
| BLAKE2b-256 |
01dc619808636650271f037201e15b2fe0fcd8db7654dcf29d61ed958b08ed2d
|
File details
Details for the file mliv-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mliv-0.0.1-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c32b2a84bbdfadf888585ed218aa67da23cd072ab4efb9273aa82df62b39277d
|
|
| MD5 |
9c7d24ac19fb265eef83346a4395ee65
|
|
| BLAKE2b-256 |
d7ac0dfc75018cee23e55ae06272272ab97fc4d1db26ba79c0ad52e7d493e45c
|