| Total Complexity | 1 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # Author: Simon Blanke |
||
| 2 | # Email: [email protected] |
||
| 3 | # License: MIT License |
||
| 4 | |||
| 5 | |||
| 6 | from .bayesian_optimization import BayesianOptimizer |
||
| 7 | from .surrogate_models import EnsembleRegressor |
||
| 8 | |||
| 9 | |||
| 10 | from sklearn.neighbors import KNeighborsRegressor |
||
| 11 | from sklearn.neural_network import MLPRegressor |
||
| 12 | from sklearn.tree import DecisionTreeRegressor |
||
| 13 | from sklearn.ensemble import GradientBoostingRegressor |
||
| 14 | from sklearn.svm import SVR |
||
| 15 | from sklearn.gaussian_process import GaussianProcessRegressor |
||
| 16 | |||
| 17 | |||
| 18 | class EnsembleOptimizer(BayesianOptimizer): |
||
| 19 | def __init__( |
||
| 20 | self, |
||
| 21 | search_space, |
||
| 22 | estimators=[ |
||
| 23 | GradientBoostingRegressor(n_estimators=10), |
||
| 24 | SVR(), |
||
| 25 | DecisionTreeRegressor(), |
||
| 26 | GaussianProcessRegressor(), |
||
| 27 | ], |
||
| 28 | ): |
||
| 29 | super().__init__(search_space) |
||
| 30 | self.regr = EnsembleRegressor(estimators) |
||
| 31 |