Conversation
This PR fixes a bug in which integer hyperparameters would not be created correctly in the initial design. This went unnoticed, except in the case where it was part of a condition and the function deactivate_inactive_hyperparameters was called. This PR fixes this bug by mapping the random float that was sampled by, for example and LHD or Sobol sequence, to the float representation of an integer by calling _transform and _inverse_transform of the integer hyperparameter.
Updated description
Fix 531 correctly create integers in initial design
Co-authored-by: René Sass <mail@renesass.de>
Co-authored-by: René Sass <mail@renesass.de>
Hotfix/early emails stale issues
Add Git-Flow Workflow Specification
Implement RunHistoryPercentileEncoder for response value transformation.
* Added ecosystem information in documentation * Changed formatting from bullet points to sentences * Update index.md --------- Co-authored-by: sagar1sharma <sagarsharma.ss329.ss46@gmail.com> Co-authored-by: C. Benjamins <75323339+benjamc@users.noreply.github.com>
* Play With paralelisation * Update Parallelism Doc * Update paralelisation example * Update docs * Update parallelism docs * Update parallelism * Adapt Changelog.md --------- Co-authored-by: Lukas Fehring <l.fehring@ai.uni-hannover.de>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…apts-sampling 1184 prioracquisitionfunction adapts sampling
Removed debug print statements and added warnings for non-positive values.
Removed comments that ensure minimal value and cutoff limits.
Fix formatting and indentation in docstring.
966 output trafos
1264 bug reset after initialization
There was a problem hiding this comment.
Pull request overview
This PR substantially expands SMAC3’s functionality and documentation, including enabling math rendering in MkDocs, adding adaptive capping support (with cutoff propagation to target functions), and switching the default RandomForest surrogate from pyrfr to a scikit-learn based implementation (while keeping an opt-in pyrfr path).
Changes:
- Enable MathJax + arithmatex in MkDocs and update math formatting in acquisition-function docs.
- Add adaptive capping plumbing: scenario flags, cutoff computation in intensifier, and cutoff forwarding through runners/facade signature handling.
- Replace the default RF surrogate backend with scikit-learn, add optional
pyrfrRF implementation and related installation/docs updates.
Reviewed changes
Copilot reviewed 71 out of 73 changed files in this pull request and generated 29 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utils/test_configspace.py | Adds test for creating a uniform-transformed ConfigSpace copy. |
| tests/test_multi_objective/test_combined_function.py | Expands mean-aggregation test to loop over objective weights. |
| tests/test_model/test_rf.py | Adds correctness checks and new log_y-related RF test. |
| tests/test_main/test_smbo.py | Formatting + adds SMBO reset test. |
| tests/test_main/test_config_selector.py | Adds test for exhausted configuration space exception. |
| tests/test_intensifier/test_intensifier.py | Minor formatting and import changes. |
| tests/test_intensifier/test_hyperband_utils.py | Updates expected budgets/trials + adds __main__ block. |
| tests/test_intensifier/test_adaptive_capping_intensifier.py | Adds adaptive capping behavior test with logging mock. |
| tests/fixtures/config_selector.py | Updates fixture to renamed max_new_config_tries parameter. |
| smac/utils/configspace.py | Updates continuous design transform + adds create_uniform_configspace_copy. |
| smac/scenario.py | Expands deterministic docs + adds adaptive capping + runtime cutoff params and validation. |
| smac/runner/target_function_script_runner.py | Adds additional_info plumbing and cutoff forwarding. |
| smac/runner/target_function_runner.py | Adds additional_info plumbing and cutoff forwarding. |
| smac/runner/dask_runner.py | Forwards additional_info into the single-worker runner. |
| smac/runner/abstract_runner.py | Passes TrialInfo.additional_info into runner calls. |
| smac/runhistory/runhistory.py | Adds n_objectives to support RUNNING trial costs for multi-objective. |
| smac/runhistory/encoder/power_transform_encoder.py | Adds Yeo–Johnson power transform encoder. |
| smac/runhistory/encoder/percentile_encoder.py | Adds percentile-based encoder (currently prints debug output). |
| smac/runhistory/encoder/gaussian_copula_encoder.py | Adds Gaussian-copula style encoder. |
| smac/runhistory/encoder/abstract_encoder.py | Adjusts warning string formatting. |
| smac/runhistory/dataclasses.py | Adds additional_info field to TrialInfo. |
| smac/multi_objective/parego.py | Updates ParEGO reference URL. |
| smac/model/random_forest/random_forest.py | Replaces pyrfr-based RF with scikit-learn-based RF implementation. |
| smac/model/random_forest/pyrfr/random_forest_pyrfr.py | Introduces optional pyrfr RF implementation in separate module. |
| smac/model/random_forest/pyrfr/init.py | Package init for pyrfr backend. |
| smac/main/smbo.py | Allows runner=None for ask/tell; changes validate to use submit/iter_results; adds reset behavior. |
| smac/main/exceptions.py | Adds ConfigurationSpaceExhaustedException. |
| smac/main/config_selector.py | Renames retries param + adds fallback random sampling and exhaustion exception. |
| smac/intensifier/successive_halving.py | Adds uses_cutoffs property + updates warning text. |
| smac/intensifier/intensifier.py | Adds uses_cutoffs + adaptive capping cutoff computation and propagation. |
| smac/intensifier/hyperband_utils.py | Fixes total budget computation to budget*configs. |
| smac/intensifier/abstract_intensifier.py | Adds uses_cutoffs abstract property + dominance/rejection logic enhancements. |
| smac/initial_design/random_design.py | Samples initial configs from uniformized ConfigSpace copy. |
| smac/initial_design/abstract_initial_design.py | Adjusts n_configs scaling logic for n_configs<=1. |
| smac/facade/old/multi_fidelity_facade_pyrfr.py | Adds legacy facade for pyrfr RF in multi-fidelity. |
| smac/facade/old/hyperparameter_optimization_facade_pyrfr.py | Adds legacy facade for pyrfr RF in HPO. |
| smac/facade/old/init.py | Exposes legacy pyrfr facades via smac.facade.old. |
| smac/facade/algorithm_configuration_facade.py | Formatting-only change. |
| smac/facade/abstract_facade.py | Makes target_function optional; threads cutoff requirement into signature args; runner meta handles None. |
| smac/acquisition/maximizer/local_search.py | Changes init-point de-duplication to use a set (order impact). |
| smac/acquisition/function/thompson.py | Updates math markup formatting. |
| smac/acquisition/function/probability_improvement.py | Updates math markup formatting. |
| smac/acquisition/function/expected_improvement.py | Updates math markup formatting. |
| smac/acquisition/function/confidence_bound.py | Refactors confidence bound into abstract base + LCB/UCB; updates docs. |
| setup.py | Moves pyrfr to extras; bumps scikit-learn minimum version. |
| mkdocs.yaml | Enables MathJax + arithmatex; switches docstring style to numpy; updates nav. |
| examples/2_multi_fidelity/1_mlp_epochs.py | Updates link formatting. |
| examples/1_basics/9_additional_arguments.py | New example for passing additional arguments to target functions. |
| examples/1_basics/8_warmstart.py | Updates usage text and argument naming. |
| examples/1_basics/8_adaptive_capping.py | New adaptive capping example. |
| examples/1_basics/7_parallelization_cluster.py | Refactors and updates cluster parallelization example. |
| examples/1_basics/6_priors.py | Fixes configspace reference for prior example. |
| examples/1_basics/3_ask_and_tell.py | Updates ask/tell guidance and target_function argument naming. |
| examples/1_basics/2_svm_cv.py | Updates config dict extraction logic. |
| docs/index.md | Adds ecosystem section + expands feature list. |
| docs/advanced_usage/9_parallelism.md | Expands and restructures parallelism documentation. |
| docs/advanced_usage/5_ask_and_tell.md | Adds note about ask/tell-only usage (terminology issue). |
| docs/advanced_usage/2_multi_fidelity.md | Fixes link to examples. |
| docs/advanced_usage/1_components.md | Adds warning about initial-design distributions being ignored + links. |
| docs/advanced_usage/13_adaptive_capping.md | New adaptive capping documentation page. |
| docs/advanced_usage/11_reproducibility.md | Adds reset-related warning. |
| docs/3_getting_started.md | Adds deterministic behavior info + SMBO section (includes a runhistory usage mistake). |
| docs/1_installation.md | Updates Python requirement + adds pyrfr optional installation instructions. |
| README.md | Updates install guidance + adds pyrfr optional section. |
| CHANGELOG.md | Adds 2.4.0 entry and additional 2.3.1 notes. |
| .gitignore | Adds SMAC/Dask log paths and extra artifacts. |
| .github/workflows/recent_reminder.yml | Bumps action-send-mail version. |
| .github/workflows/pytest.yml | Updates python matrix and GitHub actions versions. |
| .github/workflows/pre-commit.yml | Updates actions versions. |
| .github/workflows/pre-commit-update.yml | Updates actions versions. |
| .github/workflows/docs.yml | Updates actions versions. |
| .github/workflows/dist.yml | Updates actions versions. |
| .github/workflows/citation.yml | Updates checkout action version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| super().__init__( | ||
| DecisionTreeRegressor(), | ||
| n_estimators, | ||
| estimator_params=( | ||
| "criterion", | ||
| "max_depth", | ||
| "min_samples_split", | ||
| "min_samples_leaf", | ||
| "min_weight_fraction_leaf", | ||
| "max_features", |
There was a problem hiding this comment.
EPMRandomForest accepts a splitter argument but it is not included in estimator_params, so the underlying DecisionTreeRegressor instances will keep their default splitter (typically "best") regardless of the provided value. Add "splitter" to estimator_params (and ensure it is forwarded) so the parameter actually takes effect.
| if self.log_y: | ||
| for tree, samples_idx in zip(self.estimators_, self.estimators_samples_): | ||
| curX = X[samples_idx] | ||
| curY = y[samples_idx] | ||
| preds = tree.apply(curX) | ||
| for k in np.unique(preds): | ||
| tree.tree_.value[k, 0, 0] = np.log(np.exp(curY[preds == k]).mean()) |
There was a problem hiding this comment.
fit() assumes self.estimators_samples_ is available when log_y is True. This attribute is not guaranteed to exist (e.g., when bootstrap=False), which would raise at runtime. Guard this logic (or enforce bootstrap) and ensure leaf-value adjustment works for non-bootstrap training too.
| if "cutoff" in self._required_arguments and additional_info is not None: | ||
| kwargs["cutoff"] = additional_info["cutoff"] | ||
|
|
There was a problem hiding this comment.
Accessing additional_info["cutoff"] can raise KeyError when additional_info is provided but does not contain a cutoff entry. Consider checking for the key (or using .get) and raising a clearer error if it is required.
| into the intensification process. | ||
|
|
||
| Notice: if you are exclusively using the ask-and-tell interface and do not use `smac.optimize()`, then smac no longer | ||
| is responsible for the evaluation of the trials and therefore the Facade no longer will require a specified `target_algorithm` argument. |
There was a problem hiding this comment.
The docs say the facade does not require a target_algorithm argument, but the constructor parameter is named target_function (and that's what users pass throughout the docs/examples). Please rename to target_function here to avoid confusion.
| is responsible for the evaluation of the trials and therefore the Facade no longer will require a specified `target_algorithm` argument. | |
| is responsible for the evaluation of the trials and therefore the Facade no longer will require a specified `target_function` argument. |
| self._runner.submit_trial(trial_info=trial) | ||
| costs = [trial_value.cost for _, trial_value in self._runner.iter_results()] | ||
| np_costs = np.array(costs) |
There was a problem hiding this comment.
validate() submits trials and immediately drains iter_results() without waiting for completion. For asynchronous runners (e.g. Dask), this can return an empty/partial costs list and yield nan or incorrect averages. Consider waiting until all submitted validation trials are finished (e.g. loop on is_running()/wait() or track expected trial count) before computing the mean, and ensure only the validation results are aggregated.
|
|
||
| import warnings | ||
|
|
||
| from ConfigSpace import Categorical, Configuration, ConfigurationSpace, Float |
There was a problem hiding this comment.
Import of 'Categorical' is not used.
| from ConfigSpace import Categorical, Configuration, ConfigurationSpace, Float | |
| from ConfigSpace import Configuration, ConfigurationSpace, Float |
| @@ -0,0 +1,150 @@ | |||
| import logging | |||
There was a problem hiding this comment.
Import of 'logging' is not used.
| @@ -0,0 +1,150 @@ | |||
| import logging | |||
| import shutil | |||
| from logging import Logger | |||
There was a problem hiding this comment.
Import of 'Logger' is not used.
| from smac.initial_design.random_design import RandomInitialDesign | ||
| from smac.intensifier.intensifier import Intensifier | ||
| from smac.main.config_selector import ConfigSelector | ||
| from smac.runhistory import TrialInfo, TrialKey, TrialValue |
There was a problem hiding this comment.
Import of 'TrialInfo' is not used.
Import of 'TrialKey' is not used.
Import of 'TrialValue' is not used.
| # start smac run | ||
| try: | ||
| smac.optimize() | ||
| except ConfigurationSpaceExhaustedException: |
There was a problem hiding this comment.
'except' clause does nothing but pass and there is no explanatory comment.
Reference Issues/PRs
Description, Motivation and Context
Changes
Type Of Changes
What is Missing?
Checklist
developbranch.CHANGELOG.rst.Any other comments?