<jupyter_start><jupyter_text>Function to Optimize: HARTMANN 6 Dimensional FunctionTo optimize on the hypercube $x_i$  ∈ (0, 1), for all i = 1, …, 6  Global Minimum<jupyter_code>def hartmann_6D(x):
    alpha = np.array([[1.], [1.2], [3.], [3.2]])

    A = np.array([[10, 3, 17, 3.50, 1.7, 8],
                  [0.05, 10, 17, 0.1, 8, 14],
                  [3, 3.5, 1.7, 10, 17, 8],
                  [17, 8, 0.05, 10, 0.1, 14]])

    P = 10 ** -4 * np.array([[1312, 1696, 5569, 124, 8283, 5886],
                             [2329, 4135, 8307, 3736, 1004, 9991],
                             [2348, 1451, 3522, 2883, 3047, 6650],
                             [4047, 8828, 8732, 5743, 1091, 381]])

    def comp(i):
        tot = 0
        for j in range(6):
            tot += A[i][j] * (x.T[j] - P[i][j]) ** 2
        return np.exp(-tot)

    f = 0
    for i in range(4):
        f += -(alpha[i] * comp(i))

    return f[:, None]


dim = 6
points = 3
x = np.random.uniform(0, 1, (points, dim))
y = hartmann_6D(x)
gp = GP(x, y, RBF(gradient=False))
gp.fit()
settings = {"type": "BFGS",
            "ac_type":"EI",
            "n_search": 10,
            "boundaries": [[0, 1] for i in range(6)],
            "epsilon": 0.01,
            "iteration": 50,
            "minimization": True,
            "optimization": True,
            "n_restart": 10,
            "sampling": np.random.uniform}

BayOpt = BayesianOptimization(x, y, settings, gp, hartmann_6D)

result = BayOpt.run()
print(result)<jupyter_output>(array([0.26347953, 0.16832597, 0.4747593 , 0.25800948, 0.34429534,
       0.64264603]), array([-3.20360854]))
{'fraction_non_alphanumeric': 0.18333333333333332, 'fraction_numerical': 0.14753086419753086, 'mean_word_length': 1.8843416370106763, 'pattern_counts': {'":': 10, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '628162', 'license': 'MIT', 'n_tokens_mistral': 809, 'n_tokens_neox': 634, 'n_words': 164, 'path': 'Tutorials/Bayesian_Tutorial.ipynb', 'repo_name': 'FNTwin/Bayesian-Optimization', 'size': '1620'}