Utils
neps.optimizers.multi_fidelity.utils
#
MFObservedData
#
(Under development)
This module is used to unify the data access across different Multi-Fidelity optimizers. It stores column names and index names. Possible optimizations and extensions of the observed data should be handled by this class.
So far this is just a draft class containing the DataFrame and some properties.
Source code in neps/optimizers/multi_fidelity/utils.py
add_data
#
add_data(
data: list[Any] | list[list[Any]],
index: (
tuple[int, ...]
| Sequence[tuple[int, ...]]
| Sequence[int]
| int
),
error: bool = False,
)
Add data only if none of the indices are already existing in the DataFrame
Source code in neps/optimizers/multi_fidelity/utils.py
get_best_learning_curve_id
#
get_best_learning_curve_id(maximize: bool = False)
Returns a single configuration id of the best observed performance
this will always return the single best lowest ID
if two configurations has the same performance
Source code in neps/optimizers/multi_fidelity/utils.py
get_best_performance_for_each_budget
#
get_best_performance_for_each_budget(
maximize: bool = False,
)
Returns a series object with the best partial configuration for each budget id
this will always map the best lowest ID if two configurations
has the same performance at the same fidelity
Source code in neps/optimizers/multi_fidelity/utils.py
get_incumbents_for_budgets
#
get_incumbents_for_budgets(maximize: bool = False)
Returns a series object with the best partial configuration for each budget id
this will always map the best lowest ID if two configurations
has the same performance at the same fidelity
Source code in neps/optimizers/multi_fidelity/utils.py
tokenize
#
Function to format data for PFN.
Source code in neps/optimizers/multi_fidelity/utils.py
update_data
#
update_data(
data_dict: dict[str, list[Any]],
index: (
tuple[int, ...]
| Sequence[tuple[int, ...]]
| Sequence[int]
| int
),
error: bool = False,
)
Update data if all the indices already exist in the DataFrame
Source code in neps/optimizers/multi_fidelity/utils.py
continuous_to_tabular
#
continuous_to_tabular(
config: SearchSpace, categorical_space: SearchSpace
) -> SearchSpace
Convert the continuous parameters in the config into categorical ones based on the categorical_space provided