PyCTBN.PyCTBN.optimizers package¶
Submodules¶
PyCTBN.PyCTBN.optimizers.constraint_based_optimizer module¶
- class PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, tot_vars_count: int)¶
Bases:
PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement a CTPC Algorithm
- Parameters
node_id (string) – current node’s id
structure_estimator (class:'StructureEstimator') – a structure estimator object with the information about the net
tot_vars_count (int) – number of variables in the dataset
- optimize_structure()¶
Compute Optimization process for a structure_estimator by using a CTPC Algorithm
- Returns
the estimated structure for the node
- Return type
List
PyCTBN.PyCTBN.optimizers.hill_climbing_search module¶
- class PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None)¶
Bases:
PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Hill Climbing Search
- Parameters
node_id (string) – current node’s id
structure_estimator (class:'StructureEstimator') – a structure estimator object with the information about the net
max_parents (int, optional) – maximum number of parents for each variable. If None, disabled, default to None
iterations_number (int, optional) – maximum number of optimization algorithm’s iteration, default to 40
patience (int, optional) – number of iteration without any improvement before to stop the search.If None, disabled, default to None
- optimize_structure() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
the estimated structure for the node
- Return type
List
PyCTBN.PyCTBN.optimizers.optimizer module¶
- class PyCTBN.PyCTBN.optimizers.optimizer.Optimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator)¶
Bases:
abc.ABC
Interface class for all the optimizer’s child PyCTBN
- Parameters
node_id (string) – the node label
structure_estimator (class:'StructureEstimator') – A structureEstimator Object to predict the structure
- abstract optimize_structure() → List¶
Compute Optimization process for a structure_estimator
- Returns
the estimated structure for the node
- Return type
List
PyCTBN.PyCTBN.optimizers.tabu_search module¶
- class PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None, tabu_length: Optional[int] = None, tabu_rules_duration=None)¶
Bases:
PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Tabu Search
- Parameters
node_id (string) – current node’s id
structure_estimator (class:'StructureEstimator') – a structure estimator object with the information about the net
max_parents (int, optional) – maximum number of parents for each variable. If None, disabled, default to None
iterations_number (int, optional) – maximum number of optimization algorithm’s iteration, default to 40
patience (int, optional) – number of iteration without any improvement before to stop the search.If None, disabled, default to None
tabu_length (int, optional) – maximum lenght of the data structures used in the optimization process, default to None
tabu_rules_duration (int, optional) – number of iterations in which each rule keeps its value, default to None
- optimize_structure() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
the estimated structure for the node
- Return type
List