Skip to main content

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


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.2.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

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

mliv-0.0.2-py3-none-any.whl (53.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mliv-0.0.2.tar.gz
  • Upload date:
  • Size: 41.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.0

File hashes

Hashes for mliv-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1d612caea8600bb865a8ca1455a5b9438f7c0372f2448fbd616139b717ebe000
MD5 dea43fcce99db78bc16d6170040e3cc4
BLAKE2b-256 058f0b44a8cd513172d8e55cbcef34c901662213cfe539be08aa95f89d039b81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mliv-0.0.2-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

Hashes for mliv-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 92502b0b3b637b3e537991033a533e0e362d8facb4ce2d8cea5388daad30fed4
MD5 c504f12097e1b418f660b05e1857f9c1
BLAKE2b-256 c8f921f5ad98e1e647e1bcb0e87f969c1e8cf9f3fab0fe59dac13efec20172bb

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