EconML
EconML copied to clipboard
Deep Learning approach
Current implement for DML is based on gradient-base approach like tree-method. Any one know how to use the deep learning to implement the DML?
Could you clarify what you mean? It should be straightforward to use deep learning for the first stages already - for example you could pass an sklearn.neural_network.MLPRegressor for the Y and T models (or create a simple wrapper with a compatible interface around a tensorflow or pytorch model).
If you want to use deep learning for the final model, then there are a few possibilities:
- If you have a single-dimensional treatment and outcome, you can use the
NonParamDMLclass; however, note that this requires that the final model'sfitmethod should support asample_weightargument, which sklearn'sMLPRegressorunfortunately does not (but see e.g. https://github.com/scikit-learn/scikit-learn/pull/11723 which if merged would enable this directly). - Otherwise you'll need to subclass
DMLand do a bit more work (e.g. you'll need to ensure that the structure of your neural net ensures that the outcome is a linear function of the treatment).