Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Included initial Meta S-learner classifier code. * Included references in docstring. * Fixed numpy typing. * Removed unused import * Created new type to allow mutable features, which is required with S-learner specifically. * Fixed types based on new created type. * Removed unused import. * Requires learner to be mandatory. * Removed lgbm import * meta_learners.py: converted _predict_for_treatment and _predict_for_control functions into single _predict_by_treatment_flag function. * Renamed LearnerMutableFeaturesFnType to LearnerMutableParametersFnType. * included tests * Fixed docstring and handled case in which uplift is negative. * fix lint * removed unused imports - wip * added test__simulate_treatment_effect * fix assertions * fix assert_frame_equal * meta_learners.py: included control_name parameter in _simulate_treatment_effect call. * Included custom exceptions. * meta_learner.py: Included exception checks in some functions. * meta_learners.py: fixed bug. Changed treatment_col by treatment_name * included assertion tests * updated predict_by_treatment_flag test functions to test only the treatment value (1 or 0) * added tests for causal_s_classification_learner * changed function test name * included explanation to test__simulate_treatment_effect * moved column drop from simulate_treatment_effect to predict_by_treatment_flag * changed mock learner for a mock function at test__simulate_treatment_effect * included test for learners being the correct type * meta_learners.py: fixed replace to x.replace(__uplift, ) * test_meta_learners.py: fixed test__simulate_treatment_effect to adapt change in replace on previous commit. * meta_learners.py: fixed description of prediction_column in docstring. * causal_s_learner_demo.ipynb: included demo notebook for causal s-learner. * causal_s_learner_demo.ipynb: fixed notebook headers. * Rerun notebook. * causal_s_learner_demo.ipynb: included documentation in the notebook. * Improved notebook description. * Initial commit of T-Learner * Add docstring * Lint * Change _get_model_fcn return type * Fix learner type * Removed unused import * Removed unused import * Updated types * Fix variables naming * Added tests * Lint * Type fix * Improve documentation of T-Learner Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Fixed t-learner docstring Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Fixed t-learner docstring Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Fixed t-learner parameter type Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Fixed t-learner docstring Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Fix t-learner argument type Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Improve T-Learner types Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Remove unused type Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Add SHAP to logs Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]> * Update src/fklearn/causal/cate_learning/meta_learners.py * Applied review comments * Update demo notebook * Merged with master and included rst * Fix test * Update t-learner notebook Co-authored-by: Giulio Santo <[email protected]> Co-authored-by: Nicolas Behar <[email protected]> Co-authored-by: Giulio Cesare Mastrocinque Santo <[email protected]>
- Loading branch information