desdeo_emo.surrogatemodels
¶
This module provides implementations of EAs which can be used for training surrogate models.
Submodules¶
Package Contents¶
Classes¶
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
The base class from which every other class representing a problem should |
-
class
desdeo_emo.surrogatemodels.
BioGP
(training_algorithm: Type[desdeo_emo.EAs.BaseEA.BaseEA] = PPGA, pop_size: int = 500, probability_crossover: float = 0.9, probability_mutation: float = 0.3, max_depth: int = 5, max_subtrees: int = 4, prob_terminal: float = 0.5, complexity_scalar: float = 0.5, error_lim: float = 0.001, init_method: str = 'ramped_half_and_half', model_selection_criterion: str = 'min_error', loss_function: str = 'mse', single_obj_generations: int = 10, function_set=('add', 'sub', 'mul', 'div'), terminal_set=None)[source]¶ Bases:
desdeo_problem.surrogatemodels.SurrogateModels.BaseRegressor
Helper class that provides a standard way to create an ABC using inheritance.
-
fit
(self, X: pandas.DataFrame, y: pandas.DataFrame)¶
-
_create_individuals
(self)¶
-
_model_performance
(self, trees: LinearNode, X: numpy.ndarray = None, y: numpy.ndarray = None)¶
-
predict
(self, X: numpy.ndarray)¶
-
select
(self)¶
-
static
add
(x, y)¶
-
static
sub
(x, y)¶
-
static
mul
(x, y)¶
-
static
div
(x, y)¶
-
static
sqrt
(x)¶
-
static
log
(x)¶
-
static
sin
(x)¶
-
static
cos
(x)¶
-
static
tan
(x)¶
-
static
neg
(x)¶
-
-
class
desdeo_emo.surrogatemodels.
EvoNN
(num_hidden_nodes: int = 20, p_omit: float = 0.2, w_low: float = - 5.0, w_high: float = 5.0, activation_function: str = 'sigmoid', loss_function: str = 'mse', training_algorithm: Type[desdeo_emo.EAs.BaseEA.BaseEA] = PPGA, pop_size: int = 500, model_selection_criterion: str = 'akaike_corrected', recombination_type: str = 'evonn_xover_mutation', crossover_type: str = 'standard', mutation_type: str = 'gaussian')[source]¶ Bases:
desdeo_problem.surrogatemodels.SurrogateModels.BaseRegressor
Helper class that provides a standard way to create an ABC using inheritance.
-
fit
(self, X: numpy.ndarray, y: numpy.ndarray)¶
-
_model_performance
(self, first_layer: numpy.ndarray = None, X: numpy.ndarray = None, y_true: numpy.ndarray = None)¶
-
predict
(self, X: numpy.ndarray = None, first_layer: numpy.ndarray = None, training: bool = False)¶
-
activate
(self, x)¶
-
calculate_linear
(self, previous_layer_output)¶ Calculate the final layer using LLSQ or
- Parameters
non_linear_layer (np.ndarray) – Output of the activation function
- Returns
linear_layer (np.ndarray) – The optimized weight matrix of the upper part of the network
predicted_values (np.ndarray) – The prediction of the model
training_error (float) – The model’s training error
-
_create_individuals
(self)¶
-
select
(self)¶
-
-
class
desdeo_emo.surrogatemodels.
EvoDN2
(num_subnets: int = 4, num_subsets: int = 4, max_layers: int = 4, max_nodes: int = 4, p_omit: float = 0.2, w_low: float = - 5.0, w_high: float = 5.0, subsets: list = None, activation_function: str = 'sigmoid', loss_function: str = 'mse', training_algorithm: desdeo_emo.EAs.BaseEA.BaseEA = PPGA, pop_size: int = 500, model_selection_criterion: str = 'min_error', verbose: int = 0)[source]¶ Bases:
desdeo_problem.surrogatemodels.SurrogateModels.BaseRegressor
Helper class that provides a standard way to create an ABC using inheritance.
-
fit
(self, X: numpy.ndarray, y: numpy.ndarray)¶
-
_model_performance
(self, individuals: numpy.ndarray = None, X: numpy.ndarray = None, y_true: numpy.ndarray = None)¶
-
_feed_forward
(self, subnets, X)¶
-
_calculate_linear
(self, previous_layer_output)¶ Calculate the final layer using LLSQ or
- Parameters
non_linear_layer (np.ndarray) – Output of the activation function
- Returns
linear_layer (np.ndarray) – The optimized weight matrix of the upper part of the network
predicted_values (np.ndarray) – The prediction of the model
-
activate
(self, x)¶
-
predict
(self, X)¶
-
select
(self)¶
-
_create_individuals
(self)¶
-
-
class
desdeo_emo.surrogatemodels.
surrogateProblem
(performance_evaluator)[source]¶ Bases:
desdeo_problem.problem.ProblemBase
The base class from which every other class representing a problem should derive.
-
evaluate
(self, model_parameters, use_surrogates=False)¶ Evaluates the problem using an ensemble of input vectors. Uses surrogate models if available. Otherwise, it uses the true evaluator.
- Parameters
decision_vectors (np.ndarray) – An array of decision variable
vectors. (input) –
use_surrogate (bool) – A bool to control whether to use the true, potentially
function or a surrogate model to evaluate the objectives. (expensive) –
- Returns
- Dict with the following keys:
- ’objectives’ (np.ndarray): The objective function values for each input
vector.
- ’constraints’ (Union[np.ndarray, None]): The constraint values of the
problem corresponding each input vector.
- ’fitness’ (np.ndarray): Equal to objective values if objective is to be
minimized. Multiplied by (-1) if objective to be maximized.
- ’uncertainity’ (Union[np.ndarray, None]): The uncertainity in the
objective values.
- Return type
(Dict)
-
evaluate_constraint_values
(self)¶ Evaluate just the constraint function values using the attributes decision_vectors and objective_vectors
Note
Currently not supported by ScalarMOProblem
-
get_variable_bounds
(self)¶
-
get_objective_names
(self)¶
-