Passed
Pull Request — master (#110)
by
unknown
01:23
created

tests.test_api.test_empty_output.non_verbose   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Experiment.objective_function() 0 3 1
1
import numpy as np
2
3
from hyperactive.optimizers import HillClimbingOptimizer
4
from hyperactive.experiment import BaseExperiment
5
from hyperactive.search_config import SearchConfig
6
7
8
class Experiment(BaseExperiment):
9
    def objective_function(self, opt):
10
        score = -opt["x1"] * opt["x1"]
11
        return score
12
13
14
experiment = Experiment()
15
16
search_config = SearchConfig(
17
    x1=list(np.arange(-100, 101, 1)),
18
)
19
20
21
hyper = HillClimbingOptimizer()
22
hyper.add_search(experiment, search_config, n_iter=30, memory=True)
23
hyper.run(verbosity=False)
24