shieru1214 commented on PR #2615: URL: https://github.com/apache/systemds/pull/2615#issuecomment-5881391015
This change improves the test coverage of `hyperparameter_tuner.py`. The added tests focus on three parts: search space construction, trial parameter, and tuning result handling. ### 1. Search space construction This part converts the parameter ranges declared by operators into search spaces used by Optuna. `_build_param_specs` is the entry function and was already fully covered, so I mainly added tests for its three helpers. The tests cover the input types handled by `_param_values_to_spec`, the input stats created from `window_size`, and the expansion and narrowing of nested aggregation parameters. ### 2. Trial parameter The first part flattens the parameters, while this part puts the values selected by Optuna back into the correct DAG nodes. It mainly covers `_apply_trial_params_to_node`, `_apply_pushdown_trial_params`, `_materialize_node_params`, and the two operation checks. I added tests for pushed-down aggregations and `AggregatedRepresentation`, and also checked parameter placement, unchanged base parameters, non-class inputs, import failures, leaf nodes, and empty parameters. ### 3. Tuning result handling This part covers how tuning results are stored and read back. It includes `add_result`, `setup_mm`, `get_k_best_dags`, and `get_k_best_results`. The new tests check multimodal result storage, skipped `None` results, and the two `optimize_unimodal` cases. They also check that `best_params` are applied to a rebuilt DAG, the leaf and root are kept correctly, the original DAG is unchanged, and empty or multiple results are handled. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
