Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_StochasticHillClimbingOptimizer():
from hyperactive import StochasticHillClimbingOptimizer
opt0 = StochasticHillClimbingOptimizer(
search_config, n_iter_0, random_state=random_state, verbosity=0, cv=cv, n_jobs=1
)
opt0.fit(X, y)
opt1 = StochasticHillClimbingOptimizer(
search_config,
n_iter_1,
random_state=random_state,
verbosity=0,
cv=cv,
n_jobs=n_jobs,
)
opt1.fit(X, y)
assert opt0.score_best < opt1.score_best
def test_StochasticHillClimbingOptimizer():
from hyperactive import StochasticHillClimbingOptimizer
opt0 = StochasticHillClimbingOptimizer(
search_config, n_iter_0, random_state=random_state, verbosity=0, cv=cv, n_jobs=1
)
opt0.fit(X, y)
opt1 = StochasticHillClimbingOptimizer(
search_config,
n_iter_1,
random_state=random_state,
verbosity=0,
cv=cv,
n_jobs=n_jobs,
)
opt1.fit(X, y)
assert opt0.score_best < opt1.score_best
HillClimbingOptimizer,
StochasticHillClimbingOptimizer,
TabuOptimizer,
RandomSearchOptimizer,
RandomRestartHillClimbingOptimizer,
RandomAnnealingOptimizer,
SimulatedAnnealingOptimizer,
StochasticTunnelingOptimizer,
ParallelTemperingOptimizer,
ParticleSwarmOptimizer,
EvolutionStrategyOptimizer,
BayesianOptimizer,
)
_ = HillClimbingOptimizer(search_config, 1)
_ = StochasticHillClimbingOptimizer(search_config, 1)
_ = TabuOptimizer(search_config, 1)
_ = RandomSearchOptimizer(search_config, 1)
_ = RandomRestartHillClimbingOptimizer(search_config, 1)
_ = RandomAnnealingOptimizer(search_config, 1)
_ = SimulatedAnnealingOptimizer(search_config, 1)
_ = StochasticTunnelingOptimizer(search_config, 1)
_ = ParallelTemperingOptimizer(search_config, 1)
_ = ParticleSwarmOptimizer(search_config, 1)
_ = EvolutionStrategyOptimizer(search_config, 1)
_ = BayesianOptimizer(search_config, 1)