(self, success, message)
return OptimizeResult(x=X[idx, :],
                              success=success,
                              fun=Yo[idx, :],
                              constraints=Yc[idx, :],
                              message=message)
Analyzes all data evaluated during the optimization, and return an `OptimizeResult`. Constraints are taken
        into account. The contents of x, fun, and constraints depend on the detected scenario:
        - single-objective: the best optimum of the feasible samples (if none, optimum of the infeasible samples)
        - multi-objective: the Pareto set of the feasible samples
        - only constraints: all the feasible samples (can be empty)

        In all cases, if not one sample satisfies all the constraints a message will be given and success=False.

        Do note that the feasibility check is based on the model predictions, but the constrained field contains
        actual data values.
       
        :param success: Optimization successful? (True/False)
        :param message: return message
        :return: OptimizeResult object
Analyzes all data evaluated during the optimization, and return an `OptimizeResult`. Constraints are taken
        into account. The contents of x, fun, and constraints depend on the detected scenario:
        - single-objective: the best optimum of the feasible samples (if none, optimum of the infeasible samples)
        - multi-objective: the Pareto set of the feasible samples
        - only constraints: all the feasible samples (can be empty)
Analyzes all data evaluated during the optimization and return an OptimizeResult . Constraints are taken into account . The contents of x fun and constraints depend on the detected scenario : - single - objective : the best optimum of the feasible samples ( if none optimum of the infeasible samples ) - multi - objective : the Pareto set of the feasible samples - only constraints : all the feasible samples ( can be empty )
def _create_bo_result(self, success, message):
        """
        Analyzes all data evaluated during the optimization, and return an `OptimizeResult`. Constraints are taken
        into account. The contents of x, fun, and constraints depend on the detected scenario:
        - single-objective: the best optimum of the feasible samples (if none, optimum of the infeasible samples)
        - multi-objective: the Pareto set of the feasible samples
        - only constraints: all the feasible samples (can be empty)

        In all cases, if not one sample satisfies all the constraints a message will be given and success=False.

        Do note that the feasibility check is based on the model predictions, but the constrained field contains
        actual data values.
       
        :param success: Optimization successful? (True/False)
        :param message: return message
        :return: OptimizeResult object
        """
        X, Y = self.acquisition.data

        # Filter on constraints
        valid = self.acquisition.feasible_data_index()

        # Extract the samples that satisfies all constraints
        if np.any(valid):
            X = X[valid, :]
            Y = Y[valid, :]
        else:
            success = False
            message = "No evaluations satisfied all the constraints"

        # Split between objectives and constraints
        Yo = Y[:, self.acquisition.objective_indices()]
        Yc = Y[:, self.acquisition.constraint_indices()]

        # Differentiate between different scenarios
        if Yo.shape[1] == 1:  # Single-objective: minimum
            idx = np.argmin(Yo)
        elif Yo.shape[1] > 1:  # Multi-objective: Pareto set
            _, dom = non_dominated_sort(Yo)
            idx = dom == 0
        else:  # Constraint satisfaction problem: all samples satisfying the constraints
            idx = np.arange(Yc.shape[0])

        return OptimizeResult(x=X[idx, :],
                              success=success,
                              fun=Yo[idx, :],
                              constraints=Yc[idx, :],
                              message=message)
def _create_bo_result ( self , success , message ) : X , Y = self . acquisition . data # Filter on constraints valid = self . acquisition . feasible_data_index ( ) # Extract the samples that satisfies all constraints if np . any ( valid ) : X = X [ valid , : ] Y = Y [ valid , : ] else : success = False message = "No evaluations satisfied all the constraints" # Split between objectives and constraints Yo = Y [ : , self . acquisition . objective_indices ( ) ] Yc = Y [ : , self . acquisition . constraint_indices ( ) ] # Differentiate between different scenarios if Yo . shape [ 1 ] == 1 : # Single-objective: minimum idx = np . argmin ( Yo ) elif Yo . shape [ 1 ] > 1 : # Multi-objective: Pareto set _ , dom = non_dominated_sort ( Yo ) idx = dom == 0 else : # Constraint satisfaction problem: all samples satisfying the constraints idx = np . arange ( Yc . shape [ 0 ] ) return OptimizeResult ( x = X [ idx , : ] , success = success , fun = Yo [ idx , : ] , constraints = Yc [ idx , : ] , message = message )