autointent.nodes.NodeOptimizer#
- class autointent.nodes.NodeOptimizer(node_type, search_space, target_metric, metrics=None)#
Class for optimizing nodes in a computational pipeline.
This class is responsible for optimizing different modules within a node using various search strategies and logging the results.
- Parameters:
- node_type#
- node_info#
- target_metric#
- metrics = None#
- modules_search_spaces#
- fit(context)#
Performs the optimization process for the node.
- Parameters:
context (autointent.context.Context) – The optimization context containing relevant data.
- Raises:
AssertionError – If an invalid sampler type is provided.
- Return type:
None
- objective(trial, search_space, context)#
Defines the objective function for optimization.
- Parameters:
trial (optuna.trial.Trial) – The Optuna trial instance.
module_name – The name of the module being optimized.
search_space (list[dict[str, Any]]) – The parameter search space.
context (autointent.context.Context) – The execution context.
- Returns:
The value of the target metric for the given trial.
- Return type:
- get_module_dump_dir(context, module_name, j_combination)#
Creates and returns the path to the module dump directory.
- Parameters:
context (autointent.context.Context) – The context object.
module_name (str) – The name of the module being optimized.
j_combination (int) – The combination index for the parameters.
- Returns:
The path to the module dump directory.
- Return type:
str | None
- validate_nodes_with_dataset(dataset, mode)#
Validates nodes against the dataset.
- Parameters:
dataset (autointent.Dataset) – The dataset used for validation.
mode (autointent.custom_types.SearchSpaceValidationMode) – The validation mode (“raise” or “warning”).
- Raises:
ValueError – If validation fails and mode is set to “raise”.
- Return type:
None