uber / causalml

Uplift modeling and causal inference with machine learning algorithms
Other
4.87k stars 756 forks source link

Add with_std, with_counts to create_table_one #748

Closed lee-junseok closed 2 months ago

lee-junseok commented 3 months ago

Proposed changes

A auxiliary function create_table_one currently generates a table of mean values in a string format of "{:.2f} ({:.2f})".format(x.mean(), x.std()) and a user cannot use the mean values directly from the output table along with SMD calculated.

Issue: https://github.com/uber/causalml/issues/747

Types of changes

What types of changes does your code introduce to CausalML? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc. This PR template is adopted from appium.

jeongyoonlee commented 3 months ago

Thanks for your contribution, @lee-junseok. Currently, the linting test is failing. Can you run the latest black and update the PR? Thanks.

paullo0106 commented 3 months ago

@lee-junseok you can find the details in the failed log here. To fix the formatting error with black, you can check our contribution guide. Thanks

# move to the top directory of the causalml repository
$ cd causalml 
$ pip install -U black
$ black . 
lee-junseok commented 2 months ago

Sorry for the delay. Addressed the issue and made it ready for review. Thank you!