Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dependencies = [
"scipy <2.0.0",
"numpy >=1.18.1, <3.0.0",
"pandas <3.0.0",
"scikit-learn >=0.21, !=0.23.*",
"tqdm >=4.48.0, <5.0.0",
]

Expand All @@ -53,6 +52,7 @@ test = [
"pytest == 8.3.5",
"flake8",
"pytest-cov",
"scikit-learn >=0.21, !=0.23.*",
"surfaces",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
# License: MIT License

import numpy as np
from scipy.stats import norm

from ..smb_opt.smbo import SMBO
from ..smb_opt.surrogate_models import EnsembleRegressor
from ..smb_opt.acquisition_function import ExpectedImprovement


from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.svm import SVR
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.neural_network import MLPRegressor


def normalize(array):
num = array - array.min()
den = array.max() - array.min()
Expand All @@ -41,12 +33,7 @@ def __init__(
epsilon=0.03,
distribution="normal",
n_neighbours=3,
estimators=[
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mutable defaults should never be used - general python thing, not specific to sklearn isolation

GradientBoostingRegressor(n_estimators=5),
# DecisionTreeRegressor(),
# MLPRegressor(),
GaussianProcessRegressor(),
],
estimators=None,
xi=0.01,
warm_start_smbo=None,
max_sample_size=10000000,
Expand All @@ -71,13 +58,27 @@ def __init__(
replacement=replacement,
)
self.estimators = estimators
self.regr = EnsembleRegressor(estimators)
self.xi = xi
self.warm_start_smbo = warm_start_smbo
self.max_sample_size = max_sample_size
self.sampling = sampling
self.warnings = warnings

if estimators is None:
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.gaussian_process import GaussianProcessRegressor

self._estimators = [
GradientBoostingRegressor(n_estimators=5),
# DecisionTreeRegressor(),
# MLPRegressor(),
GaussianProcessRegressor(),
]
else:
self._estimators = estimators

self.regr = EnsembleRegressor(self._estimators)

self.init_warm_start_smbo()

def finish_initialization(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import numpy as np

from sklearn.neighbors import KernelDensity
from .smbo import SMBO


Expand Down Expand Up @@ -46,6 +45,8 @@ def __init__(

self.gamma_tpe = gamma_tpe

from sklearn.neighbors import KernelDensity

kde_para = {
"kernel": "gaussian",
"bandwidth": 1,
Expand Down