dscolby / CausalELM.jl

Taking causal inference to the extreme!
https://dscolby.github.io/CausalELM.jl/
MIT License
20 stars 0 forks source link

Refactor GComputation, SLearner, DoubleMachineLearner, and RLearner #45

Closed dscolby closed 3 weeks ago

dscolby commented 1 month ago

S-learning does almost the same things as G-computation and R-learning is almost the same as double machine learning. Instead of having GComputation and DoubmleMachineLearner encapsulated within SLearner and RLearner and reusing the estimate_causal_effect! method for GComputation and DoubleMachineLearner, we should create AbstractSingleModelLearner and AbstractDoubleMachineLearner types. Then we can get rid of the encapsulation and having separate methods for them in inference.jl and overloading Base.getproperty and Base.setproperty! to get the Y vectors and just have estimate_causal_effect! methods for the abstract classes. The methods would then just do slightly different things for CATE vs ATE estimation.

dscolby commented 1 month ago

This should probably get a v0.6.1 release.

dscolby commented 1 month ago

This might need to be v0.6 instead because it requires making so many getproperty and setproperty! methods to make it work without refactoring!

dscolby commented 1 month ago

Related to #44

dscolby commented 3 weeks ago

Implemented in commit 3c04f9c.