CADETProcess.optimization.OptimizationProblem.add_objective#
- OptimizationProblem.add_objective(objective, name=None, n_objectives=1, minimize=True, bad_metrics=None, evaluation_objects=-1, labels=None, requires=None, *args, **kwargs)[source]#
Add objective function to optimization problem.
- Parameters:
- objectivecallable or MetricBase
Objective function.
- namestr, optional
Name of the objective.
- n_objectivesint, optional
Number of metrics returned by objective function. The default is 1.
- minimizebool, optional
If True, objective is treated as minimization problem. The default is True.
- bad_metricsflot or list of floats, optional
Value which is returned when evaluation fails.
- evaluation_objects{EvaluationObject, None, -1, list}
EvaluationObjects which are evaluated by objective. If None, no EvaluationObject is used. If -1, all EvaluationObjects are used.
- labelsstr, optional
Names of the individual metrics.
- requires{None, Evaluator, list}
Evaluators used for preprocessing. If None, no preprocessing is required.
- argstuple, optional
Additional arguments for objective function.
- kwargsdict, optional
Additional keyword arguments for objective function.
- Raises:
- TypeError
If objective is not callable.
- CADETProcessError
If EvaluationObject is not found. If Evaluator is not found.
Warning
If objective with same name already exists.