From 315047d1c1a7fcd9fcfd80caa4fe590875880870 Mon Sep 17 00:00:00 2001 From: "Christine P. Chai" Date: Thu, 22 Dec 2022 14:42:10 -0800 Subject: [PATCH 01/22] Corrected typos in the references Signed-off-by: star1327p --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 11841a915..134c30122 100644 --- a/README.md +++ b/README.md @@ -715,20 +715,20 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio Athey, Susan, and Stefan Wager. **Policy learning with observational data.** -Econometrica 89.1 (2021): 133-161. +[*Econometrica 89.1, 133-161*](https://doi.org/10.3982/ECTA15732), 2021. X Nie, S Wager. **Quasi-Oracle Estimation of Heterogeneous Treatment Effects.** -[*Biometrika*](https://doi.org/10.1093/biomet/asaa076), 2020 +[*Biometrika 108.2, 299-319*](https://doi.org/10.1093/biomet/asaa076), 2021. V. Syrgkanis, V. Lei, M. Oprescu, M. Hei, K. Battocchi, G. Lewis. **Machine Learning Estimation of Heterogeneous Treatment Effects with Instruments.** -[*Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS)*](https://arxiv.org/abs/1905.10176), 2019 +[*Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS)*](https://arxiv.org/abs/1905.10176), 2019. **(Spotlight Presentation)** D. Foster, V. Syrgkanis. **Orthogonal Statistical Learning.** -[*Proceedings of the 32nd Annual Conference on Learning Theory (COLT)*](https://arxiv.org/pdf/1901.09036.pdf), 2019 +[*Proceedings of the 32nd Annual Conference on Learning Theory (COLT)*](https://arxiv.org/pdf/1901.09036.pdf), 2019. **(Best Paper Award)** M. Oprescu, V. Syrgkanis and Z. S. Wu. @@ -757,4 +757,4 @@ V. Chernozhukov, D. Chetverikov, M. Demirer, E. Duflo, C. Hansen, and a. W. Newe Dudik, M., Erhan, D., Langford, J., & Li, L. **Doubly robust policy evaluation and optimization.** -Statistical Science, 29(4), 485-511, 2014. +[*Statistical Science, 29(4), 485-511*](https://projecteuclid.org/journals/statistical-science/volume-29/issue-4/Doubly-Robust-Policy-Evaluation-and-Optimization/10.1214/14-STS500.full), 2014. From 91c1aaa302ecc4f6c388281b07f605d5d5b8bf0f Mon Sep 17 00:00:00 2001 From: Keith Battocchi Date: Tue, 17 Jan 2023 10:55:10 -0500 Subject: [PATCH 02/22] Refactor DynamicDML to remove incompatible method signatures Signed-off-by: star1327p --- econml/panel/dml/_dml.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/econml/panel/dml/_dml.py b/econml/panel/dml/_dml.py index 32207565b..2cfd1f1bb 100644 --- a/econml/panel/dml/_dml.py +++ b/econml/panel/dml/_dml.py @@ -547,32 +547,29 @@ def _gen_model_t(self): def _gen_model_final(self): return StatsModelsLinearRegression(fit_intercept=False) - def _gen_ortho_learner_model_nuisance(self, n_periods): + def _gen_ortho_learner_model_nuisance(self): return _DynamicModelNuisance( model_t=self._gen_model_t(), model_y=self._gen_model_y(), - n_periods=n_periods) + n_periods=self._n_periods) - def _gen_ortho_learner_model_final(self, n_periods): + def _gen_ortho_learner_model_final(self): wrapped_final_model = _DynamicFinalWrapper( StatsModelsLinearRegression(fit_intercept=False), fit_cate_intercept=self.fit_cate_intercept, featurizer=self.featurizer, use_weight_trick=False) - return _LinearDynamicModelFinal(wrapped_final_model, n_periods=n_periods) + return _LinearDynamicModelFinal(wrapped_final_model, n_periods=self._n_periods) def _prefit(self, Y, T, *args, groups=None, only_final=False, **kwargs): + # we need to set the number of periods before calling super()._prefit, since that will generate the + # final and nuisance models, which need to have self._n_periods set u_periods = np.unique(np.unique(groups, return_counts=True)[1]) if len(u_periods) > 1: raise AttributeError( "Imbalanced panel. Method currently expects only panels with equal number of periods. Pad your data") self._n_periods = u_periods[0] - # generate an instance of the final model - self._ortho_learner_model_final = self._gen_ortho_learner_model_final(self._n_periods) - if not only_final: - # generate an instance of the nuisance model - self._ortho_learner_model_nuisance = self._gen_ortho_learner_model_nuisance(self._n_periods) - TreatmentExpansionMixin._prefit(self, Y, T, *args, **kwargs) + super()._prefit(Y, T, *args, **kwargs) def _postfit(self, Y, T, *args, **kwargs): super()._postfit(Y, T, *args, **kwargs) From 4eaefdd8bacc6215310f5f17ecf0e21f21feb424 Mon Sep 17 00:00:00 2001 From: Keith Battocchi Date: Tue, 14 Mar 2023 15:40:16 -0400 Subject: [PATCH 03/22] Enable GitHub Actions Signed-off-by: Keith Battocchi Signed-off-by: star1327p --- .github/workflows/ci.yml | 230 ++++++++++++++ .github/workflows/publish-documentation.yml | 80 +++++ .github/workflows/publish-package.yml | 117 +++++++ azure-pipelines-steps.yml | 65 ---- azure-pipelines.yml | 333 -------------------- setup.cfg | 4 +- 6 files changed, 429 insertions(+), 400 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish-documentation.yml create mode 100644 .github/workflows/publish-package.yml delete mode 100644 azure-pipelines-steps.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..82ba25bc6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,230 @@ +name: Run all checks for pull requests + +on: + pull_request: + branches: + - main + workflow_dispatch: + inputs: + ref: + description: 'The git ref to build the package for' + required: false + default: '' + type: string + +# Precompute the ref if the workflow was triggered by a workflow dispatch rather than copying this logic repeatedly +env: + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }} + +jobs: + eval: + name: Evaluate changes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ env.ref }} + fetch-depth: 2 + + # We want to enforce the following rules for PRs: + # * if all modifications are to README.md + # no testing is needed + # * if there are modifications to docs/* or to any code + # then docs need to be built to verify consistency + # * if there are modifications to notebooks/* or to any code + # then notebooks need to be run to verify consistency + # * for any code changes (or changes to metadata files) + # linting and testing should be run + # For a PR build, HEAD will be the merge commit, and we want to diff against the base branch, + # which will be the first parent: HEAD^ + # (For non-PR changes, we will always perform all CI tasks) + # Note that GitHub Actions provides path filters, but they operate at the workflow level, not the job level + - run: | + if ($env:GITHUB_EVENT_NAME -eq 'pull_request') { + $editedFiles = git diff HEAD^ --name-only + $editedFiles # echo edited files to enable easier debugging + $codeChanges = $false + $docChanges = $false + $nbChanges = $false + $changeType = "none" + foreach ($file in $editedFiles) { + switch -Wildcard ($file) { + "README.md" { Continue } + ".gitignore" { Continue } + "econml/_version.py" { Continue } + "prototypes/*" { Continue } + "images/*" { Continue } + "doc/*" { $docChanges = $true; Continue } + "notebooks/*" { $nbChanges = $true; Continue } + default { $codeChanges = $true; Continue } + } + } + } + echo "buildDocs=$(($env:GITHUB_EVENT_NAME -ne 'pull_request') -or ($docChanges -or $codeChanges))" >> $env:GITHUB_OUTPUT + echo "buildNbs=$(($env:GITHUB_EVENT_NAME -ne 'pull_request') -or ($nbChanges -or $codeChanges))" >> $env:GITHUB_OUTPUT + echo "testCode=$(($env:GITHUB_EVENT_NAME -ne 'pull_request') -or $codeChanges)" >> $env:GITHUB_OUTPUT + shell: pwsh + name: Determine type of code change + id: eval + outputs: + buildDocs: ${{ steps.eval.outputs.buildDocs }} + buildNbs: ${{ steps.eval.outputs.buildNbs }} + testCode: ${{ steps.eval.outputs.testCode }} + + lint: + name: Lint code + needs: [eval] + if: ${{ needs.eval.outputs.testCode == 'True' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ env.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: 3.9 + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: 'pip install pycodestyle && pycodestyle econml' + + notebooks: + name: Run notebooks + needs: [eval] + if: ${{ needs.eval.outputs.buildNbs == 'True' }} + runs-on: ubuntu-latest + strategy: + matrix: + kind: [except customer scenarios, customer scenarios] + include: + - kind: "except customer scenarios" + extras: "[tf,plt]" + pattern: "(?!CustomerScenarios)" + install_graphviz: true + version: 3.8 # no supported version of tensorflow for 3.9 + - kind: "customer scenarios" + extras: "[plt,dowhy]" + pattern: "CustomerScenarios" + version: 3.9 + install_graphviz: false + fail-fast: false + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ env.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: ${{ matrix.version }} + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: sudo apt-get -yq install graphviz + name: Install graphviz + if: ${{ matrix.install_graphviz }} + - run: pip install -e .${{ matrix.extras }} + name: Install econml + - run: pip install pytest pytest-runner jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm + name: Install test and notebook requirements + - run: pip list + name: List installed packages + - run: python setup.py pytest + name: Run notebook tests + env: + PYTEST_ADDOPTS: '-m "notebook"' + NOTEBOOK_DIR_PATTERN: ${{ matrix.pattern }} + + tests: + name: "Run tests" + needs: [eval] + if: ${{ needs.eval.outputs.testCode == 'True' }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + kind: [serial, other, dml, main, treatment] + exclude: + # Serial tests fail randomly on mac sometimes, so we don't run them there + - os: macos-latest + kind: serial + # Python 3.6 isn't supported on ubuntu-latest + - os: ubuntu-latest + python-version: 3.6 + + # Assign the correct package and testing options for each kind of test + include: + - kind: serial + opts: '-m "serial" -n 1' + extras: "[tf,plt]" + - kind: other + opts: '-m "cate_api" -n auto' + extras: "[tf,plt]" + - kind: dml + opts: '-m "dml"' + extras: "[tf,plt]" + - kind: main + opts: '-m "not (notebook or automl or dml or serial or cate_api or treatment_featurization)" -n 2' + extras: "[tf,plt,dowhy]" + - kind: treatment + opts: '-m "treatment_featurization" -n auto' + extras: "[tf,plt]" + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ env.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: pip install -e .${{ matrix.extras }} + name: Install econml + - run: pip install pytest pytest-runner coverage + name: Install pytest + - run: python setup.py pytest + name: Run tests + env: + PYTEST_ADDOPTS: ${{ matrix.opts }} + COVERAGE_PROCESS_START: 'setup.cfg' + # todo: publish test results, coverage info + + build: + name: Build package + needs: [eval] + if: ${{ needs.eval.outputs.testCode == 'True' }} + uses: ./.github/workflows/publish-package.yml + with: + publish: false + repository: testpypi + # don't have access to env context here for some reason + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }} + + docs: + name: Build documentation + needs: [eval] + if: ${{ needs.eval.outputs.buildDocs == 'True' }} + uses: ./.github/workflows/publish-documentation.yml + with: + publish: false + environment: test + # don't have access to env context here for some reason + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }} + + verify: + name: Verify CI checks + needs: [lint, notebooks, tests, build, docs] + if: always() + runs-on: ubuntu-latest + steps: + - run: exit 1 + name: At least one check failed or was cancelled + if: ${{ !(success()) }} + - run: exit 0 + name: All checks passed + if: ${{ success() }} diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml new file mode 100644 index 000000000..dc44f986a --- /dev/null +++ b/.github/workflows/publish-documentation.yml @@ -0,0 +1,80 @@ +name: Build and publish the documentation +on: + workflow_dispatch: + inputs: + publish: + description: 'Whether to publish the documentation (as opposed to just building it)' + required: false + default: true + type: boolean + environment: + description: 'Whether to publish to production or test environment' + required: false + default: prod + type: choice + options: [prod, test] + ref: + description: 'The git ref to build the documentation for' + required: false + default: '' + type: string + # annoyingly, there does not seem to be a way to share these input definitions between triggers + workflow_call: + inputs: + publish: + description: 'Whether to publish the documentation (as opposed to just building it)' + required: false + default: true + type: boolean + # choice type only supported for workflow_dispatch, not workflow_call + environment: + description: 'Whether to publish to production or test environment' + required: false + default: prod + type: string + ref: + description: 'The git ref to build the documentation for' + required: false + default: '' + type: string + + +jobs: + create_docs: + name: Create and publish documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: 3.8 # because of our supported TensorFlow versions, must build on 3.6-3.8 + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: pip install -U cython && pip install -e .[all] + name: Install econml[all] + - run: sudo apt-get -yq install graphviz + name: Install graphviz + - run: pip install "sphinx~=4.4.0" "sphinx_rtd_theme~=1.0.0" && python setup.py build_sphinx -W + name: Build documentation + - uses: actions/upload-artifact@v3 + name: Upload docs as artifact + with: + name: docs + path: build/sphinx/html/ + - run: |- + pushd build/sphinx/html + zip -r docs.zip * + popd + name: Zip docs for publishing + if : ${{ inputs.publish }} + - uses: azure/webapps-deploy@v2 + name: Deploy documentation to Azure web app + with: + app-name: ${{ inputs.environment == 'prod' && 'econml' || 'econml-dev' }} + package: build/sphinx/html/docs.zip + publish-profile: ${{ inputs.environment == 'prod' && secrets.PROD_WEBAPP_PUBLISH_PROFILE || secrets.STAGING_WEBAPP_PUBLISH_PROFILE }} + if: ${{ inputs.publish }} \ No newline at end of file diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 000000000..6fde706a5 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,117 @@ +name: Build and publish the package to PyPI + +on: + workflow_dispatch: + inputs: + publish: + description: 'Whether to publish the package (as opposed to just building it)' + required: false + default: true + type: boolean + repository: + description: 'Whether to publish to production PyPI or test PyPI' + required: false + default: pypi + type: choice + options: [pypi, testpypi] + ref: + description: 'The git ref to build the package for' + required: false + default: '' + type: string + # annoyingly, there does not seem to be a way to share these input definitions between triggers + workflow_call: + inputs: + publish: + description: 'Whether to publish the package (as opposed to just building it)' + required: false + default: true + type: boolean + # choice type only supported for workflow_dispatch, not workflow_call + repository: + description: 'Whether to publish to production PyPI or test PyPI' + required: false + default: pypi + type: string + ref: + description: 'The git ref to build the package for' + required: false + default: '' + type: string + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: 3.9 + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: pip install cibuildwheel && python -m cibuildwheel --output-dir dist + name: Build wheels + env: + CIBW_BUILD: cp3{7,8,9,10}-* + CIBW_SKIP: "*musl* *win32 *i686" + - uses: actions/upload-artifact@v3 + name: Upload wheels as artifact + with: + name: dist + path: dist/ + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + name: Checkout repository + with: + ref: ${{ inputs.ref }} + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: 3.8 # because of our supported TensorFlow versions, must build on 3.6-3.8 + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: pip install -U cython && pip install -e .[all] + name: Install econml[all] + - run: python setup.py sdist + name: Build sdist + - uses: actions/upload-artifact@v3 + name: Upload sdist as artifact + with: + name: dist + path: dist/ + publish: + name: Publish to PyPI or TestPyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v4 + name: Setup Python + with: + python-version: 3.9 + - run: python -m pip install --upgrade pip && pip install --upgrade setuptools + name: Ensure latest pip and setuptools + - run: pip install twine + name: Install twine + - uses: actions/download-artifact@v3 + name: Download wheels and sdist + with: + name: dist + path: dist/ + - run: twine upload dist/* + name: Upload wheels and sdist to package index + env: + TWINE_USERNAME: __token__ + TWINE_REPOSITORY: ${{ inputs.repository }} + TWINE_PASSWORD: ${{ inputs.repository == 'pypi' && secrets.PYPI_UPLOAD_TOKEN || secrets.TEST_PYPI_UPLOAD_TOKEN }} + if: ${{ inputs.publish }} \ No newline at end of file diff --git a/azure-pipelines-steps.yml b/azure-pipelines-steps.yml deleted file mode 100644 index 12f88fa69..000000000 --- a/azure-pipelines-steps.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -parameters: - package: '-e .' - images: ['ubuntu-20.04', 'macOS-12', 'windows-2019'] - versions: ['3.7', '3.8', '3.9', '3.10'] - job: - job: Job - -jobs: -- job: ${{ parameters.job.job }} - variables: - ${{ if ge(length(parameters.images), 2) }}: - imgPart: ", {0}" - ${{ if lt(length(parameters.images), 2) }}: - imgPart: "" - ${{ if ge(length(parameters.versions), 2) }}: - verPart: ", Python {1}" - ${{ if lt(length(parameters.versions), 2) }}: - verPart: "" - - strategy: - matrix: - ${{ each image in parameters.images }}: - ${{ each version in parameters.versions }}: - ${{ format(format('{0}{1} ', variables.imgPart, variables.verPart), image, version) }}: - imageName: ${{ image }} - python.version: ${{ version }} - - pool: - vmImage: $(imageName) - - ${{ each pair in parameters.job }}: # Insert all properties other than "strategy", "pool", "steps", "variables", "job" - ${{ if notIn(pair.key, 'strategy', 'pool', 'steps', 'variables', 'job') }}: - ${{ pair.key }}: ${{ pair.value }} - - steps: - - task: UsePythonVersion@0 - displayName: 'Use Python $(python.version)' - inputs: - versionSpec: '$(python.version)' - - # Enable long path support on Windows so that all packages can be installed correctly - - script: 'reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f' - displayName: 'Enable long paths on Windows' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) - - # Install graphviz programmatically on Linux - - script: 'sudo apt-get -yq install graphviz' - displayName: 'Install graphviz on Linux' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) - - # Install OpenMP on Mac to support lightgbm - - script: 'brew install libomp' - displayName: 'Install OpenMP on Mac' - condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) - - # Install the package - - script: 'python -m pip install --upgrade pip && pip install --upgrade setuptools wheel Cython && pip install ${{ parameters.package }} && pip freeze --exclude-editable' - displayName: 'Install dependencies' - - - ${{ parameters.job.steps }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 772c405d0..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,333 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- main - -jobs: -- job: 'EvalChanges' - displayName: 'Analyze changed files to determine which job to run' - pool: - vmImage: 'macos-12' - steps: - # We want to enforce the following rules for PRs: - # * if all modifications are to README.md - # no testing is needed - # * if there are modifications to docs/* or to any code - # then docs need to be built to verify consistency - # * if there are modifications to notebooks/* or to any code - # then notebooks need to be run to verify consistency - # * for any code changes (or changes to metadata files) - # linting and testing should be run - # For a PR build, HEAD will be the merge commit, and we want to diff against the base branch, - # which will be the first parent: HEAD^ - # (For non-PR changes, we will always perform all CI tasks) - - powershell: | - if ($env:BUILD_REASON -eq 'PullRequest') { - $editedFiles = git diff HEAD^ --name-only - $editedFiles # echo edited files to enable easier debugging - $codeChanges = $false - $docChanges = $false - $nbChanges = $false - $changeType = "none" - foreach ($file in $editedFiles) { - switch -Wildcard ($file) { - "README.md" { Continue } - ".gitignore" { Continue } - "econml/_version.py" { Continue } - "prototypes/*" { Continue } - "images/*" { Continue } - "doc/*" { $docChanges = $true; Continue } - "notebooks/*" { $nbChanges = $true; Continue } - default { $codeChanges = $true; Continue } - } - } - } - Write-Host "##vso[task.setvariable variable=buildDocs;isOutput=true]$(($env:BUILD_REASON -ne 'PullRequest') -or ($docChanges -or $codeChanges))" - Write-Host "##vso[task.setvariable variable=buildNbs;isOutput=true]$(($env:BUILD_REASON -ne 'PullRequest') -or ($nbChanges -or $codeChanges))" - Write-Host "##vso[task.setvariable variable=testCode;isOutput=true]$(($env:BUILD_REASON -ne 'PullRequest') -or $codeChanges)" - name: output - displayName: 'Determine type of code change' - -- template: azure-pipelines-steps.yml - parameters: - versions: ['3.8'] - images: ['ubuntu-20.04'] - package: '-e .[all]' - job: - job: 'Docs' - displayName: 'Build documentation' - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.buildDocs'], 'True') - steps: - - script: 'sudo apt-get -yq install graphviz' - displayName: 'Install graphviz' - - - script: 'pip install sklearn-contrib-lightning' - displayName: 'Install lightning' - - - script: 'pip install git+https://github.com/slundberg/shap.git@d1d2700acc0259f211934373826d5ff71ad514de' - displayName: 'Install specific version of shap' - - - script: 'pip install sphinx!=5.1.0 sphinx_rtd_theme' - displayName: 'Install sphinx' - - - script: 'python setup.py build_sphinx -W' - displayName: 'Build documentation' - - - publish: 'build/sphinx/html' - condition: 'succeededOrFailed()' - artifact: 'Documentation' - displayName: 'Publish documentation as artifact' - - - script: 'python setup.py build_sphinx -b doctest' - displayName: 'Run doctests' - - -- template: azure-pipelines-steps.yml - parameters: - versions: ['3.8'] - images: ['ubuntu-20.04'] - package: '-e .[tf,plt,dowhy]' - job: - job: 'Notebooks_cust' - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.buildNbs'], 'True') - displayName: 'Notebooks (Customer Solutions)' - steps: - # Work around https://github.com/pypa/pip/issues/9542 - - script: 'pip install -U numpy~=1.21.0' - displayName: 'Upgrade numpy' - - - script: 'pip install pytest pytest-runner jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm py && pip list && python setup.py pytest' - displayName: 'Unit tests' - env: - PYTEST_ADDOPTS: '-m "notebook"' - NOTEBOOK_DIR_PATTERN: 'CustomerScenarios' - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Notebooks' - condition: succeededOrFailed() - -- template: azure-pipelines-steps.yml - parameters: - versions: ['3.8'] - images: ['ubuntu-20.04'] - package: '-e .[tf,plt]' - job: - job: 'Notebooks_noncust' - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.buildNbs'], 'True') - displayName: 'Notebooks (except Customer Solutions)' - steps: - # Work around https://github.com/pypa/pip/issues/9542 - - script: 'pip install -U numpy~=1.21.0' - displayName: 'Upgrade numpy' - - - script: 'pip install pytest pytest-runner jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm py && python setup.py pytest' - displayName: 'Unit tests' - env: - PYTEST_ADDOPTS: '-m "notebook"' - NOTEBOOK_DIR_PATTERN: '(?!CustomerScenarios)' - - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Notebooks' - condition: succeededOrFailed() - - -# - job: 'AutoML' -# dependsOn: 'EvalChanges' -# condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') -# variables: -# python.version: '3.6' -# pool: -# vmImage: 'ubuntu-20.04' -# steps: -# - template: azure-pipelines-steps.yml -# parameters: -# body: -# - task: AzureCLI@2 -# displayName: 'AutoML tests' -# inputs: -# azureSubscription: 'automl' -# scriptLocation: 'inlineScript' -# scriptType: 'pscore' -# powerShellIgnoreLASTEXITCODE: '' # string for now due to https://github.com/microsoft/azure-pipelines-tasks/issues/12266 -# inlineScript: | -# $env:SUBSCRIPTION_ID = az account show --query id -o tsv -# python setup.py pytest -# env: -# WORKSPACE_NAME: 'testWorkspace' -# RESOURCE_GROUP: 'testingAutoMLEconML' -# PYTEST_ADDOPTS: '-m "automl" -n 0' -# COVERAGE_PROCESS_START: 'setup.cfg' - -# - task: PublishTestResults@2 -# displayName: 'Publish Test Results **/test-results.xml' -# inputs: -# testResultsFiles: '**/test-results.xml' -# testRunTitle: 'AutoML' -# condition: succeededOrFailed() -# package: '.[automl]' - -- template: azure-pipelines-steps.yml - parameters: - versions: ['3.8'] - images: ['macos-12'] - job: - job: 'Linting' - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - steps: - - script: 'pip install pycodestyle && pycodestyle econml' - failOnStderr: true - displayName: Linting - -- template: azure-pipelines-steps.yml - parameters: - package: '-e .[tf,plt,dowhy]' - job: - job: Tests_main - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - displayName: 'Run tests (main)' - steps: - - script: 'pip install pytest pytest-runner "coverage<6.4.1;python_version==''3.6''" "coverage;python_version>''3.6''" py && python setup.py pytest' - displayName: 'Unit tests' - env: - PYTEST_ADDOPTS: '-m "not (notebook or automl or dml or serial or cate_api or treatment_featurization)" -n 2' - COVERAGE_PROCESS_START: 'setup.cfg' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version), image $(imageName)' - condition: succeededOrFailed() - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - -- template: azure-pipelines-steps.yml - parameters: - package: '-e .[tf,plt]' - job: - job: Tests_dml - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - displayName: 'Run tests (DML)' - steps: - - script: 'pip install pytest pytest-runner "coverage<6.4.1;python_version==''3.6''" "coverage;python_version>''3.6''" py && python setup.py pytest' - displayName: 'Unit tests' - env: - PYTEST_ADDOPTS: '-m "dml"' - COVERAGE_PROCESS_START: 'setup.cfg' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version), image $(imageName)' - condition: succeededOrFailed() - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - -- template: azure-pipelines-steps.yml - parameters: - # exclude macOS since these tests frequently break there - images: ['ubuntu-20.04', 'windows-2019'] - package: '-e .[tf,plt]' - job: - job: Tests_serial - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - displayName: 'Run tests (Serial)' - steps: - - script: 'pip install pytest pytest-runner "coverage<6.4.1;python_version==''3.6''" "coverage;python_version>''3.6''" py && python setup.py pytest' - displayName: 'Unit tests' - env: - PYTEST_ADDOPTS: '-m "serial" -n 1' - COVERAGE_PROCESS_START: 'setup.cfg' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version), image $(imageName)' - condition: succeededOrFailed() - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - -- template: azure-pipelines-steps.yml - parameters: - package: '-e .[tf,plt]' - job: - job: Tests_CATE_API - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - displayName: 'Run tests (Other)' - steps: - - script: 'pip install pytest pytest-runner "coverage<6.4.1;python_version==''3.6''" "coverage;python_version>''3.6''" py' - displayName: 'Install pytest' - - script: 'python setup.py pytest' - displayName: 'CATE Unit tests' - env: - PYTEST_ADDOPTS: '-m "cate_api" -n auto' - COVERAGE_PROCESS_START: 'setup.cfg' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version), image $(imageName)' - condition: succeededOrFailed() - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' - -- template: azure-pipelines-steps.yml - parameters: - package: '-e .[tf,plt]' - job: - job: Tests_treatment_featurization - dependsOn: 'EvalChanges' - condition: eq(dependencies.EvalChanges.outputs['output.testCode'], 'True') - displayName: 'Run tests (Treatment Featurization)' - steps: - - script: 'pip install pytest pytest-runner "coverage<6.4.1;python_version==''3.6''" "coverage;python_version>''3.6''" py' - displayName: 'Install pytest' - - script: 'python setup.py pytest' - displayName: 'Treatment Featurization Unit tests' - env: - PYTEST_ADDOPTS: '-m "treatment_featurization" -n auto' - COVERAGE_PROCESS_START: 'setup.cfg' - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/test-results.xml' - inputs: - testResultsFiles: '**/test-results.xml' - testRunTitle: 'Python $(python.version), image $(imageName)' - condition: succeededOrFailed() - - - task: PublishCodeCoverageResults@1 - displayName: 'Publish Code Coverage Results' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index eb1d53122..62107f18e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,8 +44,8 @@ install_requires = test_suite = econml.tests tests_require = pytest - pytest-xdist < 2.0.0 - pytest-cov < 3.0.0 + pytest-xdist + pytest-cov [options.extras_require] automl = From b92fdc42b259c8de86047c411fbb444b35fbb671 Mon Sep 17 00:00:00 2001 From: Keith Battocchi Date: Fri, 17 Mar 2023 12:43:51 -0400 Subject: [PATCH 04/22] Update developer documentation Signed-off-by: Keith Battocchi Signed-off-by: star1327p --- README.md | 17 +++++++++++------ doc/spec/faq.rst | 22 +++++----------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 134c30122..e7347acd9 100644 --- a/README.md +++ b/README.md @@ -669,6 +669,15 @@ To generate a local copy of the documentation from a clone of this repository, j The reStructuredText files that make up the documentation are stored in the [docs directory](https://github.com/Microsoft/EconML/tree/main/doc); module documentation is automatically generated by the Sphinx build process. +## Release process + +We use GitHub Actions to build and publish the package and documentation. To create a new release, an admin should perform the following steps: + +1. Update the version number in `econml/_version.py` and add a mention of the new version in the news section of this file and commit the changes. +2. Manually run the publish_package.yml workflow to build and publish the package to PyPI. +3. Manually run the publish_docs.yml workflow to build and publish the documentation. +4. Under https://github.com/py-why/EconML/releases, create a new release with a corresponding tag, and update the release notes. + # Blogs and Publications * June 2019: [Treatment Effects with Instruments paper](https://arxiv.org/pdf/1905.10176.pdf) @@ -699,17 +708,13 @@ BibTex: # Contributing and Feedback -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.microsoft.com. +This project welcomes contributions and suggestions. We use the [DCO bot](https://github.com/apps/dco) to enforce a [Developer Certificate of Origin](https://developercertificate.org/) which requires users to sign-off on their commits. This is a simple way to certify that you wrote or otherwise have the right to submit the code you are contributing to the project. Git provides a `-s` command line option to include this automatically when you commit via `git commit`. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +This project has adopted the [PyWhy Code of Conduct](https://github.com/py-why/governance/blob/main/CODE-OF-CONDUCT.md). # References diff --git a/doc/spec/faq.rst b/doc/spec/faq.rst index 7e8b7ab41..e6d63dff3 100644 --- a/doc/spec/faq.rst +++ b/doc/spec/faq.rst @@ -56,22 +56,10 @@ which is a good diagnostic as to the quality of your model. How do I give feedback? ------------------------------------ -This project welcomes contributions and suggestions. Most contributions require you to agree to -a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, -grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., label, comment). -Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - - -This project has adopted the Microsoft Open Source Code of Conduct. -For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments. - - - - - +This project welcomes contributions and suggestions. We use the `DCO bot `_ to enforce a +`Developer Certificate of Origin ` which requires users to sign-off on their commits. +This is a simple way to certify that you wrote or otherwise have the right to submit the code you are contributing to +the project. Git provides a :code:`-s` command line option to include this automatically when you commit via :code:`git commit`. +This project has adopted the `PyWhy Code of Conduct `_. From cb327c1e3516b8507ce09cd979dd2882ddc1e11d Mon Sep 17 00:00:00 2001 From: Keith Battocchi Date: Fri, 17 Mar 2023 15:57:46 -0400 Subject: [PATCH 05/22] Update copyright and links to point to PyWhy Signed-off-by: Keith Battocchi Signed-off-by: star1327p --- LICENSE | 2 +- README.md | 64 +- doc/conf.py | 6 +- doc/spec/estimation/dml.rst | 4 +- doc/spec/estimation/dr.rst | 6 +- doc/spec/estimation/forest.rst | 4 +- doc/spec/estimation/metalearners.rst | 8 +- doc/spec/estimation/orthoiv.rst | 2 +- doc/spec/motivation.rst | 6 +- econml/__init__.py | 2 +- econml/_cate_estimator.py | 2 +- econml/_ensemble/__init__.py | 2 +- econml/_ensemble/_ensemble.py | 2 +- econml/_ensemble/_utilities.py | 2 +- econml/_ortho_learner.py | 2 +- econml/_shap.py | 2 +- econml/_tree_exporter.py | 2 +- econml/_version.py | 2 +- econml/automated_ml/__init__.py | 2 +- econml/automated_ml/_automated_ml.py | 2 +- econml/cate_interpreter/__init__.py | 2 +- econml/cate_interpreter/_interpreters.py | 2 +- econml/dml/__init__.py | 2 +- econml/dml/_rlearner.py | 2 +- econml/dml/causal_forest.py | 2 +- econml/dml/dml.py | 2 +- econml/dowhy.py | 4 +- econml/dr/__init__.py | 2 +- econml/dr/_drlearner.py | 2 +- econml/dynamic/__init__.py | 2 +- econml/dynamic/dml/__init__.py | 2 +- econml/grf/__init__.py | 2 +- econml/grf/_base_grf.py | 2 +- econml/grf/_base_grftree.py | 2 +- econml/grf/_criterion.pxd | 2 +- econml/grf/_criterion.pyx | 2 +- econml/grf/_utils.pxd | 2 +- econml/grf/_utils.pyx | 2 +- econml/grf/classes.py | 2 +- econml/inference/__init__.py | 2 +- econml/inference/_bootstrap.py | 2 +- econml/inference/_inference.py | 2 +- econml/iv/__init__.py | 2 +- econml/iv/dml/__init__.py | 2 +- econml/iv/dml/_dml.py | 2 +- econml/iv/dr/__init__.py | 2 +- econml/iv/dr/_dr.py | 2 +- econml/iv/nnet/__init__.py | 2 +- econml/iv/nnet/_deepiv.py | 2 +- econml/iv/sieve/__init__.py | 2 +- econml/iv/sieve/_tsls.py | 2 +- econml/metalearners/__init__.py | 2 +- econml/metalearners/_metalearners.py | 2 +- econml/orf/__init__.py | 2 +- econml/orf/_causal_tree.py | 2 +- econml/orf/_ortho_forest.py | 2 +- econml/panel/__init__.py | 2 +- econml/panel/dml/__init__.py | 2 +- econml/panel/dml/_dml.py | 2 +- econml/policy/__init__.py | 2 +- econml/policy/_base.py | 2 +- econml/policy/_drlearner.py | 2 +- econml/policy/_forest/__init__.py | 2 +- econml/policy/_forest/_criterion.pxd | 2 +- econml/policy/_forest/_criterion.pyx | 2 +- econml/policy/_forest/_forest.py | 2 +- econml/policy/_forest/_tree.py | 2 +- econml/score/__init__.py | 2 +- econml/score/ensemble_cate.py | 2 +- econml/score/rscorer.py | 2 +- econml/sklearn_extensions/linear_model.py | 2 +- econml/sklearn_extensions/model_selection.py | 2 +- econml/solutions/causal_analysis/__init__.py | 2 +- .../causal_analysis/_causal_analysis.py | 2 +- econml/tests/dgp.py | 2 +- econml/tests/test_ate_inference.py | 2 +- econml/tests/test_automated_ml.py | 2 +- econml/tests/test_bootstrap.py | 2 +- econml/tests/test_cate_interpreter.py | 2 +- econml/tests/test_causal_analysis.py | 2 +- econml/tests/test_deepiv.py | 2 +- econml/tests/test_dml.py | 2 +- econml/tests/test_dmliv.py | 2 +- econml/tests/test_dominicks.py | 2 +- econml/tests/test_dowhy.py | 2 +- econml/tests/test_driv.py | 2 +- econml/tests/test_drlearner.py | 2 +- econml/tests/test_dynamic_dml.py | 2 +- econml/tests/test_grf_cython.py | 2 +- econml/tests/test_grf_python.py | 2 +- econml/tests/test_inference.py | 2 +- econml/tests/test_integration.py | 2 +- econml/tests/test_linear_model.py | 2 +- econml/tests/test_metalearners.py | 2 +- econml/tests/test_montecarlo.py | 5 +- econml/tests/test_notebooks.py | 2 +- econml/tests/test_orf.py | 2 +- econml/tests/test_ortho_learner.py | 2 +- econml/tests/test_policy_forest.py | 2 +- econml/tests/test_rscorer.py | 2 +- econml/tests/test_shap.py | 2 +- econml/tests/test_statsmodels.py | 2 +- econml/tests/test_treatment_featurization.py | 2 +- econml/tests/test_tree.py | 2 +- econml/tests/test_two_stage_least_squares.py | 2 +- econml/tests/test_utilities.py | 2 +- econml/tests/utilities.py | 2 +- econml/tree/__init__.py | 2 +- econml/tree/_criterion.pxd | 2 +- econml/tree/_criterion.pyx | 2 +- econml/tree/_splitter.pxd | 2 +- econml/tree/_splitter.pyx | 2 +- econml/tree/_tree.pxd | 2 +- econml/tree/_tree.pyx | 2 +- econml/tree/_utils.pxd | 2 +- econml/tree/_utils.pyx | 2 +- econml/utilities.py | 2 +- ...utomated Machine Learning For EconML.ipynb | 2 +- ...nline Media Company - EconML + DoWhy.ipynb | 819 +++++++++--------- ...mentation at An Online Media Company.ipynb | 2 +- ...on-Investment via Short-Term Proxies.ipynb | 2 +- ... A Software Company - EconML + DoWhy.ipynb | 6 +- ...nt Attribution at A Software Company.ipynb | 2 +- ...line Travel Company - EconML + DoWhy.ipynb | 7 +- ... Testing at An Online Travel Company.ipynb | 2 +- ...f training program - Lalonde dataset.ipynb | 2 +- prototypes/dml_iv/dml_ate_iv.py | 2 +- prototypes/dml_iv/dml_iv.py | 2 +- prototypes/dml_iv/dr_iv.py | 2 +- prototypes/dml_iv/utilities.py | 2 +- setup.cfg | 8 +- 131 files changed, 592 insertions(+), 591 deletions(-) diff --git a/LICENSE b/LICENSE index 8a3dfbf66..f55033a55 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License - Copyright (c) Microsoft Corporation. All rights reserved. + Copyright (c) PyWhy contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e7347acd9..79e408ad9 100644 --- a/README.md +++ b/README.md @@ -46,63 +46,63 @@ For information on use cases and background material on causal inference and het # News -**November 16, 2022:** Release v0.14.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.14.0) +**November 16, 2022:** Release v0.14.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.14.0)
Previous releases -**June 17, 2022:** Release v0.13.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.13.1) +**June 17, 2022:** Release v0.13.1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.13.1) -**January 31, 2022:** Release v0.13.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.13.0) +**January 31, 2022:** Release v0.13.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.13.0) -**August 13, 2021:** Release v0.12.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0) +**August 13, 2021:** Release v0.12.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0) -**August 5, 2021:** Release v0.12.0b6, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b6) +**August 5, 2021:** Release v0.12.0b6, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b6) -**August 3, 2021:** Release v0.12.0b5, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b5) +**August 3, 2021:** Release v0.12.0b5, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b5) -**July 9, 2021:** Release v0.12.0b4, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b4) +**July 9, 2021:** Release v0.12.0b4, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b4) -**June 25, 2021:** Release v0.12.0b3, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b3) +**June 25, 2021:** Release v0.12.0b3, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b3) -**June 18, 2021:** Release v0.12.0b2, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b2) +**June 18, 2021:** Release v0.12.0b2, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b2) -**June 7, 2021:** Release v0.12.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.12.0b1) +**June 7, 2021:** Release v0.12.0b1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.12.0b1) -**May 18, 2021:** Release v0.11.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.11.1) +**May 18, 2021:** Release v0.11.1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.11.1) -**May 8, 2021:** Release v0.11.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.11.0) +**May 8, 2021:** Release v0.11.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.11.0) -**March 22, 2021:** Release v0.10.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.10.0) +**March 22, 2021:** Release v0.10.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.10.0) -**March 11, 2021:** Release v0.9.2, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.9.2) +**March 11, 2021:** Release v0.9.2, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.9.2) -**March 3, 2021:** Release v0.9.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.9.1) +**March 3, 2021:** Release v0.9.1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.9.1) -**February 20, 2021:** Release v0.9.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.9.0) +**February 20, 2021:** Release v0.9.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.9.0) -**January 20, 2021:** Release v0.9.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.9.0b1) +**January 20, 2021:** Release v0.9.0b1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.9.0b1) -**November 20, 2020:** Release v0.8.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.1) +**November 20, 2020:** Release v0.8.1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.8.1) -**November 18, 2020:** Release v0.8.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.0) +**November 18, 2020:** Release v0.8.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.8.0) -**September 4, 2020:** Release v0.8.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.0b1) +**September 4, 2020:** Release v0.8.0b1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.8.0b1) -**March 6, 2020:** Release v0.7.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.7.0) +**March 6, 2020:** Release v0.7.0, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.7.0) -**February 18, 2020:** Release v0.7.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.7.0b1) +**February 18, 2020:** Release v0.7.0b1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.7.0b1) -**January 10, 2020:** Release v0.6.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.6.1) +**January 10, 2020:** Release v0.6.1, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.6.1) -**December 6, 2019:** Release v0.6, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.6) +**December 6, 2019:** Release v0.6, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.6) -**November 21, 2019:** Release v0.5, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.5). +**November 21, 2019:** Release v0.5, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.5). -**June 3, 2019:** Release v0.4, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.4). +**June 3, 2019:** Release v0.4, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.4). -**May 3, 2019:** Release v0.3, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.3). +**May 3, 2019:** Release v0.3, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.3). -**April 10, 2019:** Release v0.2, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.2). +**April 10, 2019:** Release v0.2, see release notes [here](https://github.com/py-why/EconML/releases/tag/v0.2). **March 6, 2019:** Release v0.1, welcome to have a try and provide feedback. @@ -645,7 +645,7 @@ importances = policy.feature_importances_ ![image](images/policy_tree.png)
-To see more complex examples, go to the [notebooks](https://github.com/Microsoft/EconML/tree/main/notebooks) section of the repository. For a more detailed description of the treatment effect estimation algorithms, see the EconML [documentation](https://econml.azurewebsites.net/). +To see more complex examples, go to the [notebooks](https://github.com/py-why/EconML/tree/main/notebooks) section of the repository. For a more detailed description of the treatment effect estimation algorithms, see the EconML [documentation](https://econml.azurewebsites.net/). # For Developers @@ -667,7 +667,7 @@ This project's documentation is generated via [Sphinx](https://www.sphinx-doc.or To generate a local copy of the documentation from a clone of this repository, just run `python setup.py build_sphinx -W -E -a`, which will build the documentation and place it under the `build/sphinx/html` path. -The reStructuredText files that make up the documentation are stored in the [docs directory](https://github.com/Microsoft/EconML/tree/main/doc); module documentation is automatically generated by the Sphinx build process. +The reStructuredText files that make up the documentation are stored in the [docs directory](https://github.com/py-why/EconML/tree/main/doc); module documentation is automatically generated by the Sphinx build process. ## Release process @@ -692,7 +692,7 @@ We use GitHub Actions to build and publish the package and documentation. To cr If you use EconML in your research, please cite us as follows: - Keith Battocchi, Eleanor Dillon, Maggie Hei, Greg Lewis, Paul Oka, Miruna Oprescu, Vasilis Syrgkanis. **EconML: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation.** https://github.com/microsoft/EconML, 2019. Version 0.x. + Keith Battocchi, Eleanor Dillon, Maggie Hei, Greg Lewis, Paul Oka, Miruna Oprescu, Vasilis Syrgkanis. **EconML: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation.** https://github.com/py-why/EconML, 2019. Version 0.x. BibTex: @@ -700,7 +700,7 @@ BibTex: @misc{econml, author={Keith Battocchi, Eleanor Dillon, Maggie Hei, Greg Lewis, Paul Oka, Miruna Oprescu, Vasilis Syrgkanis}, title={{EconML}: {A Python Package for ML-Based Heterogeneous Treatment Effects Estimation}}, - howpublished={https://github.com/microsoft/EconML}, + howpublished={https://github.com/py-why/EconML}, note={Version 0.x}, year={2019} } diff --git a/doc/conf.py b/doc/conf.py index 411db502f..1e95f0ab3 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -21,8 +21,8 @@ # -- Project information ----------------------------------------------------- project = 'econml' -copyright = '2022, Microsoft Research' -author = 'Microsoft Research' +copyright = '2022, PyWhy contributors' +author = 'PyWhy contributors' version = econml.__version__ release = econml.__version__ @@ -176,7 +176,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ (root_doc, 'econml.tex', 'econml Documentation', - 'Microsoft Research', 'manual'), + 'PyWhy contributors', 'manual'), ] diff --git a/doc/spec/estimation/dml.rst b/doc/spec/estimation/dml.rst index 4aac2f1e6..416a26c85 100644 --- a/doc/spec/estimation/dml.rst +++ b/doc/spec/estimation/dml.rst @@ -607,8 +607,8 @@ Usage Examples ================================== For more extensive examples check out the following notebooks: -`DML Examples Jupyter Notebook `_, -`Forest Learners Jupyter Notebook `_. +`DML Examples Jupyter Notebook `_, +`Forest Learners Jupyter Notebook `_. .. rubric:: Single Outcome, Single Treatment diff --git a/doc/spec/estimation/dr.rst b/doc/spec/estimation/dr.rst index 2849e83c4..663c568a4 100644 --- a/doc/spec/estimation/dr.rst +++ b/doc/spec/estimation/dr.rst @@ -366,7 +366,7 @@ Usage FAQs If you care more about mean squared error than confidence intervals and hypothesis testing, then use the :class:`.DRLearner` class and choose a cross-validated final model (checkout the - `Forest Learners Jupyter notebook `_ + `Forest Learners Jupyter notebook `_ for such an example). Also the check out the :ref:`Orthogonal Random Forest User Guide ` or the :ref:`Meta Learners User Guide `. @@ -516,7 +516,7 @@ Usage Examples Check out the following Jupyter notebooks: -* `Meta Learners Jupyter Notebook `_ -* `Forest Learners Jupyter Notebook `_ +* `Meta Learners Jupyter Notebook `_ +* `Forest Learners Jupyter Notebook `_ diff --git a/doc/spec/estimation/forest.rst b/doc/spec/estimation/forest.rst index cac213909..3a8db34ae 100644 --- a/doc/spec/estimation/forest.rst +++ b/doc/spec/estimation/forest.rst @@ -315,8 +315,8 @@ Usage Examples Here is a simple example of how to call :class:`.DMLOrthoForest` and what the returned values correspond to in a simple data generating process. For more examples check out our -`OrthoForest Jupyter notebook `_ -and the `ForestLearners Jupyter notebook `_ . +`OrthoForest Jupyter notebook `_ +and the `ForestLearners Jupyter notebook `_ . .. testcode:: diff --git a/doc/spec/estimation/metalearners.rst b/doc/spec/estimation/metalearners.rst index 2bd83cd85..ddf42acc5 100644 --- a/doc/spec/estimation/metalearners.rst +++ b/doc/spec/estimation/metalearners.rst @@ -17,7 +17,7 @@ These methods fall into the meta-learner category because they simply combine ML so as to get a final stage estimate and do not introduce new estimation components. For examples of how to use our implemented metelearners check out this -`Metalearners Jupyter notebook `_. The examples +`Metalearners Jupyter notebook `_. The examples and documents here are only based on binary treatment setting, but all of these estimators are applicable to multiple treatment settings as well. @@ -146,9 +146,9 @@ Usage Examples Check out the following notebooks: - * `Metalearners Jupyter notebook `_. - * `DML Examples Jupyter Notebook `_, - * `Forest Learners Jupyter Notebook `_. + * `Metalearners Jupyter notebook `_. + * `DML Examples Jupyter Notebook `_, + * `Forest Learners Jupyter Notebook `_. .. todo:: diff --git a/doc/spec/estimation/orthoiv.rst b/doc/spec/estimation/orthoiv.rst index 3ceed068f..d01ebe932 100644 --- a/doc/spec/estimation/orthoiv.rst +++ b/doc/spec/estimation/orthoiv.rst @@ -77,4 +77,4 @@ Usage Examples ================================== For more extensive examples check out the following notebooks: -`OrthoIV and DRIV Examples Jupyter Notebook `_. \ No newline at end of file +`OrthoIV and DRIV Examples Jupyter Notebook `_. \ No newline at end of file diff --git a/doc/spec/motivation.rst b/doc/spec/motivation.rst index 1e59ecb6d..9bc532fb0 100644 --- a/doc/spec/motivation.rst +++ b/doc/spec/motivation.rst @@ -55,7 +55,7 @@ The DRIV model adjusts for the fact that not every customer who was offered the became a member and returns the effect of membership rather than the effect of receiving the quick sign-up. Link to jupyter notebook: -`Recommendation A/B Testing `__ +`Recommendation A/B Testing `__ More details: `Trip Advisor Case Study `__ @@ -82,7 +82,7 @@ The tree interpreter provides a presentation-ready summary of the key features that explain the biggest differences in responsiveness to a discount. Link to jupyter notebook: -`Customer Segmentation `__. +`Customer Segmentation `__. Multi-investment Attribution ----------------------------- @@ -103,4 +103,4 @@ The model uses flexible functions of observed customer features to filter out co in existing data and deliver the causal effect of each effort on revenue. Link to jupyter notebook: -`Multi-investment Attribution `__. \ No newline at end of file +`Multi-investment Attribution `__. \ No newline at end of file diff --git a/econml/__init__.py b/econml/__init__.py index 71168f3e7..7d106f509 100644 --- a/econml/__init__.py +++ b/econml/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. __all__ = ['automated_ml', diff --git a/econml/_cate_estimator.py b/econml/_cate_estimator.py index a8dce4dea..6418f7e3e 100644 --- a/econml/_cate_estimator.py +++ b/econml/_cate_estimator.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Base classes for all CATE estimators.""" diff --git a/econml/_ensemble/__init__.py b/econml/_ensemble/__init__.py index bffd9e92f..5ea69417b 100644 --- a/econml/_ensemble/__init__.py +++ b/econml/_ensemble/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._ensemble import BaseEnsemble, _partition_estimators diff --git a/econml/_ensemble/_ensemble.py b/econml/_ensemble/_ensemble.py index 34d9ef925..ff833f9ec 100644 --- a/econml/_ensemble/_ensemble.py +++ b/econml/_ensemble/_ensemble.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: diff --git a/econml/_ensemble/_utilities.py b/econml/_ensemble/_utilities.py index d3317e403..aa69ed0e8 100644 --- a/econml/_ensemble/_utilities.py +++ b/econml/_ensemble/_utilities.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numbers diff --git a/econml/_ortho_learner.py b/econml/_ortho_learner.py index 0d5aabe81..fdc9e7693 100644 --- a/econml/_ortho_learner.py +++ b/econml/_ortho_learner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ diff --git a/econml/_shap.py b/econml/_shap.py index cc417d717..eed548202 100644 --- a/econml/_shap.py +++ b/econml/_shap.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Helper functions to get shap values for different cate estimators. diff --git a/econml/_tree_exporter.py b/econml/_tree_exporter.py index e7ac4d162..54531fa00 100644 --- a/econml/_tree_exporter.py +++ b/econml/_tree_exporter.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains some snippets of code from: diff --git a/econml/_version.py b/econml/_version.py index 31cb0d8a8..66656f7aa 100644 --- a/econml/_version.py +++ b/econml/_version.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. __version__ = '0.14.0' diff --git a/econml/automated_ml/__init__.py b/econml/automated_ml/__init__.py index 9914c36e9..23b2162cd 100644 --- a/econml/automated_ml/__init__.py +++ b/econml/automated_ml/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._automated_ml import (setAutomatedMLWorkspace, addAutomatedML, diff --git a/econml/automated_ml/_automated_ml.py b/econml/automated_ml/_automated_ml.py index 8a6be0977..1454d2456 100644 --- a/econml/automated_ml/_automated_ml.py +++ b/econml/automated_ml/_automated_ml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # AzureML diff --git a/econml/cate_interpreter/__init__.py b/econml/cate_interpreter/__init__.py index d0aa3700d..390c29a83 100644 --- a/econml/cate_interpreter/__init__.py +++ b/econml/cate_interpreter/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._interpreters import SingleTreeCateInterpreter, SingleTreePolicyInterpreter diff --git a/econml/cate_interpreter/_interpreters.py b/econml/cate_interpreter/_interpreters.py index e0bd97be0..82a47ef0c 100644 --- a/econml/cate_interpreter/_interpreters.py +++ b/econml/cate_interpreter/_interpreters.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import abc diff --git a/econml/dml/__init__.py b/econml/dml/__init__.py index 3688628c9..ce58cf8c0 100644 --- a/econml/dml/__init__.py +++ b/econml/dml/__init__.py @@ -1,5 +1,5 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Double Machine Learning. The method uses machine learning methods to identify the diff --git a/econml/dml/_rlearner.py b/econml/dml/_rlearner.py index d816c31f7..f55d10b80 100644 --- a/econml/dml/_rlearner.py +++ b/econml/dml/_rlearner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ diff --git a/econml/dml/causal_forest.py b/econml/dml/causal_forest.py index 76dbd54f3..07a356d75 100644 --- a/econml/dml/causal_forest.py +++ b/econml/dml/causal_forest.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from warnings import warn diff --git a/econml/dml/dml.py b/econml/dml/dml.py index d33ccc638..713554dad 100644 --- a/econml/dml/dml.py +++ b/econml/dml/dml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from warnings import warn diff --git a/econml/dowhy.py b/econml/dowhy.py index b494a86bd..7c6489743 100644 --- a/econml/dowhy.py +++ b/econml/dowhy.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. @@ -6,7 +6,7 @@ References ---------- -DoWhy, https://microsoft.github.io/dowhy/ +DoWhy, https://www.pywhy.org/dowhy/ """ diff --git a/econml/dr/__init__.py b/econml/dr/__init__.py index a69bc9bfe..c64ad7b06 100644 --- a/econml/dr/__init__.py +++ b/econml/dr/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._drlearner import (DRLearner, LinearDRLearner, SparseLinearDRLearner, ForestDRLearner) diff --git a/econml/dr/_drlearner.py b/econml/dr/_drlearner.py index 5490ffeed..3ca702a0c 100644 --- a/econml/dr/_drlearner.py +++ b/econml/dr/_drlearner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ diff --git a/econml/dynamic/__init__.py b/econml/dynamic/__init__.py index 8e4ecd538..489deb950 100755 --- a/econml/dynamic/__init__.py +++ b/econml/dynamic/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. __all__ = ["dml"] diff --git a/econml/dynamic/dml/__init__.py b/econml/dynamic/dml/__init__.py index b645bbb2a..0185ea702 100755 --- a/econml/dynamic/dml/__init__.py +++ b/econml/dynamic/dml/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Double Machine Learning for Dynamic Treatment Effects. diff --git a/econml/grf/__init__.py b/econml/grf/__init__.py index be3c91392..6dbb9bcf6 100644 --- a/econml/grf/__init__.py +++ b/econml/grf/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ An efficient Cython implementation of Generalized Random Forests [grf]_ and special diff --git a/econml/grf/_base_grf.py b/econml/grf/_base_grf.py index 625915c28..6eb2defad 100644 --- a/econml/grf/_base_grf.py +++ b/econml/grf/_base_grf.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains snippets of code from diff --git a/econml/grf/_base_grftree.py b/econml/grf/_base_grftree.py index 7da779397..4d05bd650 100644 --- a/econml/grf/_base_grftree.py +++ b/econml/grf/_base_grftree.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains snippets of code from: diff --git a/econml/grf/_criterion.pxd b/econml/grf/_criterion.pxd index e4b7cd4fe..9bbf1d9d6 100644 --- a/econml/grf/_criterion.pxd +++ b/econml/grf/_criterion.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # published under the following license and copyright: # BSD 3-Clause License diff --git a/econml/grf/_criterion.pyx b/econml/grf/_criterion.pyx index 59a448a68..5f4544ce7 100644 --- a/econml/grf/_criterion.pyx +++ b/econml/grf/_criterion.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains some snippets of code from: diff --git a/econml/grf/_utils.pxd b/econml/grf/_utils.pxd index 812bb99ea..c66370f93 100644 --- a/econml/grf/_utils.pxd +++ b/econml/grf/_utils.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/grf/_utils.pyx b/econml/grf/_utils.pyx index 8795f1ea0..7a04e0335 100644 --- a/econml/grf/_utils.pyx +++ b/econml/grf/_utils.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from libc.stdlib cimport free diff --git a/econml/grf/classes.py b/econml/grf/classes.py index 4a5df80b8..51daca428 100644 --- a/econml/grf/classes.py +++ b/econml/grf/classes.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/inference/__init__.py b/econml/inference/__init__.py index 921b6b4f5..113ff78ab 100644 --- a/econml/inference/__init__.py +++ b/econml/inference/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._inference import (BootstrapInference, GenericModelFinalInference, GenericSingleTreatmentModelFinalInference, diff --git a/econml/inference/_bootstrap.py b/econml/inference/_bootstrap.py index 640eeed0e..767ffdff2 100644 --- a/econml/inference/_bootstrap.py +++ b/econml/inference/_bootstrap.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Bootstrap sampling.""" diff --git a/econml/inference/_inference.py b/econml/inference/_inference.py index 671345550..6ffafd133 100644 --- a/econml/inference/_inference.py +++ b/econml/inference/_inference.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import abc diff --git a/econml/iv/__init__.py b/econml/iv/__init__.py index 6579a9f50..b771315a8 100644 --- a/econml/iv/__init__.py +++ b/econml/iv/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. __all__ = ["dml", "dr", "nnet", "sieve"] diff --git a/econml/iv/dml/__init__.py b/econml/iv/dml/__init__.py index 1fd7d9cca..60ff3769d 100644 --- a/econml/iv/dml/__init__.py +++ b/econml/iv/dml/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Orthogonal IV for Heterogeneous Treatment Effects. diff --git a/econml/iv/dml/_dml.py b/econml/iv/dml/_dml.py index 9647292f1..af0134ba3 100644 --- a/econml/iv/dml/_dml.py +++ b/econml/iv/dml/_dml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Orthogonal IV for Heterogeneous Treatment Effects. diff --git a/econml/iv/dr/__init__.py b/econml/iv/dr/__init__.py index a47995a85..e0586f2b0 100644 --- a/econml/iv/dr/__init__.py +++ b/econml/iv/dr/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Orthogonal IV for Heterogeneous Treatment Effects. diff --git a/econml/iv/dr/_dr.py b/econml/iv/dr/_dr.py index 5ef669bcc..6e3689453 100644 --- a/econml/iv/dr/_dr.py +++ b/econml/iv/dr/_dr.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Doubly Robust IV for Heterogeneous Treatment Effects. diff --git a/econml/iv/nnet/__init__.py b/econml/iv/nnet/__init__.py index dd4f68a72..470c783d6 100644 --- a/econml/iv/nnet/__init__.py +++ b/econml/iv/nnet/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._deepiv import DeepIV diff --git a/econml/iv/nnet/_deepiv.py b/econml/iv/nnet/_deepiv.py index 4f92c2683..4a1b8f059 100644 --- a/econml/iv/nnet/_deepiv.py +++ b/econml/iv/nnet/_deepiv.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Deep IV estimator and related components.""" diff --git a/econml/iv/sieve/__init__.py b/econml/iv/sieve/__init__.py index 4cc9d29c1..cb217b7f9 100644 --- a/econml/iv/sieve/__init__.py +++ b/econml/iv/sieve/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._tsls import HermiteFeatures, DPolynomialFeatures, SieveTSLS diff --git a/econml/iv/sieve/_tsls.py b/econml/iv/sieve/_tsls.py index 08ea06e8d..53a2d92be 100644 --- a/econml/iv/sieve/_tsls.py +++ b/econml/iv/sieve/_tsls.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Provides a non-parametric two-stage least squares instrumental variable estimator.""" diff --git a/econml/metalearners/__init__.py b/econml/metalearners/__init__.py index ed7735c1d..a12392242 100644 --- a/econml/metalearners/__init__.py +++ b/econml/metalearners/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._metalearners import (TLearner, SLearner, XLearner, DomainAdaptationLearner) diff --git a/econml/metalearners/_metalearners.py b/econml/metalearners/_metalearners.py index 50c204fd4..37dc2f6d2 100644 --- a/econml/metalearners/_metalearners.py +++ b/econml/metalearners/_metalearners.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Metalearners for heterogeneous treatment effects in the context of discrete treatments. diff --git a/econml/orf/__init__.py b/econml/orf/__init__.py index 96d5e4d9a..fb95af040 100644 --- a/econml/orf/__init__.py +++ b/econml/orf/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ An implementation of Orthogonal Random Forests [orf]_ and special diff --git a/econml/orf/_causal_tree.py b/econml/orf/_causal_tree.py index 21b625e41..e24d186d5 100644 --- a/econml/orf/_causal_tree.py +++ b/econml/orf/_causal_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Basic tree utilities and methods. diff --git a/econml/orf/_ortho_forest.py b/econml/orf/_ortho_forest.py index 4c81a0cbb..d97ad8b36 100644 --- a/econml/orf/_ortho_forest.py +++ b/econml/orf/_ortho_forest.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Orthogonal Random Forest. diff --git a/econml/panel/__init__.py b/econml/panel/__init__.py index 34e76781c..3f3688a8b 100644 --- a/econml/panel/__init__.py +++ b/econml/panel/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. __all__ = ["dml"] diff --git a/econml/panel/dml/__init__.py b/econml/panel/dml/__init__.py index 6fb1669e3..8f83c8eb1 100644 --- a/econml/panel/dml/__init__.py +++ b/econml/panel/dml/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Double Machine Learning for Dynamic Treatment Effects. diff --git a/econml/panel/dml/_dml.py b/econml/panel/dml/_dml.py index 2cfd1f1bb..a12385e36 100644 --- a/econml/panel/dml/_dml.py +++ b/econml/panel/dml/_dml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import abc diff --git a/econml/policy/__init__.py b/econml/policy/__init__.py index eebcbcbea..512526f67 100644 --- a/econml/policy/__init__.py +++ b/econml/policy/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._forest import PolicyTree, PolicyForest diff --git a/econml/policy/_base.py b/econml/policy/_base.py index d2e1d847d..42546b1dd 100644 --- a/econml/policy/_base.py +++ b/econml/policy/_base.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Base classes for all Policy estimators.""" diff --git a/econml/policy/_drlearner.py b/econml/policy/_drlearner.py index 6aaabdf68..05a50989a 100644 --- a/econml/policy/_drlearner.py +++ b/econml/policy/_drlearner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from warnings import warn diff --git a/econml/policy/_forest/__init__.py b/econml/policy/_forest/__init__.py index 39bd122f1..08d88decd 100644 --- a/econml/policy/_forest/__init__.py +++ b/econml/policy/_forest/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._tree import PolicyTree diff --git a/econml/policy/_forest/_criterion.pxd b/econml/policy/_forest/_criterion.pxd index 15f732ed5..a0dcb6834 100644 --- a/econml/policy/_forest/_criterion.pxd +++ b/econml/policy/_forest/_criterion.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # published under the following license and copyright: # BSD 3-Clause License diff --git a/econml/policy/_forest/_criterion.pyx b/econml/policy/_forest/_criterion.pyx index 82a3017f7..d71f4b965 100644 --- a/econml/policy/_forest/_criterion.pyx +++ b/econml/policy/_forest/_criterion.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/policy/_forest/_forest.py b/econml/policy/_forest/_forest.py index cd9197782..1cb35e906 100644 --- a/econml/policy/_forest/_forest.py +++ b/econml/policy/_forest/_forest.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains snippets of code from diff --git a/econml/policy/_forest/_tree.py b/econml/policy/_forest/_tree.py index 5a390bcb2..4fb9bc8db 100644 --- a/econml/policy/_forest/_tree.py +++ b/econml/policy/_forest/_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code contains snippets of code from: diff --git a/econml/score/__init__.py b/econml/score/__init__.py index e5db03594..45c0c740e 100644 --- a/econml/score/__init__.py +++ b/econml/score/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """ diff --git a/econml/score/ensemble_cate.py b/econml/score/ensemble_cate.py index f7d0b4a49..605694067 100644 --- a/econml/score/ensemble_cate.py +++ b/econml/score/ensemble_cate.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/score/rscorer.py b/econml/score/rscorer.py index 838502392..bbb2da86e 100644 --- a/econml/score/rscorer.py +++ b/econml/score/rscorer.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ..dml import LinearDML diff --git a/econml/sklearn_extensions/linear_model.py b/econml/sklearn_extensions/linear_model.py index dd3a9c94c..a7f5d029c 100644 --- a/econml/sklearn_extensions/linear_model.py +++ b/econml/sklearn_extensions/linear_model.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Collection of scikit-learn extensions for linear models. diff --git a/econml/sklearn_extensions/model_selection.py b/econml/sklearn_extensions/model_selection.py index 004728fdb..79b714bbc 100644 --- a/econml/sklearn_extensions/model_selection.py +++ b/econml/sklearn_extensions/model_selection.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Collection of scikit-learn extensions for model selection techniques.""" diff --git a/econml/solutions/causal_analysis/__init__.py b/econml/solutions/causal_analysis/__init__.py index eb691b2fd..c6049a95d 100644 --- a/econml/solutions/causal_analysis/__init__.py +++ b/econml/solutions/causal_analysis/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._causal_analysis import CausalAnalysis diff --git a/econml/solutions/causal_analysis/_causal_analysis.py b/econml/solutions/causal_analysis/_causal_analysis.py index db636bed1..4ca71bfed 100644 --- a/econml/solutions/causal_analysis/_causal_analysis.py +++ b/econml/solutions/causal_analysis/_causal_analysis.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Module for assessing causal feature importance.""" diff --git a/econml/tests/dgp.py b/econml/tests/dgp.py index 403783447..88e2aff07 100644 --- a/econml/tests/dgp.py +++ b/econml/tests/dgp.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import abc import numpy as np diff --git a/econml/tests/test_ate_inference.py b/econml/tests/test_ate_inference.py index e6b9edaeb..c376049cd 100644 --- a/econml/tests/test_ate_inference.py +++ b/econml/tests/test_ate_inference.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_automated_ml.py b/econml/tests/test_automated_ml.py index 3c3f65f2a..ba222fad9 100644 --- a/econml/tests/test_automated_ml.py +++ b/econml/tests/test_automated_ml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_bootstrap.py b/econml/tests/test_bootstrap.py index 3cb6dac78..df15f9cdb 100644 --- a/econml/tests/test_bootstrap.py +++ b/econml/tests/test_bootstrap.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from econml.inference._bootstrap import BootstrapEstimator diff --git a/econml/tests/test_cate_interpreter.py b/econml/tests/test_cate_interpreter.py index a36140d14..d3f8adb78 100644 --- a/econml/tests/test_cate_interpreter.py +++ b/econml/tests/test_cate_interpreter.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_causal_analysis.py b/econml/tests/test_causal_analysis.py index b0edeb08c..8e5e1bb16 100644 --- a/econml/tests/test_causal_analysis.py +++ b/econml/tests/test_causal_analysis.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_deepiv.py b/econml/tests/test_deepiv.py index f4e1ec354..f86389d26 100644 --- a/econml/tests/test_deepiv.py +++ b/econml/tests/test_deepiv.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Tests for `deepiv` module.""" diff --git a/econml/tests/test_dml.py b/econml/tests/test_dml.py index 69e2e847c..8105f7ec7 100644 --- a/econml/tests/test_dml.py +++ b/econml/tests/test_dml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_dmliv.py b/econml/tests/test_dmliv.py index 54175d0c9..ab739c77a 100644 --- a/econml/tests/test_dmliv.py +++ b/econml/tests/test_dmliv.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import pickle diff --git a/econml/tests/test_dominicks.py b/econml/tests/test_dominicks.py index a19411bbf..a780e8905 100644 --- a/econml/tests/test_dominicks.py +++ b/econml/tests/test_dominicks.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import os.path diff --git a/econml/tests/test_dowhy.py b/econml/tests/test_dowhy.py index 4daca4af2..a247cf507 100644 --- a/econml/tests/test_dowhy.py +++ b/econml/tests/test_dowhy.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_driv.py b/econml/tests/test_driv.py index bddff8904..eabe093b4 100644 --- a/econml/tests/test_driv.py +++ b/econml/tests/test_driv.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from econml.iv.dr import (DRIV, LinearDRIV, SparseLinearDRIV, ForestDRIV, IntentToTreatDRIV, LinearIntentToTreatDRIV,) diff --git a/econml/tests/test_drlearner.py b/econml/tests/test_drlearner.py index a77878ef1..e0f251046 100644 --- a/econml/tests/test_drlearner.py +++ b/econml/tests/test_drlearner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from contextlib import ExitStack diff --git a/econml/tests/test_dynamic_dml.py b/econml/tests/test_dynamic_dml.py index 4a24aca56..0c2c7339f 100644 --- a/econml/tests/test_dynamic_dml.py +++ b/econml/tests/test_dynamic_dml.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest import pytest diff --git a/econml/tests/test_grf_cython.py b/econml/tests/test_grf_cython.py index bb3aa4c30..f3a879dae 100644 --- a/econml/tests/test_grf_cython.py +++ b/econml/tests/test_grf_cython.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_grf_python.py b/econml/tests/test_grf_python.py index 34f515216..147c5cabe 100644 --- a/econml/tests/test_grf_python.py +++ b/econml/tests/test_grf_python.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_inference.py b/econml/tests/test_inference.py index f36a55541..5a09b563a 100644 --- a/econml/tests/test_inference.py +++ b/econml/tests/test_inference.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_integration.py b/econml/tests/test_integration.py index ef9c1851f..a57a06880 100644 --- a/econml/tests/test_integration.py +++ b/econml/tests/test_integration.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from econml.utilities import get_feature_names_or_default diff --git a/econml/tests/test_linear_model.py b/econml/tests/test_linear_model.py index ac012e009..723b35a03 100644 --- a/econml/tests/test_linear_model.py +++ b/econml/tests/test_linear_model.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Tests for linear_model extensions.""" diff --git a/econml/tests/test_metalearners.py b/econml/tests/test_metalearners.py index cb13b98c9..534f1623b 100644 --- a/econml/tests/test_metalearners.py +++ b/econml/tests/test_metalearners.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_montecarlo.py b/econml/tests/test_montecarlo.py index 2ca70c198..00da85c3e 100644 --- a/econml/tests/test_montecarlo.py +++ b/econml/tests/test_montecarlo.py @@ -1,8 +1,7 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. + import unittest from sklearn.linear_model import LinearRegression, LogisticRegression from econml.dml import (DML, LinearDML, SparseLinearDML, KernelDML, NonParamDML, CausalForestDML) diff --git a/econml/tests/test_notebooks.py b/econml/tests/test_notebooks.py index e38616554..d5a7c5b69 100644 --- a/econml/tests/test_notebooks.py +++ b/econml/tests/test_notebooks.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import re diff --git a/econml/tests/test_orf.py b/econml/tests/test_orf.py index fe2736aeb..25f823636 100644 --- a/econml/tests/test_orf.py +++ b/econml/tests/test_orf.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_ortho_learner.py b/econml/tests/test_ortho_learner.py index 57ffcf685..846d9facd 100644 --- a/econml/tests/test_ortho_learner.py +++ b/econml/tests/test_ortho_learner.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from econml._ortho_learner import _OrthoLearner, _crossfit diff --git a/econml/tests/test_policy_forest.py b/econml/tests/test_policy_forest.py index a953f11ff..762c7a55c 100644 --- a/econml/tests/test_policy_forest.py +++ b/econml/tests/test_policy_forest.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_rscorer.py b/econml/tests/test_rscorer.py index f1de2748c..33c79196a 100644 --- a/econml/tests/test_rscorer.py +++ b/econml/tests/test_rscorer.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_shap.py b/econml/tests/test_shap.py index 2c69b39d4..b3605a564 100644 --- a/econml/tests/test_shap.py +++ b/econml/tests/test_shap.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import numpy as np diff --git a/econml/tests/test_statsmodels.py b/econml/tests/test_statsmodels.py index dc4573d5c..de55740fb 100644 --- a/econml/tests/test_statsmodels.py +++ b/econml/tests/test_statsmodels.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_treatment_featurization.py b/econml/tests/test_treatment_featurization.py index 085754413..a58bf5754 100644 --- a/econml/tests/test_treatment_featurization.py +++ b/econml/tests/test_treatment_featurization.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import pytest import unittest diff --git a/econml/tests/test_tree.py b/econml/tests/test_tree.py index b5d898f56..35296ca6e 100644 --- a/econml/tests/test_tree.py +++ b/econml/tests/test_tree.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/test_two_stage_least_squares.py b/econml/tests/test_two_stage_least_squares.py index 03255b10b..feb3bc039 100644 --- a/econml/tests/test_two_stage_least_squares.py +++ b/econml/tests/test_two_stage_least_squares.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Tests for two stage least squares module.""" diff --git a/econml/tests/test_utilities.py b/econml/tests/test_utilities.py index eb849d07d..7deb1669a 100644 --- a/econml/tests/test_utilities.py +++ b/econml/tests/test_utilities.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tests/utilities.py b/econml/tests/utilities.py index 83e0a656e..5f92e2201 100644 --- a/econml/tests/utilities.py +++ b/econml/tests/utilities.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. import unittest diff --git a/econml/tree/__init__.py b/econml/tree/__init__.py index ebccae49e..457d73bf7 100644 --- a/econml/tree/__init__.py +++ b/econml/tree/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. from ._criterion import Criterion, RegressionCriterion, MSE diff --git a/econml/tree/_criterion.pxd b/econml/tree/_criterion.pxd index d13368113..2eb6b8ba3 100644 --- a/econml/tree/_criterion.pxd +++ b/econml/tree/_criterion.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_criterion.pxd diff --git a/econml/tree/_criterion.pyx b/econml/tree/_criterion.pyx index 63f210280..d0b12a92f 100644 --- a/econml/tree/_criterion.pyx +++ b/econml/tree/_criterion.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_criterion.pyx diff --git a/econml/tree/_splitter.pxd b/econml/tree/_splitter.pxd index 0ab66cabc..c911a90c3 100644 --- a/econml/tree/_splitter.pxd +++ b/econml/tree/_splitter.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_splitter.pxd diff --git a/econml/tree/_splitter.pyx b/econml/tree/_splitter.pyx index 8b7ae406d..557dc6e59 100644 --- a/econml/tree/_splitter.pyx +++ b/econml/tree/_splitter.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_splitter.pyx diff --git a/econml/tree/_tree.pxd b/econml/tree/_tree.pxd index 53309a787..26f5dd68b 100644 --- a/econml/tree/_tree.pxd +++ b/econml/tree/_tree.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pxd diff --git a/econml/tree/_tree.pyx b/econml/tree/_tree.pyx index e40fac8f8..daba1a121 100644 --- a/econml/tree/_tree.pyx +++ b/econml/tree/_tree.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_tree.pyx diff --git a/econml/tree/_utils.pxd b/econml/tree/_utils.pxd index 2eaebe9ed..6a0bd2b70 100644 --- a/econml/tree/_utils.pxd +++ b/econml/tree/_utils.pxd @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_utils.pxd diff --git a/econml/tree/_utils.pyx b/econml/tree/_utils.pyx index d9e9968ac..8588f7547 100644 --- a/econml/tree/_utils.pyx +++ b/econml/tree/_utils.pyx @@ -2,7 +2,7 @@ # cython: boundscheck=False # cython: wraparound=False -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. # # This code is a fork from: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_utils.pyx diff --git a/econml/utilities.py b/econml/utilities.py index a7becc0ad..90324dcf6 100644 --- a/econml/utilities.py +++ b/econml/utilities.py @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) PyWhy contributors. All rights reserved. # Licensed under the MIT License. """Utility methods.""" diff --git a/notebooks/AutomatedML/Automated Machine Learning For EconML.ipynb b/notebooks/AutomatedML/Automated Machine Learning For EconML.ipynb index cd000b974..3c7a34f7d 100644 --- a/notebooks/AutomatedML/Automated Machine Learning For EconML.ipynb +++ b/notebooks/AutomatedML/Automated Machine Learning For EconML.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Copyright (c) Microsoft Corporation. All rights reserved.\n", + "Copyright (c) PyWhy contributors. All rights reserved.\n", "\n", "Licensed under the MIT License." ] diff --git a/notebooks/CustomerScenarios/Case Study - Customer Segmentation at An Online Media Company - EconML + DoWhy.ipynb b/notebooks/CustomerScenarios/Case Study - Customer Segmentation at An Online Media Company - EconML + DoWhy.ipynb index 387d73710..2f98443a5 100644 --- a/notebooks/CustomerScenarios/Case Study - Customer Segmentation at An Online Media Company - EconML + DoWhy.ipynb +++ b/notebooks/CustomerScenarios/Case Study - Customer Segmentation at An Online Media Company - EconML + DoWhy.ipynb @@ -2,19 +2,20 @@ "cells": [ { "cell_type": "markdown", + "metadata": {}, "source": [ "" - ], - "metadata": {} + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "# Customer Segmentation: Estimate Individualized Responses to Incentives\n", "\n", "Nowadays, business decision makers rely on estimating the causal effect of interventions to answer what-if questions about shifts in strategy, such as promoting specific product with discount, adding new features to a website or increasing investment from a sales team. However, rather than learning whether to take action for a specific intervention for all users, people are increasingly interested in understanding the different responses from different users to the two alternatives. Identifying the characteristics of users having the strongest response for the intervention could help make rules to segment the future users into different groups. This can help optimize the policy to use the least resources and get the most profit.\n", "\n", - "In this case study, we will use a personalized pricing example to explain how the [EconML](https://aka.ms/econml) and [DoWhy](https://github.com/microsoft/dowhy) libraries could fit into this problem and provide robust and reliable causal solutions.\n", + "In this case study, we will use a personalized pricing example to explain how the [EconML](https://aka.ms/econml) and [DoWhy](https://github.com/py-why/dowhy) libraries could fit into this problem and provide robust and reliable causal solutions.\n", "\n", "### Summary\n", "\n", @@ -32,11 +33,11 @@ "8. [Conclusions](#conclusion)\n", "\n", "\n" - ], - "metadata": {} + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "# Background \n", "\n", @@ -45,42 +46,42 @@ "The global online media market is growing fast over the years. Media companies are always interested in attracting more users into the market and encouraging them to buy more songs or become members. In this example, we'll consider a scenario where one experiment a media company is running is to give small discount (10%, 20% or 0) to their current users based on their income level in order to boost the likelihood of their purchase. The goal is to understand the **heterogeneous price elasticity of demand** for people with different income level, learning which users would respond most strongly to a small discount. Furthermore, their end goal is to make sure that despite decreasing the price for some consumers, the demand is raised enough to boost the overall revenue.\n", "\n", "The EconML and DoWhy libraries complement each other in implementing this solution. On one hand, the DoWhy library can help [build a causal model, indentify the causal effect](#identify) and [test causal assumptions](#robustness). On the other hand, EconML’s `DML` based estimators can be used to take the discount variation in existing data, along with a rich set of user features, to [estimate heterogeneous price sensitivities](#estimate) that vary with multiple customer features. Then, the `SingleTreeCateInterpreter` provides a [presentation-ready summary](#interpret) of the key features that explain the biggest differences in responsiveness to a discount, and the `SingleTreePolicyInterpreter` recommends a [policy](#policy) on who should receive a discount in order to increase revenue (not only demand), which could help the company to set an optimal price for those users in the future." - ], - "metadata": {} + ] }, { "cell_type": "code", "execution_count": 2, + "metadata": {}, + "outputs": [], "source": [ - "# Some imports to get us started\r\n", - "import warnings\r\n", - "warnings.simplefilter('ignore')\r\n", - "\r\n", - "# Utilities\r\n", - "import os\r\n", - "import urllib.request\r\n", - "import numpy as np\r\n", - "import pandas as pd\r\n", - "from networkx.drawing.nx_pydot import to_pydot\r\n", - "from IPython.display import Image, display\r\n", - "\r\n", - "# Generic ML imports\r\n", - "from sklearn.preprocessing import PolynomialFeatures\r\n", - "from sklearn.ensemble import GradientBoostingRegressor\r\n", - "\r\n", - "# EconML imports\r\n", - "from econml.dml import LinearDML, CausalForestDML\r\n", - "from econml.cate_interpreter import SingleTreeCateInterpreter, SingleTreePolicyInterpreter\r\n", - "\r\n", - "import matplotlib.pyplot as plt\r\n", - "\r\n", + "# Some imports to get us started\n", + "import warnings\n", + "warnings.simplefilter('ignore')\n", + "\n", + "# Utilities\n", + "import os\n", + "import urllib.request\n", + "import numpy as np\n", + "import pandas as pd\n", + "from networkx.drawing.nx_pydot import to_pydot\n", + "from IPython.display import Image, display\n", + "\n", + "# Generic ML imports\n", + "from sklearn.preprocessing import PolynomialFeatures\n", + "from sklearn.ensemble import GradientBoostingRegressor\n", + "\n", + "# EconML imports\n", + "from econml.dml import LinearDML, CausalForestDML\n", + "from econml.cate_interpreter import SingleTreeCateInterpreter, SingleTreePolicyInterpreter\n", + "\n", + "import matplotlib.pyplot as plt\n", + "\n", "%matplotlib inline" - ], - "outputs": [], - "metadata": {} + ] }, { "cell_type": "markdown", + "metadata": {}, "source": [ "# Data \n", "\n", @@ -127,46 +128,26 @@ "Y &= \\gamma(X) \\cdot T + \\beta(X,W)\n", "\\end{align}\n", "\n" - ], - "metadata": {} + ] }, { "cell_type": "code", "execution_count": 3, + "metadata": {}, + "outputs": [], "source": [ - "# Import the sample pricing data\r\n", - "file_url = \"https://msalicedatapublic.blob.core.windows.net/datasets/Pricing/pricing_sample.csv\"\r\n", + "# Import the sample pricing data\n", + "file_url = \"https://msalicedatapublic.blob.core.windows.net/datasets/Pricing/pricing_sample.csv\"\n", "train_data = pd.read_csv(file_url)" - ], - "outputs": [], - "metadata": {} + ] }, { "cell_type": "code", "execution_count": 4, - "source": [ - "# Data sample\r\n", - "train_data.head()" - ], + "metadata": {}, "outputs": [ { - "output_type": "execute_result", "data": { - "text/plain": [ - " account_age age avg_hours days_visited friends_count has_membership \\\n", - "0 3 53 1.834234 2 8 1 \n", - "1 5 54 7.171411 7 9 0 \n", - "2 3 33 5.351920 6 9 0 \n", - "3 2 34 6.723551 0 8 0 \n", - "4 4 30 2.448247 5 8 1 \n", - "\n", - " is_US songs_purchased income price demand \n", - "0 1 4.903237 0.960863 1.0 3.917117 \n", - "1 1 3.330161 0.732487 1.0 11.585706 \n", - "2 1 3.036203 1.130937 1.0 24.675960 \n", - "3 1 7.911926 0.929197 1.0 6.361776 \n", - "4 0 7.148967 0.533527 0.8 12.624123 " - ], "text/html": [ "
\n", "