Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create both sample_weight and freq_weight for fit #439

Merged
merged 6 commits into from
Mar 31, 2021

Conversation

heimengqi
Copy link
Contributor

@heimengqi heimengqi commented Mar 23, 2021

  • Make StatsmodelsLinearRegresssion allow fractional weight for each individual sample, which is sample_weight. Rename the weights used as the count of observations for corresponding sample_var as freq_weight.
  • For all the child classes inherit from _OrthoLearner, only expose freq_weight and sample_weight when the final stage is StatsmodelsLinearRegression or its parent class.
  • Fix a few places to make sure it works consistently with un-summarized data when both weights exist.

@heimengqi heimengqi changed the title change StatsmodelsLinearRegression to allow fractional weight create both sample_weight and freq_weight for fit Mar 27, 2021
econml/_ortho_learner.py Show resolved Hide resolved
econml/dml/causal_forest.py Show resolved Hide resolved
econml/dml/dml.py Show resolved Hide resolved
econml/dr/_drlearner.py Show resolved Hide resolved
econml/dr/_drlearner.py Show resolved Hide resolved
econml/grf/_base_grf.py Outdated Show resolved Hide resolved
econml/iv/dr/_dr.py Outdated Show resolved Hide resolved
econml/sklearn_extensions/linear_model.py Outdated Show resolved Hide resolved
econml/tests/test_drlearner.py Show resolved Hide resolved
Copy link
Collaborator

@kbattocchi kbattocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I've mostly just suggested some minor tweaks to some of the docstrings

econml/_ortho_learner.py Outdated Show resolved Hide resolved
econml/_ortho_learner.py Outdated Show resolved Hide resolved
econml/_ortho_learner.py Outdated Show resolved Hide resolved
econml/_ortho_learner.py Outdated Show resolved Hide resolved
econml/_ortho_learner.py Show resolved Hide resolved
econml/iv/dr/_dr.py Outdated Show resolved Hide resolved
econml/iv/dr/_dr.py Outdated Show resolved Hide resolved
econml/iv/dr/_dr.py Outdated Show resolved Hide resolved
econml/iv/dr/_dr.py Outdated Show resolved Hide resolved
econml/iv/dr/_dr.py Show resolved Hide resolved
@heimengqi heimengqi merged commit 9630421 into master Mar 31, 2021
@heimengqi heimengqi deleted the mehei/fractionalweight branch March 31, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants