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

Vasilis/local linear #13

Merged
merged 63 commits into from
Apr 6, 2019
Merged

Vasilis/local linear #13

merged 63 commits into from
Apr 6, 2019

Conversation

vasilismsr
Copy link
Contributor

@vasilismsr vasilismsr commented Mar 16, 2019

  1. Optimized computations in causal tree to reduce overall ortho forest computation by two orders of magnitude. Improvement in fitting time primarily came from replacing internal loop over candidate splits with numpy array calculations. Improvement in predict time came from removing parallelism, which was adding data copy overhead.
  2. Added local linear correction (as in Athey, Friedman, Wager) to both ortho forest classes for better local fits.
  3. Minor edits in the ortho forest and causal tree architecture and default parameters.

…emoved the second order parameters from the moment and gradient function so that node splitting only depends on the first order intercepts and not on the second order linear part
…parate moment and mean gradient for first and second stage. Changed local linear ortho forest so that sample splitting happens in the same way as continuous ortho forest (i.e. just based on intercepts), while final only final stage estimation has the local linear part.
…ss. Small changes to discrete treatment forest defaults
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.

Mostly looks good to me, but would be good to have Miruna approve, too. I've made a few suggestions.

econml/data/dgps.py Outdated Show resolved Hide resolved
econml/ortho_forest.py Outdated Show resolved Hide resolved
econml/ortho_forest.py Show resolved Hide resolved
econml/ortho_forest.py Show resolved Hide resolved
econml/causal_tree.py Outdated Show resolved Hide resolved
econml/causal_tree.py Outdated Show resolved Hide resolved
econml/causal_tree.py Outdated Show resolved Hide resolved
econml/causal_tree.py Outdated Show resolved Hide resolved
econml/causal_tree.py Show resolved Hide resolved
econml/ortho_forest.py Outdated Show resolved Hide resolved
@kbattocchi kbattocchi added this to the v0.2 milestone Mar 22, 2019
Copy link
Contributor

@moprescu moprescu left a comment

Choose a reason for hiding this comment

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

This looks really good! Went line by line and can't find any bugs/issues. I left some minor comments below.

econml/causal_tree.py Show resolved Hide resolved
econml/causal_tree.py Show resolved Hide resolved
econml/causal_tree.py Outdated Show resolved Hide resolved
econml/ortho_forest.py Outdated Show resolved Hide resolved
econml/tests/test_orf.py Outdated Show resolved Hide resolved
econml/tests/test_orf.py Outdated Show resolved Hide resolved
T_hat = _cross_fit(model_T, X_tilde, T, split_indices, sample_weight=sample_weight)
Y_hat = _cross_fit(model_Y, X_tilde, Y, split_indices, sample_weight=sample_weight)
else:
T_hat = model_T.fit(X_tilde, T, sample_weight=sample_weight).predict(X_tilde)
Copy link
Contributor

Choose a reason for hiding this comment

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

The weights are never used in the first stage. I think we should omit passing them in here so the user doesn't have to pass in a weighted model for model_T and model_Y. This will potentially avoid some issues in the future. Same for the DiscreteTreatmentOrthoForest nuisance estimator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check out if I did it correctly

Copy link
Collaborator

Choose a reason for hiding this comment

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

@moprescu Looks like I need to dismiss this review to enable checkin - I assume that's okay with you.

@kbattocchi kbattocchi dismissed moprescu’s stale review April 6, 2019 00:43

Vasilis has addressed the requested changes

@kbattocchi kbattocchi merged commit 9ea042d into master Apr 6, 2019
@kbattocchi kbattocchi deleted the vasilis/local-linear branch April 6, 2019 00:45
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.

4 participants