EconML icon indicating copy to clipboard operation
EconML copied to clipboard

Deep Learning approach

Open MarkovSc opened this issue 3 years ago • 1 comments

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?

MarkovSc avatar Nov 22 '21 10:11 MarkovSc

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 NonParamDML class; however, note that this requires that the final model's fit method should support a sample_weight argument, which sklearn's MLPRegressor unfortunately 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 DML and 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).

kbattocchi avatar Dec 01 '21 18:12 kbattocchi