Skip to content

Conversation

@carl-offerfit
Copy link
Contributor

  • Allow specification of an alternative sklearn score function for double ML models
  • Add score_nuisances function

@carl-offerfit
Copy link
Contributor Author

@kbattocchi Here's an update:

  1. I fixed the type hints to use the old Union approach rather than the python 3.10 |. That should fix the Python 3.8 & 3.9 errors.
  2. I added a unit test for the ML score signature validation
  3. I researched sklearn make_scorer and as far as I can tell it doesn't do any validation at all - if the function you passed to make_scorer is not valid it just fails when you try to use it. That makes me wonder if my approach was over engineered, and instead we should just let it fail. At the same time, I'm a bit attached to the approach since I spent time on it. ;-) WDYT?

@carl-offerfit
Copy link
Contributor Author

@kbattocchi I fixed a bug that was cause of the test failures. Please let me know if there are still issues.

Copy link
Collaborator

@kbattocchi kbattocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the changes to pyproject.toml; also the DCO check is still failing because of commits that weren't signed off correctly.

pyproject.toml Outdated
[tool.pytest.ini_options]
testpaths = ["econml/tests"]
addopts = "--junitxml=junit/test-results.xml -n auto --strict-markers --cov-config=pyproject.toml --cov --import-mode=importlib"
addopts = "--junitxml=junit/test-results.xml -n0 --strict-markers --cov-config=pyproject.toml --import-mode=importlib"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you just changing these to run locally? We definitely want to use xdist and get coverage results, so please revert this change. If your own test needs to run serially you can use a @pytest.mark.serial attribute to mark your method (or class).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was to run the tests locally. I did not mean to commit it, sorry!

KuanHaoHuang and others added 25 commits July 7, 2025 10:42
Signed-off-by: Kuan-Hao Huang <kuan.hao.huang.b02@gmail.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: kgao <kevin.leo.gao@gmail.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
…commit

Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Use a function to verify the scoring function, whether sklearn or otherwise

Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl@offerfit.ai>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
…N,1), as older pearsonr is

Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
for more information, see https://pre-commit.ci

Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Fabio Vera <fabiovera@microsoft.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: maartenvanhooft <mjgvanhooft@gmail.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
)

Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Atharva Kelkar <akelkar@novilabs.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
Signed-off-by: Carl Gold <carl.goldd@braze.com>
@carl-offerfit
Copy link
Contributor Author

@kbattocchi I think I fixed the issues with the pyproject.toml and the sign-off. Let me know if you see any other issues.

@kbattocchi
Copy link
Collaborator

Closing in favor of #988

@kbattocchi kbattocchi closed this Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants