automl / ConfigSpace

Domain specific language for configuration spaces in Python. Useful for hyperparameter optimization and algorithm configuration.
https://automl.github.io/ConfigSpace/
Other
202 stars 93 forks source link

Improve implementation of ``_compute_normalization `` #331

Closed herilalaina closed 1 year ago

herilalaina commented 1 year ago

This PR fixes issue #283 by improving the implementation of _compute_normalization. In the original version, this function returns the sum of probabilities over the specified interval. It has a limitation when dealing with large intervals, as discussed in the issue.

In this PR, the original implementation is modified to compute the sum only within the interval that contains 99.99999999% of the data. This change is only applied when the difference between the lower and upper bounds is large enough to cause the issue.

I am not sure how to rigorously test the code. For now, I have added a few test cases to compare the output of both the original and modified implementations.

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (bebc36e) 73.47% compared to head (361d403) 73.47%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #331 +/- ## ======================================= Coverage 73.47% 73.47% ======================================= Files 29 29 Lines 2831 2831 Branches 629 629 ======================================= Hits 2080 2080 Misses 633 633 Partials 118 118 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.