Passed
Push — master ( 433e71...206a80 )
by Simon
01:19
created

tests.test_optimizers.test_TPE   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_opt() 0 2 1
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import numpy as np
6
7
from gradient_free_optimizers import TreeStructuredParzenEstimators
8
from ._base_test import _base_test
9
10
n_iter = 33
11
opt = TreeStructuredParzenEstimators
12
13
14
def test_opt():
15
    _base_test(opt, n_iter)
16
17
18
"""
19
def test_warm_start_smbo():
20
    gpr_X, gpr_y = [], []
21
    for _ in range(10):
22
        pos = np.random.randint(0, high=9)
23
        pos = np.array([pos])
24
        gpr_X.append(pos)
25
        gpr_y.append(get_score(pos))
26
27
    for warm_start_smbo in [None, (gpr_X, gpr_y)]:
28
        opt_para = {"warm_start_smbo": warm_start_smbo}
29
       _base_test(opt, n_iter, opt_para=opt_para)
30
"""
31