diff --git a/.gitignore b/.gitignore index 1f3dd3b..3367d07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.py[cod] +*.db + # C extensions *.so diff --git a/GPopt/GPOpt/GPOpt.py b/GPopt/GPOpt.py similarity index 50% rename from GPopt/GPOpt/GPOpt.py rename to GPopt/GPOpt.py index 670895d..7f8cfed 100644 --- a/GPopt/GPOpt/GPOpt.py +++ b/GPopt/GPOpt.py @@ -4,18 +4,25 @@ # # License: BSD 3 Clause Clear +import copy +import nnetsauce as ns import numpy as np import pickle import shelve from collections import namedtuple +from functools import partial +from sklearn.utils.discovery import all_estimators +from sklearn.base import RegressorMixin from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.ensemble import RandomForestRegressor from sklearn.gaussian_process.kernels import Matern import scipy.stats as st from joblib import Parallel, delayed from time import time -from ..utils import generate_sobol2 -from ..utils import Progbar +from tqdm import tqdm +from .config import REGRESSORS, REMOVED_REGRESSORS +from .utils import generate_sobol2 +from .utils import Progbar class GPOpt: @@ -31,12 +38,12 @@ class GPOpt: objective_func: a function; the objective function to be minimized - + params_names: a list; names of the parameters of the objective function (optional) - gp_obj: a GaussianProcessRegressor object; - An ML model for estimating the uncertainty around the objective function + surrogate_obj: a GaussianProcessRegressor object; + An ML model for estimating the uncertainty around the objective function x_init: initial setting of points where `objective_func` is evaluated (optional) @@ -66,7 +73,14 @@ class GPOpt: Specifies where to save the optimizer in its current state n_jobs: an integer; - number of jobs for parallel computing on initial setting (can be -1) + number of jobs for parallel computing on initial setting or method `lazyoptimize` (can be -1) + + acquisition: a string; + acquisition function: "ei" (expected improvement) or "ucb" (upper confidence bound) + + min_value: a float; + minimum value of the objective function (default is None). For example, + if objective function is accuracy, will be 1, and the algorithm will stop per_second: a boolean; __experimental__, default is False (leave to default for now) @@ -80,12 +94,12 @@ class GPOpt: """ def __init__( - self, + self, lower_bound, upper_bound, objective_func=None, params_names=None, - gp_obj=None, + surrogate_obj=None, x_init=None, y_init=None, n_init=10, @@ -95,7 +109,9 @@ def __init__( n_restarts_optimizer=25, seed=123, save=None, - n_jobs=1, + n_jobs=None, + acquisition="ei", + min_value=None, per_second=False, # /!\ very experimental log_scale=False, # /!\ experimental ): @@ -120,15 +136,19 @@ def __init__( self.n_restarts_optimizer = n_restarts_optimizer self.seed = seed self.save = save + self.n_jobs = n_jobs # for parallel case on initial design self.per_second = per_second self.x_min = None self.y_min = None self.y_mean = None self.y_std = None - self.ei = np.array([]) - self.max_ei = [] - if gp_obj is None: - self.gp_obj = GaussianProcessRegressor( + self.best_surrogate = None + self.acquisition = acquisition + self.min_value = min_value + self.acq = np.array([]) + self.max_acq = [] + if surrogate_obj is None: + self.surrogate_obj = GaussianProcessRegressor( kernel=Matern(nu=2.5), alpha=self.alpha, normalize_y=True, @@ -136,7 +156,9 @@ def __init__( random_state=self.seed, ) else: - self.gp_obj = gp_obj + self.surrogate_obj = surrogate_obj + self.method = None + self.posterior_ = None # Sobol seqs for initial design and choices sobol_seq_init = np.transpose( @@ -262,16 +284,36 @@ def close_shelve(self): self.sh.close() # fit predict - def gp_fit_predict(self, X_train, y_train, X_test): + def surrogate_fit_predict( + self, X_train, y_train, X_test, return_std=False, return_pi=False + ): if len(X_train.shape) == 1: X_train = X_train.reshape((-1, 1)) X_test = X_test.reshape((-1, 1)) - # Get mean and standard deviation - return self.gp_obj.fit(X_train, y_train).predict( - X_test, return_std=True - ) + # Get mean and standard deviation (+ lower and upper for not GPs) + assert ( + return_std == True and return_pi == True + ) == False, "must have either return_std == True or return_pi == True" + if return_std == True: + self.posterior_ = "gaussian" + return self.surrogate_obj.fit(X_train, y_train).predict( + X_test, return_std=True + ) + elif return_pi == True: + self.posterior_ = "mc" + res = self.surrogate_obj.fit(X_train, y_train).predict( + X_test, return_pi=True, method="splitconformal" + ) + self.y_sims = res.sims + self.y_mean, self.y_std = ( + np.mean(self.y_sims, axis=1), + np.std(self.y_sims, axis=1), + ) + return self.y_mean, self.y_std, self.y_sims + else: + raise NotImplementedError # fit predict timings def timings_fit_predict(self, X_train, y_train, X_test): @@ -284,20 +326,28 @@ def timings_fit_predict(self, X_train, y_train, X_test): return self.rf_obj.fit(X_train, y_train).predict(X_test) # find next parameter by using expected improvement (ei) - def next_parameter_by_ei(self, seed, i): + def next_parameter_by_acq(self, i, acq="ei"): - gamma_hat = (self.y_min - self.y_mean) / self.y_std + if acq == "ei": + if self.posterior_ == "gaussian": + gamma_hat = (self.y_min - self.y_mean) / self.y_std + self.acq = -self.y_std * ( + gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat) + ) + elif self.posterior_ == "mc": + self.acq = -np.mean( + np.maximum(self.y_min - self.y_sims, 0), axis=1 + ) - self.ei = -self.y_std * ( - gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat) - ) + if acq == "ucb": + self.acq = -(self.y_mean - 1.96 * self.y_std) # find max index ----- if self.per_second is False: # find index for max. ei - max_index = self.ei.argmin() + max_index = self.acq.argmin() else: # self.per_second is True @@ -311,9 +361,9 @@ def next_parameter_by_ei(self, seed, i): ) # find index for max. ei (and min. timings) - max_index = (-self.ei / timing_preds).argmax() + max_index = (-self.acq / timing_preds).argmax() - self.max_ei.append(np.abs(self.ei[max_index])) + self.max_acq.append(np.abs(self.acq[max_index])) # Select next choice next_param = self.x_choices[max_index, :] @@ -352,6 +402,7 @@ def optimize( abs_tol=None, # suggested 1e-4, for n_iter = 200 min_budget=50, # minimum budget for early stopping func_args=None, + method="bayesian", ): """Launch optimization loop. @@ -374,11 +425,20 @@ def optimize( func_args: a list; additional parameters for the objective function (if necessary) + method: an str; + "bayesian" (default) for Gaussian posteriors or "mc" for Monte Carlo posteriors + see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) """ + assert method in ( + "bayesian", + "mc", + ), "method must be in ('bayesian', 'mc')" + self.method = method + # verbose = 0: nothing is printed # verbose = 1: a progress bar is printed (longer than 0) # verbose = 2: information about each iteration is printed (longer than 1) @@ -474,7 +534,7 @@ def optimize( if self.save is not None: self.update_shelve() - else: # if self.y_init is None: + else: # if self.y_init is not None: assert self.x_init.shape[0] == len( self.y_init @@ -490,11 +550,44 @@ def optimize( self.x_min = self.x_init[min_index, :] # current gp mean and std on initial design - y_mean, y_std = self.gp_fit_predict( - np.asarray(self.parameters), - np.asarray(self.scores), - self.x_choices, - ) + # /!\ if GP + if self.method == "bayesian": + self.posterior_ = "gaussian" + try: + y_mean, y_std = self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=True, + return_pi=False, + ) + except ValueError: # do not remove this + preds_with_std = self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=True, + return_pi=False, + ) + y_mean, y_std = preds_with_std[0], preds_with_std[1] + + elif self.method == "mc": + self.posterior_ = "mc" + assert self.surrogate_obj.__class__.__name__.startswith( + "CustomRegressor" + ), "for `method = 'mc'`, the surrogate must be a nnetsauce.CustomRegressor()" + assert ( + self.surrogate_obj.replications is not None + ), "for `method = 'mc'`, the surrogate must be a nnetsauce.CustomRegressor() with a number of 'replications' provided" + preds_with_std = self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=False, + return_pi=True, + ) + y_mean, y_std = preds_with_std[0], preds_with_std[1] + self.y_mean = y_mean self.y_std = np.maximum(2.220446049250313e-16, y_std) @@ -506,7 +599,7 @@ def optimize( assert self.n_iter > 5, "you must have n_iter > 5" n_iter = n_more_iter - iter_stop = len(self.max_ei) + n_more_iter # potentially + iter_stop = len(self.max_acq) + n_more_iter # potentially if (verbose == 1) | (verbose == 2): print(f"\n ...Done. \n") @@ -536,7 +629,7 @@ def optimize( for i in range(n_iter): # find next set of parameters (vector), maximizing ei - next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i) + next_param = self.next_parameter_by_acq(i=i, acq="ei") try: @@ -625,12 +718,41 @@ def optimize( self.y_min = score_next_param if self.save is not None: self.update_shelve() + if self.y_min == self.min_value: + break + + if self.posterior_ == "gaussian" and self.method == "bayesian": + try: + self.y_mean, self.y_std = self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=True, + return_pi=False, + ) + except: + self.y_mean, self.y_std, lower, upper = ( + self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=True, + return_pi=False, + ) + ) - self.y_mean, self.y_std = self.gp_fit_predict( - np.asarray(self.parameters), - np.asarray(self.scores), - self.x_choices, - ) + elif self.posterior_ == "mc" and self.method == "mc": + self.y_mean, self.y_std, self.y_sims = ( + self.surrogate_fit_predict( + np.asarray(self.parameters), + np.asarray(self.scores), + self.x_choices, + return_std=False, + return_pi=True, + ) + ) + else: + return NotImplementedError if self.save is not None: self.update_shelve() @@ -642,14 +764,14 @@ def optimize( if abs_tol is not None: - # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct): - if len(self.max_ei) > min_budget: + # if self.max_acq.size > (self.n_init + self.n_iter * min_budget_pct): + if len(self.max_acq) > min_budget: - diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei))) + diff_max_ei = np.abs(np.diff(np.asarray(self.max_acq))) if diff_max_ei[-1] <= abs_tol: - iter_stop = len(self.max_ei) # index i starts at 0 + iter_stop = len(self.max_acq) # index i starts at 0 break @@ -661,10 +783,10 @@ def optimize( self.n_iter = iter_stop if self.save is not None: self.update_shelve() - + DescribeResult = namedtuple( - "DescribeResult", ("best_params", "best_score") - ) + "DescribeResult", ("best_params", "best_score") + ) if self.params_names is None: @@ -675,3 +797,344 @@ def optimize( return DescribeResult( dict(zip(self.params_names, self.x_min)), self.y_min ) + + # optimize the objective + def lazyoptimize( + self, + verbose=1, + abs_tol=None, # suggested 1e-4, for n_iter = 200 + min_budget=50, # minimum budget for early stopping + func_args=None, + method="bayesian", # "bayesian" or "mc + estimators="all", + type_pi="kde", # for now, 'kde' or 'bootstrap' + type_exec="independent", # "queue" or "independent" (default) + ): + """Launch optimization loop. + + # Arguments: + + verbose: an integer; + verbose = 0: nothing is printed, + verbose = 1: a progress bar is printed (longer than 0), + verbose = 2: information about each iteration is printed (longer than 1) + + n_more_iter: an integer; + additional number of iterations for the optimizer (which has been run once) + + abs_tol: a float; + tolerance for convergence of the optimizer (early stopping based on expected improvement) + + min_budget: an integer (default is 50); + minimum number of iterations before early stopping controlled by `abs_tol` + + func_args: a list; + additional parameters for the objective function (if necessary) + + method: an str; + "bayesian" (default) for Gaussian posteriors or "mc" for Monte Carlo posteriors + + estimators: an str or a list of strs (estimators names) + if "all", then 30 models are fitted. Otherwise, only those provided in the list + are adjusted; for example ["RandomForestRegressor", "Ridge"] + + type_pi: an str; + "kde" (default) or "bootstrap"; type of prediction intervals for the surrogate + model + + type_exec: an str; + "independent" (default) is when surrogate models are adjusted independently on + the same design set and the best model is chosen eventually; "queue" is when + surrogate models are adjusted one after the other, on a design set with + increasing size; + + """ + + if estimators == "all": + + self.regressors = REGRESSORS + + else: + + self.regressors = [ + ( + "CustomRegressor(" + est[0] + ")", + ns.CustomRegressor( + est[1](), replications=150, type_pi=type_pi + ), + ) + for est in all_estimators() + if ( + issubclass(est[1], RegressorMixin) + and (est[0] not in REMOVED_REGRESSORS) + and (est[0] in estimators) + ) + ] + + self.surrogate_fit_predict = partial( + self.surrogate_fit_predict, return_pi=True + ) + + if ( + type_exec == "queue" + ): # when models are adjusted one after the other on a design set with increasing size + + self.x_min = None + + self.y_min = np.inf + + score_next_param = np.inf + + DescribeResult = namedtuple( + "DescribeResult", ("best_params", "best_score") + ) + + if verbose == 2: + print( + f"\n adjusting surrogate model # {1} ({self.regressors[0][0]})... \n" + ) + + gp_opt_obj_prev = GPOpt( + objective_func=self.objective_func, + lower_bound=self.lower_bound, + upper_bound=self.upper_bound, + n_init=self.n_init, + n_iter=self.n_iter, + alpha=self.alpha, + n_restarts_optimizer=self.n_restarts_optimizer, + seed=self.seed, + n_jobs=self.n_jobs, + acquisition=self.acquisition, + min_value=self.min_value, + surrogate_obj=copy.deepcopy(self.regressors[0][1]), + ) + + gp_opt_obj_prev.optimize( + verbose=verbose, + abs_tol=abs_tol, # suggested 1e-4, for n_iter = 200 + min_budget=min_budget, # minimum budget for early stopping + func_args=func_args, + method=method, + ) + + score_next_param = gp_opt_obj_prev.y_min + + if self.n_jobs is None: # sequential optimization + + for i in range(len(self.regressors)): + + try: + + if verbose == 2: + print( + f"\n adjusting surrogate model # {i + 2} ({self.regressors[i][0]})... \n" + ) + + gp_opt_obj = GPOpt( + objective_func=self.objective_func, + lower_bound=self.lower_bound, + upper_bound=self.upper_bound, + n_init=self.n_init, + n_iter=self.n_iter, + alpha=self.alpha, + n_restarts_optimizer=self.n_restarts_optimizer, + seed=self.seed, + n_jobs=self.n_jobs, + acquisition=self.acquisition, + min_value=self.min_value, + surrogate_obj=copy.deepcopy(self.regressors[i][1]), + x_init=np.asarray(gp_opt_obj_prev.parameters), + y_init=np.asarray(gp_opt_obj_prev.scores), + ) + + gp_opt_obj.optimize( + verbose=verbose, + abs_tol=abs_tol, # suggested 1e-4, for n_iter = 200 + min_budget=min_budget, # minimum budget for early stopping + func_args=func_args, + method=method, + ) + + score_next_param = gp_opt_obj.y_min + + if score_next_param < self.y_min: + self.x_min = gp_opt_obj.x_min + self.y_min = score_next_param + if self.y_min == self.min_value: + break + + if verbose == 2: + print(f"Global iteration #{i + 1} -----") + print(f"current minimum: {self.x_min}") + print(f"current minimum score: {self.y_min}") + print( + f"score for next parameter: {score_next_param} \n" + ) + + gp_opt_obj_prev = copy.deepcopy(gp_opt_obj) + + except ValueError: + + continue + + elif self.n_jobs >= 2 or self.n_jobs == -1: # parallel optimization + pass + else: + raise ValueError( + "n_jobs must be either None or >= 2 or equal to -1" + ) + return DescribeResult(self.x_min, self.y_min) + + elif ( + type_exec == "independent" + ): # when models are adjusted independently on the same design set and the best model is chosen eventually + + self.x_min = None + + self.y_min = np.inf + + score_next_param = np.inf + + DescribeResult = namedtuple( + "DescribeResult", + ("best_params", "best_score", "best_surrogate"), + ) + + if verbose == 2: + print( + f"\n adjusting surrogate model # {1} ({self.regressors[0][0]})... \n" + ) + + if self.n_jobs is None: # sequential optimization + + for i in range(len(self.regressors)): + + try: + + if verbose == 2: + print( + f"\n adjusting surrogate model # {i + 1} ({self.regressors[i][0]})... \n" + ) + + gp_opt_obj = GPOpt( + objective_func=self.objective_func, + lower_bound=self.lower_bound, + upper_bound=self.upper_bound, + n_init=self.n_init, + n_iter=self.n_iter, + alpha=self.alpha, + n_restarts_optimizer=self.n_restarts_optimizer, + seed=self.seed, + n_jobs=self.n_jobs, + acquisition=self.acquisition, + min_value=self.min_value, + surrogate_obj=copy.deepcopy(self.regressors[i][1]), + ) + + gp_opt_obj.optimize( + verbose=verbose, + abs_tol=abs_tol, # suggested 1e-4, for n_iter = 200 + min_budget=min_budget, # minimum budget for early stopping + func_args=func_args, + method=method, + ) + + score_next_param = gp_opt_obj.y_min + + if score_next_param < self.y_min: + self.x_min = gp_opt_obj.x_min + self.y_min = score_next_param + self.best_surrogate = copy.deepcopy( + gp_opt_obj.surrogate_obj + ) + if self.y_min == self.min_value: + break + + if verbose == 2: + print(f"Global iteration #{i + 1} -----") + print(f"current minimum: {self.x_min}") + print(f"current minimum score: {self.y_min}") + print( + f"score for next parameter: {score_next_param} \n" + ) + + except ValueError: + + continue + + elif self.n_jobs >= 2 or self.n_jobs == -1: # parallel optimization + + def foo(i): + + gp_opt_obj = GPOpt( + objective_func=self.objective_func, + lower_bound=self.lower_bound, + upper_bound=self.upper_bound, + n_init=self.n_init, + n_iter=self.n_iter, + alpha=self.alpha, + n_restarts_optimizer=self.n_restarts_optimizer, + seed=self.seed, + n_jobs=self.n_jobs, + acquisition=self.acquisition, + min_value=self.min_value, + surrogate_obj=copy.deepcopy(self.regressors[i][1]), + ) + + try: + gp_opt_obj.optimize( + verbose=0, # important + abs_tol=abs_tol, # suggested 1e-4, for n_iter = 200 + min_budget=min_budget, # minimum budget for early stopping + func_args=func_args, + method=method, + ) + + return gp_opt_obj + except ValueError: + return None + + tmp_results = Parallel(n_jobs=self.n_jobs)( + delayed(foo)(i) for i in tqdm(range(len(self.regressors))) + ) + + for i in tqdm(range(len(tmp_results))): + + if tmp_results[i] is not None: + + gp_opt_obj = copy.deepcopy(tmp_results[i]) + + score_next_param = gp_opt_obj.y_min + + if score_next_param < self.y_min: + self.x_min = gp_opt_obj.x_min + self.y_min = score_next_param + self.best_surrogate = copy.deepcopy( + gp_opt_obj.surrogate_obj + ) + if self.y_min == self.min_value: + break + + if verbose == 2: + print(f"Global iteration #{i + 1} -----") + print(f"current minimum: {self.x_min}") + print(f"current minimum score: {self.y_min}") + print( + f"score for next parameter: {score_next_param} \n" + ) + + else: + + continue + + else: + raise ValueError( + "n_jobs must be either None or >= 2 or equal to -1" + ) + return DescribeResult(self.x_min, self.y_min, self.best_surrogate) + + else: + + NotImplementedError( + "type_exec must be either 'queue' or 'independent'" + ) diff --git a/GPopt/GPOpt/__init__.py b/GPopt/GPOpt/__init__.py deleted file mode 100644 index 5bce53b..0000000 --- a/GPopt/GPOpt/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .GPOpt import GPOpt - -__all__ = ["GPOpt"] diff --git a/GPopt/__init__.py b/GPopt/__init__.py index eada987..5bce53b 100644 --- a/GPopt/__init__.py +++ b/GPopt/__init__.py @@ -1,3 +1,3 @@ -from .GPOpt.GPOpt import GPOpt +from .GPOpt import GPOpt __all__ = ["GPOpt"] diff --git a/GPopt/config.py b/GPopt/config.py new file mode 100644 index 0000000..8be34a8 --- /dev/null +++ b/GPopt/config.py @@ -0,0 +1,47 @@ +import nnetsauce as ns +from sklearn.base import RegressorMixin +from sklearn.utils.discovery import all_estimators + + +REMOVED_REGRESSORS = [ + "AdaBoostRegressor", + "TheilSenRegressor", + "ARDRegression", + "CCA", + "GammaRegressor", + "GaussianProcessRegressor", + "GradientBoostingRegressor", + "HistGradientBoostingRegressor", + "IsotonicRegression", + "KernelRidge", + "LassoLarsIC", + "MultiOutputRegressor", + "MultiTaskElasticNet", + "MultiTaskElasticNetCV", + "MultiTaskLasso", + "MultiTaskLassoCV", + "NuSVR", + "OrthogonalMatchingPursuit", + "OrthogonalMatchingPursuitCV", + "PLSCanonical", + "PLSRegression", + "PoissonRegressor", + "RadiusNeighborsRegressor", + "RANSACRegressor", + "RegressorChain", + "StackingRegressor", + "SVR", + "VotingRegressor", +] + +REGRESSORS = [ + ( + "CustomRegressor(" + est[0] + ")", + ns.CustomRegressor(est[1](), replications=250, type_pi="kde"), + ) + for est in all_estimators() + if ( + issubclass(est[1], RegressorMixin) + and (est[0] not in REMOVED_REGRESSORS) + ) +] diff --git a/GPopt/demo/thierrymoudiki_20240129_tuning_BCN_classifier.ipynb b/GPopt/demo/thierrymoudiki_20240129_tuning_BCN_classifier.ipynb index 3e7785c..cb5c504 100644 --- a/GPopt/demo/thierrymoudiki_20240129_tuning_BCN_classifier.ipynb +++ b/GPopt/demo/thierrymoudiki_20240129_tuning_BCN_classifier.ipynb @@ -220,7 +220,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.11.8" } }, "nbformat": 4, diff --git a/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_Pt2.ipynb b/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_Pt2.ipynb index a25ce60..68ef494 100644 --- a/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_Pt2.ipynb +++ b/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_Pt2.ipynb @@ -164,9 +164,7 @@ }, { "cell_type": "code", - "source": [ - "print(res_opt.best_score)" - ], + "execution_count": 19, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -174,19 +172,26 @@ "id": "7xw2ii1auV6N", "outputId": "050fce15-672d-466d-eb51-595b24d0bfad" }, - "execution_count": 19, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "-0.9857142857142858\n" ] } + ], + "source": [ + "print(res_opt.best_score)" ] }, { "cell_type": "code", + "execution_count": 20, + "metadata": { + "id": "sddAUZp5tEGw" + }, + "outputs": [], "source": [ "res_opt.best_params[\"B\"] = int(res_opt.best_params[\"B\"])\n", "res_opt.best_params[\"nu\"] = 10**res_opt.best_params[\"nu\"]\n", @@ -195,27 +200,22 @@ "res_opt.best_params[\"tol\"] = 10**res_opt.best_params[\"tol\"]\n", "res_opt.best_params[\"col_sample\"] = np.ceil(res_opt.best_params[\"col_sample\"])\n", "res_opt.best_params[\"n_clusters\"] = np.ceil(res_opt.best_params[\"n_clusters\"])" - ], - "metadata": { - "id": "sddAUZp5tEGw" - }, - "execution_count": 20, - "outputs": [] + ] }, { "cell_type": "code", "execution_count": 21, "metadata": { - "id": "zo4LTC_PDEGp", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "zo4LTC_PDEGp", "outputId": "0361a23c-ff05-4eb2-f4d4-6ed4f3ea5ed4" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ " |======================================================================| 100%\n", "\n", @@ -258,9 +258,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.6" + "version": "3.11.8" } }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_lazy.ipynb b/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_lazy.ipynb new file mode 100644 index 0000000..070f327 --- /dev/null +++ b/GPopt/demo/thierrymoudiki_20240206_tuning_BCN_classifier_lazy.ipynb @@ -0,0 +1,444 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "ver1MWFiAIH1" + }, + "source": [ + "# 1 - Install" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "id": "cxJzB_Pwry-O" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[33mWARNING: Skipping BCN as it is not installed.\u001b[0m\u001b[33m\n", + "\u001b[0m\u001b[33mWARNING: Skipping GPopt as it is not installed.\u001b[0m\u001b[33m\n", + "\u001b[0m" + ] + } + ], + "source": [ + "!pip uninstall -y BCN GPopt" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "id": "L7dr5u5k8hW9" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting BCN\n", + " Downloading BCN-0.7.1-py2.py3-none-any.whl.metadata (873 bytes)\n", + "Collecting joblib (from BCN)\n", + " Downloading joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)\n", + "Collecting numpy (from BCN)\n", + " Downloading numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl.metadata (61 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.1/61.1 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hCollecting rpy2 (from BCN)\n", + " Downloading rpy2-3.5.16-cp311-cp311-macosx_10_9_universal2.whl.metadata (4.5 kB)\n", + "Collecting scikit-learn (from BCN)\n", + " Downloading scikit_learn-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl.metadata (11 kB)\n", + "Collecting cffi>=1.15.1 (from rpy2->BCN)\n", + " Downloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (1.5 kB)\n", + "Collecting jinja2 (from rpy2->BCN)\n", + " Downloading Jinja2-3.1.3-py3-none-any.whl.metadata (3.3 kB)\n", + "Collecting tzlocal (from rpy2->BCN)\n", + " Downloading tzlocal-5.2-py3-none-any.whl.metadata (7.8 kB)\n", + "Collecting scipy>=1.6.0 (from scikit-learn->BCN)\n", + " Downloading scipy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (60 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.6/60.6 kB\u001b[0m \u001b[31m615.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hCollecting threadpoolctl>=2.0.0 (from scikit-learn->BCN)\n", + " Downloading threadpoolctl-3.5.0-py3-none-any.whl.metadata (13 kB)\n", + "Collecting pycparser (from cffi>=1.15.1->rpy2->BCN)\n", + " Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes)\n", + "Collecting MarkupSafe>=2.0 (from jinja2->rpy2->BCN)\n", + " Downloading MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl.metadata (3.0 kB)\n", + "Downloading BCN-0.7.1-py2.py3-none-any.whl (7.6 kB)\n", + "Downloading joblib-1.4.2-py3-none-any.whl (301 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m301.8/301.8 kB\u001b[0m \u001b[31m581.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl (20.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.6/20.6 MB\u001b[0m \u001b[31m619.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", + "\u001b[?25hDownloading rpy2-3.5.16-cp311-cp311-macosx_10_9_universal2.whl (299 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m299.9/299.9 kB\u001b[0m \u001b[31m868.7 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading scikit_learn-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl (11.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.6/11.6 MB\u001b[0m \u001b[31m400.5 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", + "\u001b[?25hDownloading cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl (182 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m182.4/182.4 kB\u001b[0m \u001b[31m781.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading scipy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl (39.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m39.3/39.3 MB\u001b[0m \u001b[31m689.4 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:02\u001b[0m\n", + "\u001b[?25hDownloading threadpoolctl-3.5.0-py3-none-any.whl (18 kB)\n", + "Downloading Jinja2-3.1.3-py3-none-any.whl (133 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m133.2/133.2 kB\u001b[0m \u001b[31m619.6 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading tzlocal-5.2-py3-none-any.whl (17 kB)\n", + "Downloading MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl (14 kB)\n", + "Downloading pycparser-2.22-py3-none-any.whl (117 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m117.6/117.6 kB\u001b[0m \u001b[31m869.1 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hInstalling collected packages: tzlocal, threadpoolctl, pycparser, numpy, MarkupSafe, joblib, scipy, jinja2, cffi, scikit-learn, rpy2, BCN\n", + "Successfully installed BCN-0.7.1 MarkupSafe-2.1.5 cffi-1.16.0 jinja2-3.1.3 joblib-1.4.2 numpy-1.26.4 pycparser-2.22 rpy2-3.5.16 scikit-learn-1.4.2 scipy-1.13.0 threadpoolctl-3.5.0 tzlocal-5.2\n" + ] + } + ], + "source": [ + "!pip install BCN --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "IBA5fko_BA4V" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Processing /Users/t/Documents/Python_Packages/GPopt\n", + " Preparing metadata (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25hRequirement already satisfied: joblib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.2)\n", + "Collecting matplotlib (from GPopt==0.6.0)\n", + " Downloading matplotlib-3.8.4-cp311-cp311-macosx_10_12_x86_64.whl.metadata (5.8 kB)\n", + "Collecting nnetsauce (from GPopt==0.6.0)\n", + " Downloading nnetsauce-0.20.1-py2.py3-none-any.whl.metadata (822 bytes)\n", + "Requirement already satisfied: numpy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.26.4)\n", + "Collecting pandas (from GPopt==0.6.0)\n", + " Downloading pandas-2.2.2-cp311-cp311-macosx_10_9_x86_64.whl.metadata (19 kB)\n", + "Requirement already satisfied: scipy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.13.0)\n", + "Requirement already satisfied: scikit-learn in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.2)\n", + "Requirement already satisfied: threadpoolctl in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (3.5.0)\n", + "Collecting contourpy>=1.0.1 (from matplotlib->GPopt==0.6.0)\n", + " Downloading contourpy-1.2.1-cp311-cp311-macosx_10_9_x86_64.whl.metadata (5.8 kB)\n", + "Collecting cycler>=0.10 (from matplotlib->GPopt==0.6.0)\n", + " Downloading cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)\n", + "Collecting fonttools>=4.22.0 (from matplotlib->GPopt==0.6.0)\n", + " Downloading fonttools-4.51.0-cp311-cp311-macosx_10_9_x86_64.whl.metadata (159 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m159.5/159.5 kB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hCollecting kiwisolver>=1.3.1 (from matplotlib->GPopt==0.6.0)\n", + " Downloading kiwisolver-1.4.5-cp311-cp311-macosx_10_9_x86_64.whl.metadata (6.4 kB)\n", + "Requirement already satisfied: packaging>=20.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (24.0)\n", + "Collecting pillow>=8 (from matplotlib->GPopt==0.6.0)\n", + " Downloading pillow-10.3.0-cp311-cp311-macosx_10_10_x86_64.whl.metadata (9.2 kB)\n", + "Collecting pyparsing>=2.3.1 (from matplotlib->GPopt==0.6.0)\n", + " Downloading pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (2.9.0.post0)\n", + "Collecting requests (from nnetsauce->GPopt==0.6.0)\n", + " Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)\n", + "Collecting tqdm (from nnetsauce->GPopt==0.6.0)\n", + " Downloading tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.6/57.6 kB\u001b[0m \u001b[31m300.9 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hCollecting jax (from nnetsauce->GPopt==0.6.0)\n", + " Downloading jax-0.4.26-py3-none-any.whl.metadata (23 kB)\n", + "Collecting jaxlib (from nnetsauce->GPopt==0.6.0)\n", + " Downloading jaxlib-0.4.26-cp311-cp311-macosx_10_14_x86_64.whl.metadata (1.8 kB)\n", + "Collecting pytz>=2020.1 (from pandas->GPopt==0.6.0)\n", + " Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\n", + "Collecting tzdata>=2022.7 (from pandas->GPopt==0.6.0)\n", + " Downloading tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)\n", + "Requirement already satisfied: six>=1.5 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->GPopt==0.6.0) (1.16.0)\n", + "Collecting ml-dtypes>=0.2.0 (from jax->nnetsauce->GPopt==0.6.0)\n", + " Downloading ml_dtypes-0.4.0-cp311-cp311-macosx_10_9_universal2.whl.metadata (20 kB)\n", + "Collecting opt-einsum (from jax->nnetsauce->GPopt==0.6.0)\n", + " Downloading opt_einsum-3.3.0-py3-none-any.whl.metadata (6.5 kB)\n", + "Collecting charset-normalizer<4,>=2 (from requests->nnetsauce->GPopt==0.6.0)\n", + " Downloading charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl.metadata (33 kB)\n", + "Collecting idna<4,>=2.5 (from requests->nnetsauce->GPopt==0.6.0)\n", + " Downloading idna-3.7-py3-none-any.whl.metadata (9.9 kB)\n", + "Collecting urllib3<3,>=1.21.1 (from requests->nnetsauce->GPopt==0.6.0)\n", + " Downloading urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)\n", + "Collecting certifi>=2017.4.17 (from requests->nnetsauce->GPopt==0.6.0)\n", + " Downloading certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)\n", + "Downloading matplotlib-3.8.4-cp311-cp311-macosx_10_12_x86_64.whl (7.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.6/7.6 MB\u001b[0m \u001b[31m604.2 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", + "\u001b[?25hDownloading nnetsauce-0.20.1-py2.py3-none-any.whl (165 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m165.1/165.1 kB\u001b[0m \u001b[31m524.8 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading pandas-2.2.2-cp311-cp311-macosx_10_9_x86_64.whl (12.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.6/12.6 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0mm\n", + "\u001b[?25hDownloading contourpy-1.2.1-cp311-cp311-macosx_10_9_x86_64.whl (262 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m262.1/262.1 kB\u001b[0m \u001b[31m826.7 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading cycler-0.12.1-py3-none-any.whl (8.3 kB)\n", + "Downloading fonttools-4.51.0-cp311-cp311-macosx_10_9_x86_64.whl (2.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m0m\n", + "\u001b[?25hDownloading kiwisolver-1.4.5-cp311-cp311-macosx_10_9_x86_64.whl (68 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m68.2/68.2 kB\u001b[0m \u001b[31m29.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hDownloading pillow-10.3.0-cp311-cp311-macosx_10_10_x86_64.whl (3.5 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.5/3.5 MB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m0m\n", + "\u001b[?25hDownloading pyparsing-3.1.2-py3-none-any.whl (103 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m103.2/103.2 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m0m\n", + "\u001b[?25hDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m505.5/505.5 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m345.4/345.4 kB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading jax-0.4.26-py3-none-any.whl (1.9 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", + "\u001b[?25hDownloading jaxlib-0.4.26-cp311-cp311-macosx_10_14_x86_64.whl (83.6 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m83.6/83.6 MB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:02\u001b[0m0m\n", + "\u001b[?25hDownloading requests-2.31.0-py3-none-any.whl (62 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.6/62.6 kB\u001b[0m \u001b[31m877.3 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading tqdm-4.66.4-py3-none-any.whl (78 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.3/78.3 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0meta \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading certifi-2024.2.2-py3-none-any.whl (163 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m163.8/163.8 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl (121 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.4/121.4 kB\u001b[0m \u001b[31m712.7 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading idna-3.7-py3-none-any.whl (66 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m66.8/66.8 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading ml_dtypes-0.4.0-cp311-cp311-macosx_10_9_universal2.whl (390 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m390.9/390.9 kB\u001b[0m \u001b[31m969.0 kB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0mm\n", + "\u001b[?25hDownloading urllib3-2.2.1-py3-none-any.whl (121 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.1/121.1 kB\u001b[0m \u001b[31m1.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hDownloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m65.5/65.5 kB\u001b[0m \u001b[31m1.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + "\u001b[?25hBuilding wheels for collected packages: GPopt\n", + " Building wheel for GPopt (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25h Created wheel for GPopt: filename=GPopt-0.6.0-py2.py3-none-any.whl size=71907 sha256=c511b96e70ea5691c0a4e86296a2f3d2b783c7103fc4ac1fdd526402623c3ec5\n", + " Stored in directory: /private/var/folders/cp/q8d6040n3m38d22z3hkk1zc40000gn/T/pip-ephem-wheel-cache-3bj6sxxu/wheels/18/c5/f2/2bcb5749155d04d8e285ee88d9c1f7d49467719147ee803dc9\n", + "Successfully built GPopt\n", + "Installing collected packages: pytz, urllib3, tzdata, tqdm, pyparsing, pillow, opt-einsum, ml-dtypes, kiwisolver, idna, fonttools, cycler, contourpy, charset-normalizer, certifi, requests, pandas, matplotlib, jaxlib, jax, nnetsauce, GPopt\n", + "Successfully installed GPopt-0.6.0 certifi-2024.2.2 charset-normalizer-3.3.2 contourpy-1.2.1 cycler-0.12.1 fonttools-4.51.0 idna-3.7 jax-0.4.26 jaxlib-0.4.26 kiwisolver-1.4.5 matplotlib-3.8.4 ml-dtypes-0.4.0 nnetsauce-0.20.1 opt-einsum-3.3.0 pandas-2.2.2 pillow-10.3.0 pyparsing-3.1.2 pytz-2024.1 requests-2.31.0 tqdm-4.66.4 tzdata-2024.1 urllib3-2.2.1\n" + ] + } + ], + "source": [ + "!pip install ../.. --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "id": "FV7pttAu8pXP" + }, + "outputs": [], + "source": [ + "import BCN as bcn # takes a long time to run, ONLY the first time it's run\n", + "import GPopt as gp\n", + "import numpy as np\n", + "\n", + "from sklearn.gaussian_process import GaussianProcessRegressor\n", + "from sklearn.gaussian_process.kernels import Matern\n", + "from sklearn.datasets import load_iris, load_wine, load_breast_cancer\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import metrics\n", + "from time import time" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "YniHGO9AAac2" + }, + "source": [ + "# 2 - cv" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "id": "LIGGEBbxCznR" + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "id": "fIgPu1vBAd7X" + }, + "outputs": [], + "source": [ + "def bcn_cv(X_train, y_train,\n", + " B = 10, nu = 0.335855,\n", + " lam = 10**0.7837525,\n", + " r = 1 - 10**(-5.470031),\n", + " tol = 10**-7,\n", + " col_sample=1,\n", + " n_clusters = 3):\n", + "\n", + " estimator = bcn.BCNClassifier(B = int(B),\n", + " nu = nu,\n", + " lam = lam,\n", + " r = r,\n", + " tol = tol,\n", + " col_sample = col_sample,\n", + " n_clusters = n_clusters,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\",\n", + " show_progress = False)\n", + "\n", + " return -cross_val_score(estimator, X_train, y_train,\n", + " scoring='accuracy',\n", + " cv=5, n_jobs=None,\n", + " verbose=0).mean()\n", + "\n", + "def optimize_bcn(X_train, y_train, method=\"queue\"):\n", + " # objective function for hyperparams tuning\n", + " def crossval_objective(x):\n", + " return bcn_cv(X_train=X_train,\n", + " y_train=y_train,\n", + " B = int(x[0]),\n", + " nu = 10**x[1],\n", + " lam = 10**x[2],\n", + " r = 1 - 10**x[3],\n", + " tol = 10**x[4],\n", + " col_sample = np.ceil(x[5]),\n", + " n_clusters = np.ceil(x[6]))\n", + " gp_opt = gp.GPOpt(objective_func=crossval_objective,\n", + " lower_bound = np.array([ 3, -6, -10, -10, -6, 0.8, 1]),\n", + " upper_bound = np.array([ 100, -0.1, 10, -1, -0.1, 1, 4]),\n", + " params_names=[\"B\", \"nu\", \"lam\", \"r\", \"tol\", \"col_sample\", \"n_clusters\"], \n", + " n_init=10, n_iter=90, seed=3137)\n", + " return gp_opt.lazyoptimize(method = method, verbose=2, abs_tol=1e-3, \n", + " type_exec = method,\n", + " estimators = [\"LinearRegression\",\n", + " \"RidgeCV\",\n", + " \"LassoCV\",\n", + " \"ElasticNetCV\", \n", + " \"KNeighborsRegressor\",\n", + " \"BaggingRegressor\",\n", + " \"ExtraTreesRegressor\", \n", + " \"RandomForestRegressor\", \n", + " ]\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "id": "dU2gF9rYC_Q_" + }, + "outputs": [], + "source": [ + "dataset = load_wine()\n", + "X = dataset.data\n", + "y = dataset.target" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n" + ] + }, + { + "ename": "AssertionError", + "evalue": "method must be in ('bayesian', 'mc')", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[8], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# hyperparams tuning\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m res_opt \u001b[38;5;241m=\u001b[39m \u001b[43moptimize_bcn\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mqueue\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(res_opt)\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28mprint\u001b[39m(res_opt\u001b[38;5;241m.\u001b[39mbest_score)\n", + "Cell \u001b[0;32mIn[6], line 42\u001b[0m, in \u001b[0;36moptimize_bcn\u001b[0;34m(X_train, y_train, method)\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m bcn_cv(X_train\u001b[38;5;241m=\u001b[39mX_train,\n\u001b[1;32m 29\u001b[0m y_train\u001b[38;5;241m=\u001b[39my_train,\n\u001b[1;32m 30\u001b[0m B \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(x[\u001b[38;5;241m0\u001b[39m]),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 35\u001b[0m col_sample \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mceil(x[\u001b[38;5;241m5\u001b[39m]),\n\u001b[1;32m 36\u001b[0m n_clusters \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mceil(x[\u001b[38;5;241m6\u001b[39m]))\n\u001b[1;32m 37\u001b[0m gp_opt \u001b[38;5;241m=\u001b[39m gp\u001b[38;5;241m.\u001b[39mGPOpt(objective_func\u001b[38;5;241m=\u001b[39mcrossval_objective,\n\u001b[1;32m 38\u001b[0m lower_bound \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([ \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m0.8\u001b[39m, \u001b[38;5;241m1\u001b[39m]),\n\u001b[1;32m 39\u001b[0m upper_bound \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([ \u001b[38;5;241m100\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.1\u001b[39m, \u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.1\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m]),\n\u001b[1;32m 40\u001b[0m params_names\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mB\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnu\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlam\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtol\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcol_sample\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mn_clusters\u001b[39m\u001b[38;5;124m\"\u001b[39m], \n\u001b[1;32m 41\u001b[0m n_init\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m10\u001b[39m, n_iter\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m90\u001b[39m, seed\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3137\u001b[39m)\n\u001b[0;32m---> 42\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgp_opt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlazyoptimize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mverbose\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mabs_tol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1e-3\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 43\u001b[0m \u001b[43m \u001b[49m\u001b[43mtype_exec\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 44\u001b[0m \u001b[43m \u001b[49m\u001b[43mestimators\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mLinearRegression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 45\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mRidgeCV\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 46\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mLassoCV\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 47\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mElasticNetCV\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 48\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mKNeighborsRegressor\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 49\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mBaggingRegressor\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mExtraTreesRegressor\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 51\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mRandomForestRegressor\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 52\u001b[0m \u001b[43m \u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 53\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages/GPopt/GPOpt/GPOpt.py:899\u001b[0m, in \u001b[0;36mGPOpt.lazyoptimize\u001b[0;34m(self, verbose, abs_tol, min_budget, func_args, method, estimators, type_exec)\u001b[0m\n\u001b[1;32m 884\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m adjusting surrogate model # \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;241m1\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m (\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors[\u001b[38;5;241m0\u001b[39m][\u001b[38;5;241m0\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)... \u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 886\u001b[0m gp_opt_obj_prev \u001b[38;5;241m=\u001b[39m GPOpt(objective_func\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mobjective_func, \n\u001b[1;32m 887\u001b[0m lower_bound \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlower_bound, \n\u001b[1;32m 888\u001b[0m upper_bound \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mupper_bound, \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 896\u001b[0m min_value\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmin_value,\n\u001b[1;32m 897\u001b[0m surrogate_obj\u001b[38;5;241m=\u001b[39mcopy\u001b[38;5;241m.\u001b[39mdeepcopy(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors[\u001b[38;5;241m0\u001b[39m][\u001b[38;5;241m1\u001b[39m])) \n\u001b[0;32m--> 899\u001b[0m \u001b[43mgp_opt_obj_prev\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptimize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mverbose\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mverbose\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 900\u001b[0m \u001b[43m \u001b[49m\u001b[43mabs_tol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mabs_tol\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m# suggested 1e-4, for n_iter = 200\u001b[39;49;00m\n\u001b[1;32m 901\u001b[0m \u001b[43m \u001b[49m\u001b[43mmin_budget\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmin_budget\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;66;43;03m# minimum budget for early stopping\u001b[39;49;00m\n\u001b[1;32m 902\u001b[0m \u001b[43m \u001b[49m\u001b[43mfunc_args\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfunc_args\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 903\u001b[0m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 904\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 906\u001b[0m score_next_param \u001b[38;5;241m=\u001b[39m gp_opt_obj_prev\u001b[38;5;241m.\u001b[39my_min \n\u001b[1;32m 908\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mn_jobs \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m: \u001b[38;5;66;03m# sequential optimization\u001b[39;00m\n", + "File \u001b[0;32m~/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages/GPopt/GPOpt/GPOpt.py:435\u001b[0m, in \u001b[0;36mGPOpt.optimize\u001b[0;34m(self, verbose, n_more_iter, abs_tol, min_budget, func_args, method)\u001b[0m\n\u001b[1;32m 397\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21moptimize\u001b[39m(\n\u001b[1;32m 398\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 399\u001b[0m verbose\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 404\u001b[0m method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbayesian\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 405\u001b[0m ):\n\u001b[1;32m 406\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Launch optimization loop.\u001b[39;00m\n\u001b[1;32m 407\u001b[0m \n\u001b[1;32m 408\u001b[0m \u001b[38;5;124;03m # Arguments:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 432\u001b[0m \n\u001b[1;32m 433\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 435\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m method \u001b[38;5;129;01min\u001b[39;00m (\n\u001b[1;32m 436\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbayesian\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 437\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmc\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 438\u001b[0m ), \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmethod must be in (\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbayesian\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m, \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmc\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m)\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmethod \u001b[38;5;241m=\u001b[39m method\n\u001b[1;32m 441\u001b[0m \u001b[38;5;66;03m# verbose = 0: nothing is printed\u001b[39;00m\n\u001b[1;32m 442\u001b[0m \u001b[38;5;66;03m# verbose = 1: a progress bar is printed (longer than 0)\u001b[39;00m\n\u001b[1;32m 443\u001b[0m \u001b[38;5;66;03m# verbose = 2: information about each iteration is printed (longer than 1)\u001b[39;00m\n", + "\u001b[0;31mAssertionError\u001b[0m: method must be in ('bayesian', 'mc')" + ] + } + ], + "source": [ + "# hyperparams tuning\n", + "res_opt = optimize_bcn(X, y, method=\"queue\")\n", + "print(res_opt)\n", + "print(res_opt.best_score)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7xw2ii1auV6N", + "outputId": "050fce15-672d-466d-eb51-595b24d0bfad" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-0.9857142857142858\n" + ] + } + ], + "source": [ + "# hyperparams tuning\n", + "res_opt = optimize_bcn(X, y, method=\"independent\")\n", + "print(res_opt)\n", + "print(res_opt.best_score)" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/GPopt/demo/thierrymoudiki_20240321_tuning_BCN_custom_bayesian.ipynb b/GPopt/demo/thierrymoudiki_20240321_tuning_BCN_custom_bayesian.ipynb new file mode 100644 index 0000000..00147d8 --- /dev/null +++ b/GPopt/demo/thierrymoudiki_20240321_tuning_BCN_custom_bayesian.ipynb @@ -0,0 +1,280 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "ver1MWFiAIH1" + }, + "source": [ + "# 1 - Install" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip uninstall -y GPopt" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "cxJzB_Pwry-O" + }, + "outputs": [], + "source": [ + "!pip uninstall -y BCN" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "L7dr5u5k8hW9" + }, + "outputs": [], + "source": [ + "!pip install BCN nnetsauce --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "IBA5fko_BA4V" + }, + "outputs": [], + "source": [ + "!pip install ../.. --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "FV7pttAu8pXP" + }, + "outputs": [], + "source": [ + "import BCN as bcn # takes a long time to run, ONLY the first time it's run\n", + "import nnetsauce as ns \n", + "import numpy as np\n", + "\n", + "from sklearn.gaussian_process import GaussianProcessRegressor\n", + "from sklearn.linear_model import BayesianRidge, ARDRegression\n", + "from sklearn.gaussian_process.kernels import Matern\n", + "from sklearn.datasets import load_iris, load_wine, load_breast_cancer\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import metrics\n", + "from time import time" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import GPopt as gp" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "YniHGO9AAac2" + }, + "source": [ + "# 2 - cv" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "LIGGEBbxCznR" + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "surrogates = [ns.CustomRegressor(BayesianRidge()),\n", + " ns.CustomRegressor(ARDRegression()),\n", + " ns.CustomRegressor(GaussianProcessRegressor( # this is where the Gaussian Process can be chosen\n", + " kernel=Matern(nu=1.5),\n", + " alpha=1e-6,\n", + " normalize_y=True,\n", + " n_restarts_optimizer=25,\n", + " random_state=42,\n", + " ))]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "fIgPu1vBAd7X" + }, + "outputs": [], + "source": [ + "def bcn_cv(X_train, y_train,\n", + " B = 10, nu = 0.335855,\n", + " lam = 10**0.7837525,\n", + " r = 1 - 10**(-5.470031),\n", + " tol = 10**-7,\n", + " col_sample=1,\n", + " n_clusters = 3):\n", + "\n", + " estimator = bcn.BCNClassifier(B = int(B),\n", + " nu = nu,\n", + " lam = lam,\n", + " r = r,\n", + " tol = tol,\n", + " col_sample = col_sample,\n", + " n_clusters = n_clusters,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\",\n", + " show_progress = False)\n", + "\n", + " return -cross_val_score(estimator, X_train, y_train,\n", + " scoring='accuracy',\n", + " cv=5, n_jobs=None,\n", + " verbose=0).mean()\n", + "\n", + "def optimize_bcn(X_train, y_train, surr_idx):\n", + " # objective function for hyperparams tuning\n", + " def crossval_objective(x):\n", + " return bcn_cv(X_train=X_train,\n", + " y_train=y_train,\n", + " B = int(x[0]),\n", + " nu = 10**x[1],\n", + " lam = 10**x[2],\n", + " r = 1 - 10**x[3],\n", + " tol = 10**x[4],\n", + " col_sample = np.ceil(x[5]),\n", + " n_clusters = np.ceil(x[6]))\n", + " gp_opt = gp.GPOpt(objective_func=crossval_objective,\n", + " lower_bound = np.array([ 3, -6, -10, -10, -6, 0.8, 1]),\n", + " upper_bound = np.array([ 100, -0.1, 10, -1, -0.1, 1, 4]),\n", + " params_names=[\"B\", \"nu\", \"lam\", \"r\", \"tol\", \"col_sample\", \"n_clusters\"],\n", + " surrogate_obj = surrogates[surr_idx],\n", + " n_init=10, n_iter=190, seed=3137)\n", + " return gp_opt.optimize(verbose=2, abs_tol=1e-3)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "dU2gF9rYC_Q_" + }, + "outputs": [], + "source": [ + "dataset = load_wine()\n", + "X = dataset.data\n", + "y = dataset.target\n", + "\n", + "# split data into training test and test set\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y,\n", + " test_size=0.2, random_state=3137)\n", + "\n", + "# hyperparams tuning\n", + "res_opt = optimize_bcn(X_train, y_train, 0)\n", + "print(res_opt)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7xw2ii1auV6N", + "outputId": "050fce15-672d-466d-eb51-595b24d0bfad" + }, + "outputs": [], + "source": [ + "print(res_opt.best_score)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "sddAUZp5tEGw" + }, + "outputs": [], + "source": [ + "res_opt.best_params[\"B\"] = int(res_opt.best_params[\"B\"])\n", + "res_opt.best_params[\"nu\"] = 10**res_opt.best_params[\"nu\"]\n", + "res_opt.best_params[\"lam\"] = 10**res_opt.best_params[\"lam\"]\n", + "res_opt.best_params[\"r\"] = 1 - 10**res_opt.best_params[\"r\"]\n", + "res_opt.best_params[\"tol\"] = 10**res_opt.best_params[\"tol\"]\n", + "res_opt.best_params[\"col_sample\"] = np.ceil(res_opt.best_params[\"col_sample\"])\n", + "res_opt.best_params[\"n_clusters\"] = np.ceil(res_opt.best_params[\"n_clusters\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zo4LTC_PDEGp", + "outputId": "0361a23c-ff05-4eb2-f4d4-6ed4f3ea5ed4" + }, + "outputs": [], + "source": [ + "start = time()\n", + "estimator = bcn.BCNClassifier(**res_opt.best_params,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\").fit(X_train, y_train)\n", + "print(f\"\\n Elapsed: {time() - start}\")\n", + "start = time()\n", + "print(f\"\\n\\n Test set accuracy: {estimator.score(X_test, y_test)}\")\n", + "print(f\"\\n Elapsed: {time() - start}\")" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy.ipynb b/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy.ipynb new file mode 100644 index 0000000..5bd795f --- /dev/null +++ b/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy.ipynb @@ -0,0 +1,360 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "ver1MWFiAIH1" + }, + "source": [ + "# 1 - Install" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "id": "cxJzB_Pwry-O" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Found existing installation: BCN 0.7.1\n", + "Uninstalling BCN-0.7.1:\n", + " Successfully uninstalled BCN-0.7.1\n", + "Found existing installation: GPopt 0.6.0\n", + "Uninstalling GPopt-0.6.0:\n", + " Successfully uninstalled GPopt-0.6.0\n" + ] + } + ], + "source": [ + "!pip uninstall -y BCN GPopt" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "id": "L7dr5u5k8hW9" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Collecting BCN\n", + " Downloading BCN-0.7.1-py2.py3-none-any.whl.metadata (873 bytes)\n", + "Requirement already satisfied: joblib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.4.0)\n", + "Requirement already satisfied: numpy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.26.4)\n", + "Requirement already satisfied: rpy2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (3.5.16)\n", + "Requirement already satisfied: scikit-learn in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.4.2)\n", + "Requirement already satisfied: cffi>=1.15.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (1.16.0)\n", + "Requirement already satisfied: jinja2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (3.1.3)\n", + "Requirement already satisfied: tzlocal in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (5.2)\n", + "Requirement already satisfied: scipy>=1.6.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from scikit-learn->BCN) (1.13.0)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from scikit-learn->BCN) (3.5.0)\n", + "Requirement already satisfied: pycparser in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from cffi>=1.15.1->rpy2->BCN) (2.22)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jinja2->rpy2->BCN) (2.1.5)\n", + "Downloading BCN-0.7.1-py2.py3-none-any.whl (7.6 kB)\n", + "Installing collected packages: BCN\n", + "Successfully installed BCN-0.7.1\n" + ] + } + ], + "source": [ + "!pip install BCN --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "id": "IBA5fko_BA4V" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Processing /Users/t/Documents/Python_Packages/GPopt\n", + " Preparing metadata (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25hRequirement already satisfied: joblib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.0)\n", + "Requirement already satisfied: matplotlib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (3.8.4)\n", + "Requirement already satisfied: nnetsauce in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (0.20.0)\n", + "Requirement already satisfied: numpy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.26.4)\n", + "Requirement already satisfied: pandas in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (2.2.2)\n", + "Requirement already satisfied: scipy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.13.0)\n", + "Requirement already satisfied: scikit-learn in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.2)\n", + "Requirement already satisfied: threadpoolctl in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (3.5.0)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (1.2.1)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (4.51.0)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (24.0)\n", + "Requirement already satisfied: pillow>=8 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (10.3.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (3.1.2)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (2.9.0.post0)\n", + "Requirement already satisfied: requests in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (2.31.0)\n", + "Requirement already satisfied: tqdm in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (4.66.2)\n", + "Requirement already satisfied: jax in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (0.4.26)\n", + "Requirement already satisfied: jaxlib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (0.4.26)\n", + "Requirement already satisfied: pytz>=2020.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from pandas->GPopt==0.6.0) (2024.1)\n", + "Requirement already satisfied: tzdata>=2022.7 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from pandas->GPopt==0.6.0) (2024.1)\n", + "Requirement already satisfied: six>=1.5 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->GPopt==0.6.0) (1.16.0)\n", + "Requirement already satisfied: ml-dtypes>=0.2.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jax->nnetsauce->GPopt==0.6.0) (0.4.0)\n", + "Requirement already satisfied: opt-einsum in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jax->nnetsauce->GPopt==0.6.0) (3.3.0)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (2.2.1)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (2024.2.2)\n", + "Building wheels for collected packages: GPopt\n", + " Building wheel for GPopt (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25h Created wheel for GPopt: filename=GPopt-0.6.0-py2.py3-none-any.whl size=71167 sha256=942d1858af551bbde42519cae8cad121ed77ffa4809629bb5a8ffdafceebf1fb\n", + " Stored in directory: /private/var/folders/cp/q8d6040n3m38d22z3hkk1zc40000gn/T/pip-ephem-wheel-cache-5f6tzmca/wheels/18/c5/f2/2bcb5749155d04d8e285ee88d9c1f7d49467719147ee803dc9\n", + "Successfully built GPopt\n", + "Installing collected packages: GPopt\n", + "Successfully installed GPopt-0.6.0\n" + ] + } + ], + "source": [ + "!pip install ../.. --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "id": "FV7pttAu8pXP" + }, + "outputs": [], + "source": [ + "import BCN as bcn # takes a long time to run, ONLY the first time it's run\n", + "import GPopt as gp\n", + "import numpy as np\n", + "\n", + "from sklearn.gaussian_process import GaussianProcessRegressor\n", + "from sklearn.ensemble import ExtraTreesRegressor, RandomForestRegressor\n", + "from sklearn.gaussian_process.kernels import Matern\n", + "from sklearn.datasets import load_iris, load_wine, load_breast_cancer\n", + "from sklearn.model_selection import train_test_split\n", + "from sklearn import metrics\n", + "from time import time" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "YniHGO9AAac2" + }, + "source": [ + "# 2 - cv" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "id": "LIGGEBbxCznR" + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "id": "fIgPu1vBAd7X" + }, + "outputs": [], + "source": [ + "def bcn_cv(X_train, y_train,\n", + " B = 10, nu = 0.335855,\n", + " lam = 10**0.7837525,\n", + " r = 1 - 10**(-5.470031),\n", + " tol = 10**-7,\n", + " col_sample=1,\n", + " n_clusters = 3):\n", + " \n", + " if n_clusters <= 1:\n", + " n_clusters = 0 \n", + "\n", + " estimator = bcn.BCNClassifier(B = int(B),\n", + " nu = nu,\n", + " lam = lam,\n", + " r = r,\n", + " tol = tol,\n", + " col_sample = col_sample,\n", + " n_clusters = n_clusters,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\",\n", + " show_progress = False)\n", + "\n", + " return -cross_val_score(estimator, X_train, y_train,\n", + " scoring='accuracy',\n", + " cv=5, n_jobs=None,\n", + " verbose=0).mean()\n", + "\n", + "def optimize_bcn(X_train, y_train):\n", + " # objective function for hyperparams tuning \n", + " def crossval_objective(x):\n", + " if x[6] <= 1:\n", + " x[6] = 0 \n", + " return bcn_cv(X_train=X_train,\n", + " y_train=y_train,\n", + " B = int(x[0]),\n", + " nu = 10**x[1],\n", + " lam = 10**x[2],\n", + " r = 1 - 10**x[3],\n", + " tol = 10**x[4],\n", + " col_sample = np.ceil(x[5]),\n", + " n_clusters = np.ceil(x[6]))\n", + " gp_opt = gp.GPOpt(objective_func=crossval_objective,\n", + " lower_bound = np.array([ 3, -6, -10, -10, -6, 0.8, 1]),\n", + " upper_bound = np.array([ 100, -0.1, 10, -1, -0.1, 1, 4]),\n", + " params_names=[\"B\", \"nu\", \"lam\", \"r\", \"tol\", \"col_sample\", \"n_clusters\"], \n", + " n_init=10, n_iter=50, seed=3137)\n", + " return gp_opt.lazyoptimize(verbose=2, abs_tol=1e-3)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "id": "dU2gF9rYC_Q_" + }, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'GPOpt' object has no attribute 'verbose'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[14], line 10\u001b[0m\n\u001b[1;32m 6\u001b[0m X_train, X_test, y_train, y_test \u001b[38;5;241m=\u001b[39m train_test_split(X, y,\n\u001b[1;32m 7\u001b[0m test_size\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.2\u001b[39m, random_state\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3137\u001b[39m)\n\u001b[1;32m 9\u001b[0m \u001b[38;5;66;03m# hyperparams tuning\u001b[39;00m\n\u001b[0;32m---> 10\u001b[0m res_opt \u001b[38;5;241m=\u001b[39m \u001b[43moptimize_bcn\u001b[49m\u001b[43m(\u001b[49m\u001b[43mX_train\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my_train\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28mprint\u001b[39m(res_opt)\n", + "Cell \u001b[0;32mIn[13], line 47\u001b[0m, in \u001b[0;36moptimize_bcn\u001b[0;34m(X_train, y_train)\u001b[0m\n\u001b[1;32m 33\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m bcn_cv(X_train\u001b[38;5;241m=\u001b[39mX_train,\n\u001b[1;32m 34\u001b[0m y_train\u001b[38;5;241m=\u001b[39my_train,\n\u001b[1;32m 35\u001b[0m B \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(x[\u001b[38;5;241m0\u001b[39m]),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 40\u001b[0m col_sample \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mceil(x[\u001b[38;5;241m5\u001b[39m]),\n\u001b[1;32m 41\u001b[0m n_clusters \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mceil(x[\u001b[38;5;241m6\u001b[39m]))\n\u001b[1;32m 42\u001b[0m gp_opt \u001b[38;5;241m=\u001b[39m gp\u001b[38;5;241m.\u001b[39mGPOpt(objective_func\u001b[38;5;241m=\u001b[39mcrossval_objective,\n\u001b[1;32m 43\u001b[0m lower_bound \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([ \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m0.8\u001b[39m, \u001b[38;5;241m1\u001b[39m]),\n\u001b[1;32m 44\u001b[0m upper_bound \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([ \u001b[38;5;241m100\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.1\u001b[39m, \u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.1\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m4\u001b[39m]),\n\u001b[1;32m 45\u001b[0m params_names\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mB\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnu\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlam\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtol\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcol_sample\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mn_clusters\u001b[39m\u001b[38;5;124m\"\u001b[39m], \n\u001b[1;32m 46\u001b[0m n_init\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m10\u001b[39m, n_iter\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m190\u001b[39m, seed\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3137\u001b[39m)\n\u001b[0;32m---> 47\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mgp_opt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlazyoptimize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mverbose\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mabs_tol\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1e-3\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages/GPopt/GPOpt/GPOpt.py:862\u001b[0m, in \u001b[0;36mGPOpt.lazyoptimize\u001b[0;34m(self, verbose, n_more_iter, abs_tol, min_budget, func_args, estimators)\u001b[0m\n\u001b[1;32m 858\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mresults_ \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 860\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;28mlen\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors)):\n\u001b[0;32m--> 862\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mverbose\u001b[49m \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m 863\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m using surrogate model # \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mi\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m (\u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors[i][\u001b[38;5;241m0\u001b[39m]\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m)... \u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 865\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msurrogate_obj \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mregressors[i][\u001b[38;5;241m1\u001b[39m]\n", + "\u001b[0;31mAttributeError\u001b[0m: 'GPOpt' object has no attribute 'verbose'" + ] + } + ], + "source": [ + "dataset = load_wine()\n", + "X = dataset.data\n", + "y = dataset.target\n", + "\n", + "# split data into training test and test set\n", + "X_train, X_test, y_train, y_test = train_test_split(X, y,\n", + " test_size=0.2, random_state=3137)\n", + "\n", + "# hyperparams tuning\n", + "res_opt = optimize_bcn(X_train, y_train)\n", + "print(res_opt)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7xw2ii1auV6N", + "outputId": "050fce15-672d-466d-eb51-595b24d0bfad" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-0.9857142857142858\n" + ] + } + ], + "source": [ + "print(res_opt.best_score)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "sddAUZp5tEGw" + }, + "outputs": [], + "source": [ + "res_opt.best_params[\"B\"] = int(res_opt.best_params[\"B\"])\n", + "res_opt.best_params[\"nu\"] = 10**res_opt.best_params[\"nu\"]\n", + "res_opt.best_params[\"lam\"] = 10**res_opt.best_params[\"lam\"]\n", + "res_opt.best_params[\"r\"] = 1 - 10**res_opt.best_params[\"r\"]\n", + "res_opt.best_params[\"tol\"] = 10**res_opt.best_params[\"tol\"]\n", + "res_opt.best_params[\"col_sample\"] = np.ceil(res_opt.best_params[\"col_sample\"])\n", + "res_opt.best_params[\"n_clusters\"] = np.ceil(res_opt.best_params[\"n_clusters\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "zo4LTC_PDEGp", + "outputId": "0361a23c-ff05-4eb2-f4d4-6ed4f3ea5ed4" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " |======================================================================| 100%\n", + "\n", + " Elapsed: 0.3253192901611328\n", + "\n", + "\n", + " Test set accuracy: 1.0\n", + "\n", + " Elapsed: 0.0092620849609375\n" + ] + } + ], + "source": [ + "start = time()\n", + "estimator = bcn.BCNClassifier(**res_opt.best_params,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\").fit(X_train, y_train)\n", + "print(f\"\\n Elapsed: {time() - start}\")\n", + "start = time()\n", + "print(f\"\\n\\n Test set accuracy: {estimator.score(X_test, y_test)}\")\n", + "print(f\"\\n Elapsed: {time() - start}\")" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy_Pt2.ipynb b/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy_Pt2.ipynb new file mode 100644 index 0000000..974ea65 --- /dev/null +++ b/GPopt/demo/thierrymoudiki_20240501_tuning_BCN_classifier_lazy_Pt2.ipynb @@ -0,0 +1,3016 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + " \"Open\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ver1MWFiAIH1" + }, + "source": [ + "# 1 - Install" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "L7dr5u5k8hW9", + "outputId": "f26bd34b-d73b-4fee-b97a-3df46a0d8018" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: BCN in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (0.7.1)\n", + "Requirement already satisfied: joblib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.4.2)\n", + "Requirement already satisfied: numpy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.26.4)\n", + "Requirement already satisfied: rpy2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (3.5.16)\n", + "Requirement already satisfied: scikit-learn in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from BCN) (1.4.2)\n", + "Requirement already satisfied: cffi>=1.15.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (1.16.0)\n", + "Requirement already satisfied: jinja2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (3.1.3)\n", + "Requirement already satisfied: tzlocal in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from rpy2->BCN) (5.2)\n", + "Requirement already satisfied: scipy>=1.6.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from scikit-learn->BCN) (1.13.0)\n", + "Requirement already satisfied: threadpoolctl>=2.0.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from scikit-learn->BCN) (3.5.0)\n", + "Requirement already satisfied: pycparser in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from cffi>=1.15.1->rpy2->BCN) (2.22)\n", + "Requirement already satisfied: MarkupSafe>=2.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jinja2->rpy2->BCN) (2.1.5)\n" + ] + } + ], + "source": [ + "!pip install BCN --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "IBA5fko_BA4V", + "outputId": "122f3221-2fb1-409e-c4e8-17d9d1d8709c" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Processing /Users/t/Documents/Python_Packages/GPopt\n", + " Preparing metadata (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25hRequirement already satisfied: joblib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.2)\n", + "Requirement already satisfied: matplotlib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (3.8.4)\n", + "Requirement already satisfied: nnetsauce in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (0.20.1)\n", + "Requirement already satisfied: numpy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.26.4)\n", + "Requirement already satisfied: pandas in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (2.2.2)\n", + "Requirement already satisfied: scipy in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.13.0)\n", + "Requirement already satisfied: scikit-learn in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (1.4.2)\n", + "Requirement already satisfied: threadpoolctl in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (3.5.0)\n", + "Requirement already satisfied: tqdm in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from GPopt==0.6.0) (4.66.4)\n", + "Requirement already satisfied: contourpy>=1.0.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (1.2.1)\n", + "Requirement already satisfied: cycler>=0.10 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (0.12.1)\n", + "Requirement already satisfied: fonttools>=4.22.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (4.51.0)\n", + "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (1.4.5)\n", + "Requirement already satisfied: packaging>=20.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (24.0)\n", + "Requirement already satisfied: pillow>=8 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (10.3.0)\n", + "Requirement already satisfied: pyparsing>=2.3.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (3.1.2)\n", + "Requirement already satisfied: python-dateutil>=2.7 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from matplotlib->GPopt==0.6.0) (2.9.0.post0)\n", + "Requirement already satisfied: requests in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (2.31.0)\n", + "Requirement already satisfied: jax in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (0.4.26)\n", + "Requirement already satisfied: jaxlib in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from nnetsauce->GPopt==0.6.0) (0.4.26)\n", + "Requirement already satisfied: pytz>=2020.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from pandas->GPopt==0.6.0) (2024.1)\n", + "Requirement already satisfied: tzdata>=2022.7 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from pandas->GPopt==0.6.0) (2024.1)\n", + "Requirement already satisfied: six>=1.5 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->GPopt==0.6.0) (1.16.0)\n", + "Requirement already satisfied: ml-dtypes>=0.2.0 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jax->nnetsauce->GPopt==0.6.0) (0.4.0)\n", + "Requirement already satisfied: opt-einsum in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from jax->nnetsauce->GPopt==0.6.0) (3.3.0)\n", + "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (3.3.2)\n", + "Requirement already satisfied: idna<4,>=2.5 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (3.7)\n", + "Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (2.2.1)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /Users/t/Documents/Python_Packages/GPopt/venv/lib/python3.11/site-packages (from requests->nnetsauce->GPopt==0.6.0) (2024.2.2)\n", + "Building wheels for collected packages: GPopt\n", + " Building wheel for GPopt (setup.py) ... \u001b[?25ldone\n", + "\u001b[?25h Created wheel for GPopt: filename=GPopt-0.6.0-py2.py3-none-any.whl size=71975 sha256=d9d3f4994f13f2f1c3cf8691218a26972e531fffb02f201c850ed084d1a3d6cb\n", + " Stored in directory: /private/var/folders/cp/q8d6040n3m38d22z3hkk1zc40000gn/T/pip-ephem-wheel-cache-5t5s_fb7/wheels/18/c5/f2/2bcb5749155d04d8e285ee88d9c1f7d49467719147ee803dc9\n", + "Successfully built GPopt\n", + "Installing collected packages: GPopt\n", + " Attempting uninstall: GPopt\n", + " Found existing installation: GPopt 0.6.0\n", + " Uninstalling GPopt-0.6.0:\n", + " Successfully uninstalled GPopt-0.6.0\n", + "Successfully installed GPopt-0.6.0\n" + ] + } + ], + "source": [ + "!pip install ../.. --upgrade --no-cache-dir" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "id": "FV7pttAu8pXP" + }, + "outputs": [], + "source": [ + "import BCN as bcn # takes a long time to run, ONLY the first time it's run\n", + "import GPopt as gp\n", + "import numpy as np\n", + "\n", + "from sklearn.gaussian_process import GaussianProcessRegressor\n", + "from sklearn.gaussian_process.kernels import Matern\n", + "from sklearn.datasets import load_iris, load_wine, load_breast_cancer\n", + "from sklearn.model_selection import train_test_split, cross_val_score\n", + "from sklearn import metrics\n", + "from time import time" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "datasets = [load_wine, load_iris]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "YniHGO9AAac2" + }, + "source": [ + "# 2 - cv" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2 - 1 kde surrogates" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "id": "LIGGEBbxCznR" + }, + "outputs": [], + "source": [ + "from sklearn.model_selection import cross_val_score" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "id": "fIgPu1vBAd7X" + }, + "outputs": [], + "source": [ + "def bcn_cv(X_train, y_train,\n", + " B = 10, nu = 0.335855,\n", + " lam = 10**0.7837525,\n", + " r = 1 - 10**(-5.470031),\n", + " tol = 10**-7,\n", + " col_sample=1,\n", + " n_clusters = 3):\n", + "\n", + " estimator = bcn.BCNClassifier(B = int(B),\n", + " nu = nu,\n", + " lam = lam,\n", + " r = r,\n", + " tol = tol,\n", + " col_sample = col_sample,\n", + " n_clusters = n_clusters,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\",\n", + " show_progress = False)\n", + "\n", + " return -cross_val_score(estimator, X_train, y_train,\n", + " scoring='f1_macro',\n", + " cv=5, n_jobs=None,\n", + " verbose=0).mean()\n", + "\n", + "def optimize_bcn(X_train, y_train):\n", + " # objective function for hyperparams tuning\n", + " def crossval_objective(x):\n", + " return bcn_cv(X_train=X_train,\n", + " y_train=y_train,\n", + " B = int(x[0]),\n", + " nu = 10**x[1],\n", + " lam = 10**x[2],\n", + " r = 1 - 10**x[3],\n", + " tol = 10**x[4],\n", + " col_sample = np.ceil(x[5]),\n", + " n_clusters = np.ceil(x[6]))\n", + " gp_opt = gp.GPOpt(objective_func=crossval_objective,\n", + " lower_bound = np.array([ 3, -6, -10, -10, -6, 0.8, 1]),\n", + " upper_bound = np.array([ 100, -0.1, 10, -1, -0.1, 1, 4]),\n", + " min_value = -1.0, \n", + " n_init=10, n_iter=50, seed=3137)\n", + " return {'parameters': gp_opt.lazyoptimize(method=\"mc\",\n", + " estimators = [\"BaggingRegressor\", \n", + " \"ExtraTreesRegressor\", \n", + " \"RandomForestRegressor\"],\n", + " verbose=2, abs_tol=1e-1), 'opt_object': gp_opt}" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "dU2gF9rYC_Q_", + "outputId": "600a5854-6c32-4603-d8b4-d4c0d4a44263" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [29.25997925 -0.90249939 -1.29089355 -7.03671265 -5.42616882 0.99440308\n", + " 1.83303833]\n", + "score for next parameter: -1.0 \n", + "\n", + "{'parameters': DescribeResult(best_params=array([29.25997925, -0.90249939, -1.29089355, -7.03671265, -5.42616882,\n", + " 0.99440308, 1.83303833]), best_score=-1.0, best_surrogate=CustomRegressor(obj=BaggingRegressor(), replications=150, type_pi='kde')), 'opt_object': }\n", + " |======================================================================| 100%\n", + "\n", + "\n", + " Test set accuracy: 0.9722222222222222\n", + "\n", + " Elapsed: 53.765836000442505\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [29.25997925 -0.90249939 -1.29089355 -7.03671265 -5.42616882 0.99440308\n", + " 1.83303833]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [61.17987061 -1.48821411 -5.01098633 -5.90374756 -4.69100952 0.98604736\n", + " 1.32904053]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [49.52258301 -3.17027588 -7.33154297 -3.64440918 -3.4237915 0.90002441\n", + " 1.09191895]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [57.35528564 -1.26710815 4.42504883 -9.32818604 -4.14292603 0.94852295\n", + " 3.53253174]\n", + "score for next parameter: -0.790798073615411 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [97.69696045 -1.49109497 -3.9465332 -1.4520874 -4.4230896 0.94278564\n", + " 3.762146 ]\n", + "score for next parameter: -0.9521992890723542 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [41.13632202 -0.60072937 -0.41442871 -2.006073 -5.04805603 0.9781189\n", + " 3.31069946]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [86.23144474 -1.26062895 2.30159918 -9.94778117 -4.96713712 0.85116269\n", + " 3.56545594]\n", + "score for next parameter: -0.8234725829153074 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [70.37426758 -2.31970215 -5.27832031 -3.51586914 -5.75368652 0.87915039\n", + " 1.28051758]\n", + "score for next parameter: -0.9577635327635328 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [67.81072998 -1.7302063 -9.89379883 -5.60491943 -5.76268921 0.85987549\n", + " 2.6473999 ]\n", + "score for next parameter: -0.7907980736154111 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.95553589 -1.90071716 -5.87585449 -5.85238647 -4.75348816 0.96935425\n", + " 2.384552 ]\n", + "score for next parameter: -0.9601513587891297 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [72.64770508 -0.2454834 -3.87207031 -5.83618164 -4.60134277 0.94633789\n", + " 2.33520508]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [60.55230713 -1.45580444 -0.65795898 -4.47442627 -4.82713013 0.94573975\n", + " 2.77740479]\n", + "score for next parameter: -0.9593748259537733 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 6.13781738 -1.56851807 -2.76123047 -5.59558105 -5.32515869 0.97697754\n", + " 3.52355957]\n", + "score for next parameter: -0.832962920120815 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [26.59363994 -5.45847167 7.66782133 -6.80583503 -1.92765282 0.85876589\n", + " 2.62865945]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [70.54891968 -0.91474304 -4.79919434 -7.70578003 -4.99908142 0.89188843\n", + " 2.85220337]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [27.74139404 -1.67835083 -0.38208008 -5.70159912 -4.02841187 0.90499268\n", + " 3.66986084]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [22.16732788 -0.55895691 -2.35290527 -2.32907104 -4.59720154 0.89515991\n", + " 1.6210022 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [32.92175293 -1.79178467 -7.54150391 -2.70178223 -3.77957764 0.9564209\n", + " 1.14099121]\n", + "score for next parameter: -0.5870147630147631 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 4.54522705 -0.46334839 -4.1394043 -1.07965088 -4.45117798 0.92967529\n", + " 1.00860596]\n", + "score for next parameter: -0.9589390961062788 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.21234131 -0.79248657 -1.70532227 -5.55438232 -5.86207886 0.88199463\n", + " 2.48114014]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [50.9760437 -0.82327576 -5.23132324 -8.09359741 -5.62350769 0.88087769\n", + " 3.84646606]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [48.97459547 -0.48934498 4.02367628 -2.68769112 -1.12635245 0.89247043\n", + " 3.60488843]\n", + "score for next parameter: -0.7683943810286521 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [59.68200684 -1.66790771 -7.74658203 -3.76965332 -5.90853271 0.80300293\n", + " 3.67956543]\n", + "score for next parameter: -0.8203324550692972 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [22.67352295 -2.27468872 -2.2277832 -1.8036499 -5.85199585 0.90997314\n", + " 1.1137085 ]\n", + "score for next parameter: -0.5805982905982906 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [26.77636719 -0.14033203 -8.22265625 -6.59863281 -4.63447266 0.96738281\n", + " 1.67675781]\n", + "score for next parameter: -0.9349137549756745 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [56.13568115 -1.20444946 -4.60571289 -4.11737061 -4.45910034 0.89967041\n", + " 2.50311279]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [35.82867432 -1.69203491 -3.99780273 -3.69219971 -1.52566528 0.89007568\n", + " 1.28033447]\n", + "score for next parameter: -0.7635062007235921 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [81.32702637 -0.32254639 -6.62353516 -3.71252441 -3.84295654 0.91950684\n", + " 2.14001465]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [71.36386837 -4.10036573 6.97359411 -9.02428174 -2.52055746 0.93959145\n", + " 1.15576259]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [20.7789917 -0.59226685 -9.9621582 -3.31536865 -5.64457397 0.87637939\n", + " 2.69573975]\n", + "score for next parameter: -0.7987501433321866 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [63.32794828 -0.30289793 0.99469241 -2.74332929 -2.84288681 0.8113242\n", + " 2.69867417]\n", + "score for next parameter: -0.9118212197159565 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.18341064 -0.62179565 0.36254883 -4.12506104 -5.89448853 0.99539795\n", + " 3.20440674]\n", + "score for next parameter: -0.9445393713040773 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [25.25482178 -0.68589478 -8.78540039 -5.40057373 -4.60890503 0.93834229\n", + " 1.52459717]\n", + "score for next parameter: -0.903322194374826 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [90.32012939 -0.96749878 -5.02807617 -4.65240479 -4.39644165 0.8618042\n", + " 3.02862549]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.0132581 -3.76422671 6.57971842 -5.82198753 -4.33375148 0.8005958\n", + " 2.77675216]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [72.28952026 -0.64466248 -7.39929199 -3.6902771 -5.5025116 0.94943237\n", + " 1.46463013]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.26712784 -4.50386356 -7.66841876 -5.34755625 -5.56134511 0.98353203\n", + " 3.56795442]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [83.09261445 -5.27003396 -3.95805902 -1.14837026 -0.1333424 0.93540682\n", + " 3.82624314]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [50.8193283 -3.05975379 -6.27466769 -6.83094636 -3.91334651 0.89702417\n", + " 2.40270554]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.0743103 -0.51142273 -3.43200684 -3.78585815 -5.21802673 0.8743103\n", + " 3.13931274]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [16.06723322 -1.88451362 -2.99815455 -5.95832332 -5.56295557 0.86632232\n", + " 1.36581272]\n", + "score for next parameter: -0.9252168883747831 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.00908248 -0.9280715 7.76992743 -8.53901055 -0.27853035 0.96162671\n", + " 1.84533372]\n", + "score for next parameter: -0.6223212343212342 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [91.32067871 -0.48099365 -0.59814453 -4.98254395 -4.53724365 0.9932373\n", + " 2.99401855]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [30.58615112 -0.68355408 -3.36120605 -5.19100952 -3.20214539 0.9291687\n", + " 3.86624146]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [71.6708374 -0.30562134 -6.09008789 -3.37908936 -5.08136597 0.87388916\n", + " 3.31170654]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [93.07015991 -0.52150574 -7.34313965 -1.35787964 -4.92273865 0.91166382\n", + " 2.65371704]\n", + "score for next parameter: -0.951255917571707 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [26.27313232 -1.22605591 1.4050293 -3.08685303 -5.61000366 0.94552002\n", + " 3.40472412]\n", + "score for next parameter: -0.8517489046900814 \n", + "\n", + "Global iteration #1 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "\n", + " adjusting surrogate model # 2 (CustomRegressor(ExtraTreesRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [35.40536499 -0.70155945 -9.74060059 -4.56808472 -5.51187439 0.97723999\n", + " 1.78286743]\n", + "score for next parameter: -0.909962821835887 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [ 4.54522705 -0.46334839 -4.1394043 -1.07965088 -4.45117798 0.92967529\n", + " 1.00860596]\n", + "score for next parameter: -0.9589390961062788 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [78.29155828 -2.57441955 -0.13075297 -4.26919887 -5.98512685 0.81986148\n", + " 1.1709052 ]\n", + "score for next parameter: -0.9248040916771567 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [38.64086914 -4.9182373 -8.30566406 -6.77661133 -4.22683105 0.94536133\n", + " 1.59985352]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [11.3359375 -2.54296875 5.15625 -4.4453125 -5.86171875 0.9609375\n", + " 1.2578125 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 4.75961374 -5.93055824 -3.35033501 -7.81930084 -5.3436628 0.9203518\n", + " 2.84529444]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [86.23144474 -1.26062895 2.30159918 -9.94778117 -4.96713712 0.85116269\n", + " 3.56545594]\n", + "score for next parameter: -0.8234725829153074 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.22140503 -0.11026306 -9.40612793 -3.64852905 -5.36567078 0.95856323\n", + " 1.74954224]\n", + "score for next parameter: -0.9435018919848641 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [22.16732788 -0.55895691 -2.35290527 -2.32907104 -4.59720154 0.89515991\n", + " 1.6210022 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [30.75916535 -2.8936722 4.84967267 -2.92231716 -1.66099424 0.9341604\n", + " 1.27986004]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.35076069 -3.08514709 -0.69249388 -3.63324951 -5.10104874 0.84445155\n", + " 1.84595775]\n", + "score for next parameter: -0.47852991452991456 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [32.00704956 -0.5971283 -8.3807373 -2.35214233 -5.80068054 0.91998901\n", + " 2.94338989]\n", + "score for next parameter: -0.8083947677136532 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [39.54077148 -0.45578613 1.02050781 -3.45874023 -5.6701416 0.92885742\n", + " 2.2487793 ]\n", + "score for next parameter: -0.9280034235916588 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [18.3340623 -5.20831098 -9.34621063 -5.03040926 -1.16238501 0.89684234\n", + " 2.9677441 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [26.59363994 -5.45847167 7.66782133 -6.80583503 -1.92765282 0.85876589\n", + " 2.62865945]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [17.50807616 -3.63641938 -0.81516959 -6.73703575 -2.78494567 0.90551361\n", + " 1.54231583]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.0743103 -0.51142273 -3.43200684 -3.78585815 -5.21802673 0.8743103\n", + " 3.13931274]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [21.12237549 -1.26422729 -3.22143555 -1.47515869 -5.78213501 0.96776123\n", + " 2.03692627]\n", + "score for next parameter: -0.9527221648893477 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [33.75061035 -0.6725708 -3.04443359 -2.0579834 -5.88692627 0.92141113\n", + " 2.19494629]\n", + "score for next parameter: -0.951255917571707 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.18461444 -1.55721418 -0.92942319 -4.17010123 -4.20746241 0.97039887\n", + " 1.73840401]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.82471824 -1.04253491 -7.11007017 -3.61726928 -1.05564586 0.89139124\n", + " 3.27569318]\n", + "score for next parameter: -0.762376978141684 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [44.34003693 -1.63440122 -6.86964265 -8.83658586 -4.06036562 0.99535025\n", + " 1.12731739]\n", + "score for next parameter: -0.8154217762913415 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [48.97459547 -0.48934498 4.02367628 -2.68769112 -1.12635245 0.89247043\n", + " 3.60488843]\n", + "score for next parameter: -0.7683943810286521 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [31.67550659 -1.11856384 -3.80065918 -2.18075562 -2.61733093 0.89274292\n", + " 1.98684692]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 8.97756801 -3.35099037 5.00761608 -8.45276339 -5.84574241 0.88054979\n", + " 1.30676987]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.42004395 -1.20552979 -3.71826172 -1.71960449 -3.60240479 0.92717285\n", + " 2.31945801]\n", + "score for next parameter: -0.9521992890723542 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.97840402 -4.09657569 -3.3203752 -9.48069362 -2.14510979 0.83312004\n", + " 2.0846341 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.54980469 -1.29267578 -1.81640625 -2.87207031 -0.62431641 0.97207031\n", + " 3.38769531]\n", + "score for next parameter: -0.9513976179765653 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [46.75183105 -0.90447998 -0.86181641 -4.26623535 -2.63875732 0.92946777\n", + " 3.05700684]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [76.09042358 -1.42465515 -2.89489746 -2.61251831 -3.22159119 0.89940796\n", + " 2.3644104 ]\n", + "score for next parameter: -0.951255917571707 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [36.39274637 -5.06301976 -7.24479204 -2.74657433 -1.66871527 0.8429524\n", + " 3.9728427 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [63.32794828 -0.30289793 0.99469241 -2.74332929 -2.84288681 0.8113242\n", + " 2.69867417]\n", + "score for next parameter: -0.9118212197159565 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [36.10101318 -0.89619751 -4.47875977 -2.33758545 -5.22828979 0.940979\n", + " 2.22918701]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [13.42880249 -1.3007782 -3.02185059 -3.93527222 -5.37359314 0.94130249\n", + " 2.83755493]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [69.08953857 -0.60379028 -1.7980957 -1.92669678 -1.02367554 0.85098877\n", + " 1.86956787]\n", + "score for next parameter: -0.9521067374318148 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.0132581 -3.76422671 6.57971842 -5.82198753 -4.33375148 0.8005958\n", + " 2.77675216]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.37823486 -0.74567261 -2.16674805 -4.37554932 -0.83858032 0.92518311\n", + " 2.08966064]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [96.66088867 -0.99162598 -5.91308594 -2.88745117 -1.74641113 0.87749023\n", + " 3.21264648]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [83.09261445 -5.27003396 -3.95805902 -1.14837026 -0.1333424 0.93540682\n", + " 3.82624314]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [50.8193283 -3.05975379 -6.27466769 -6.83094636 -3.91334651 0.89702417\n", + " 2.40270554]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.31890869 -0.8277771 -8.56811523 -2.30352783 -1.1914856 0.88890381\n", + " 2.2119751 ]\n", + "score for next parameter: -0.8225459072517897 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 3.7153757 -0.54264509 -7.58613214 -5.06055548 -0.84674669 0.86606726\n", + " 2.55714102]\n", + "score for next parameter: -0.583122507122507 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [16.06723322 -1.88451362 -2.99815455 -5.95832332 -5.56295557 0.86632232\n", + " 1.36581272]\n", + "score for next parameter: -0.9252168883747831 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.00908248 -0.9280715 7.76992743 -8.53901055 -0.27853035 0.96162671\n", + " 1.84533372]\n", + "score for next parameter: -0.6223212343212342 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.26795476 -1.9373047 -3.79085411 -8.26376342 -2.26006856 0.97236419\n", + " 2.19545 ]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.81126277 -5.45807985 -6.70723536 -4.40920268 -4.24782511 0.99682821\n", + " 3.73510775]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [97.92489624 -1.09335632 -5.75622559 -4.39230347 -0.32632751 0.91083374\n", + " 2.70864868]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [33.37298024 -1.53918059 -7.67205338 -2.09071315 -3.16740687 0.84715434\n", + " 2.65307455]\n", + "score for next parameter: -0.827206273258905 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [52.0831604 -0.89205627 -4.44885254 -1.4737854 -5.71461487 0.91365356\n", + " 3.03146362]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [12.57431669 -0.36696139 6.24173089 -9.82896983 -1.69082019 0.83776172\n", + " 2.84046913]\n", + "score for next parameter: -0.8213828689370486 \n", + "\n", + "Global iteration #2 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "\n", + " adjusting surrogate model # 3 (CustomRegressor(RandomForestRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [10.59884644 -1.13872986 -2.1697998 -4.02206421 -3.96845398 0.92584839\n", + " 1.64846802]\n", + "score for next parameter: -0.9602801120448179 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [18.33978271 -0.17310181 -2.08618164 -4.72381592 -5.55958862 0.9776001\n", + " 1.57440186]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [ 4.54522705 -0.46334839 -4.1394043 -1.07965088 -4.45117798 0.92967529\n", + " 1.00860596]\n", + "score for next parameter: -0.9589390961062788 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [22.16732788 -0.55895691 -2.35290527 -2.32907104 -4.59720154 0.89515991\n", + " 1.6210022 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [35.93976104 -3.31832619 2.34293083 -9.17399315 -0.70438412 0.83299588\n", + " 1.92984919]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [81.04082666 -1.20941908 -7.65014289 -6.15055122 -2.96474279 0.86446771\n", + " 2.67164216]\n", + "score for next parameter: -0.8173744819565254 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [51.29278564 -0.89835815 -6.82495117 -2.01568604 -5.98667603 0.96102295\n", + " 1.09503174]\n", + "score for next parameter: -0.9444849050731404 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [86.23144474 -1.26062895 2.30159918 -9.94778117 -4.96713712 0.85116269\n", + " 3.56545594]\n", + "score for next parameter: -0.8234725829153074 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [43.08117676 -0.8425415 -2.87841797 -9.23425293 -5.06011963 0.99611816\n", + " 1.0098877 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [11.67932129 -0.13673096 -0.56396484 -6.83044434 -5.38565674 0.93449707\n", + " 2.04553223]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [86.46002197 -0.28329468 -8.05053711 -9.25128174 -5.90745239 0.91341553\n", + " 1.66558838]\n", + "score for next parameter: -0.9362003046832769 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [88.35076069 -3.08514709 -0.69249388 -3.63324951 -5.10104874 0.84445155\n", + " 1.84595775]\n", + "score for next parameter: -0.47852991452991456 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [25.25482178 -0.68589478 -8.78540039 -5.40057373 -4.60890503 0.93834229\n", + " 1.52459717]\n", + "score for next parameter: -0.903322194374826 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [10.44491577 -0.7620575 -3.14880371 -2.74435425 -4.47188416 0.91640015\n", + " 2.10366821]\n", + "score for next parameter: -0.9593748259537733 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [18.3340623 -5.20831098 -9.34621063 -5.03040926 -1.16238501 0.89684234\n", + " 2.9677441 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [26.59363994 -5.45847167 7.66782133 -6.80583503 -1.92765282 0.85876589\n", + " 2.62865945]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [17.50807616 -3.63641938 -0.81516959 -6.73703575 -2.78494567 0.90551361\n", + " 1.54231583]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [81.91250527 -4.80353203 -3.26054911 -1.17464316 -0.94771943 0.89426076\n", + " 2.25230734]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 5.86547852 -0.61999512 -6.70410156 -3.41918945 -2.64812012 0.9715332\n", + " 1.14868164]\n", + "score for next parameter: -0.5563076923076923 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.18461444 -1.55721418 -0.92942319 -4.17010123 -4.20746241 0.97039887\n", + " 1.73840401]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [21.12237549 -1.26422729 -3.22143555 -1.47515869 -5.78213501 0.96776123\n", + " 2.03692627]\n", + "score for next parameter: -0.9527221648893477 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [19.08575439 -0.87531128 -2.21557617 -7.32427979 -4.85737915 0.9336792\n", + " 1.48175049]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [48.97459547 -0.48934498 4.02367628 -2.68769112 -1.12635245 0.89247043\n", + " 3.60488843]\n", + "score for next parameter: -0.7683943810286521 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.94915771 -1.00278931 -3.02368164 -8.80194092 -4.36115112 0.9307251\n", + " 1.99627686]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [13.26303101 -1.67673035 -3.87634277 -7.37399292 -4.8622406 0.98148804\n", + " 2.07217407]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [32.98687744 -1.63441772 -5.98999023 -4.79962158 -3.79578247 0.96468506\n", + " 2.22369385]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.97840402 -4.09657569 -3.3203752 -9.48069362 -2.14510979 0.83312004\n", + " 2.0846341 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [46.02362061 -2.04133911 -0.63598633 -1.68499756 -5.24413452 0.95479736\n", + " 1.79779053]\n", + "score for next parameter: -0.8548705096073517 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [43.95443726 -1.88415222 -2.23571777 -6.35446167 -3.91731873 0.92445679\n", + " 3.25576782]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [97.084198 -1.80132751 -1.52526855 -6.5093689 -4.84999695 0.94205933\n", + " 1.72756958]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [87.08758545 -1.95203247 -3.0090332 -3.2802124 -5.0684021 0.89591064\n", + " 1.652771 ]\n", + "score for next parameter: -0.9602801120448179 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [21.82098389 -1.31248169 -3.65356445 -5.83782959 -4.48646851 0.88594971\n", + " 1.73773193]\n", + "score for next parameter: -0.9602801120448179 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [31.565979 -1.90521851 -1.00952148 -3.15606689 -4.93084106 0.98597412\n", + " 1.66998291]\n", + "score for next parameter: -0.9247601910759805 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.30957421 -5.06259382 -8.09861429 -9.34766392 -1.41627948 0.83583128\n", + " 1.66314507]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [20.50665283 -1.14611206 -7.19604492 -8.96783447 -4.51743774 0.91864014\n", + " 2.41046143]\n", + "score for next parameter: -0.8373871770930595 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [76.13778687 -0.98964539 -6.26403809 -7.85519409 -4.85503845 0.84872437\n", + " 1.98794556]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [35.77539062 -1.05644531 -1.6796875 -5.30664062 -5.29707031 0.93632812\n", + " 1.14648438]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.35449219 -0.97001953 -6.66015625 -2.52050781 -3.43603516 0.91425781\n", + " 2.09863281]\n", + "score for next parameter: -0.8505446623093682 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [75.58126831 -1.95689392 -3.9276123 -2.38729858 -4.90185242 0.90202026\n", + " 1.03323364]\n", + "score for next parameter: -0.9602801120448179 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 6.11117554 -1.6162323 -3.63220215 -3.76608276 -3.98934021 0.99642944\n", + " 2.20254517]\n", + "score for next parameter: -0.6544548784548785 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [18.34004701 -2.09680433 7.53517739 -7.51198309 -0.44065179 0.88448689\n", + " 2.21917284]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 3.7153757 -0.54264509 -7.58613214 -5.06055548 -0.84674669 0.86606726\n", + " 2.55714102]\n", + "score for next parameter: -0.583122507122507 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.22528076 -1.11658325 -4.86450195 -6.41790771 -4.86674194 0.99259033\n", + " 1.89593506]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.21246338 -1.29447632 -2.92358398 -3.80645752 -3.928302 0.9605835\n", + " 1.14849854]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.26795476 -1.9373047 -3.79085411 -8.26376342 -2.26006856 0.97236419\n", + " 2.19545 ]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.81126277 -5.45807985 -6.70723536 -4.40920268 -4.24782511 0.99682821\n", + " 3.73510775]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [36.10693359 -1.35893555 -7.52929688 -6.25146484 -3.98051758 0.98740234\n", + " 1.52294922]\n", + "score for next parameter: -0.8773511455864398 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [42.84140015 -1.16537781 -4.90661621 -7.75411987 -4.32207947 0.94882202\n", + " 2.39077759]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [96.06958484 -0.2866771 -1.28794547 -6.56640029 -1.79288589 0.9167581\n", + " 3.53500752]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [12.57431669 -0.36696139 6.24173089 -9.82896983 -1.69082019 0.83776172\n", + " 2.84046913]\n", + "score for next parameter: -0.8213828689370486 \n", + "\n", + "Global iteration #3 -----\n", + "current minimum: [81.59640503 -0.84776306 -1.90612793 -2.52352905 -4.62817078 0.88356323\n", + " 3.62454224]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "{'parameters': DescribeResult(best_params=array([81.59640503, -0.84776306, -1.90612793, -2.52352905, -4.62817078,\n", + " 0.88356323, 3.62454224]), best_score=-0.9763060428849902, best_surrogate=CustomRegressor(obj=BaggingRegressor(), replications=150, type_pi='kde')), 'opt_object': }\n", + " |======================================================================| 100%\n", + "\n", + "\n", + " Test set accuracy: 0.9666666666666667\n", + "\n", + " Elapsed: 1640.6403279304504\n" + ] + } + ], + "source": [ + "start = time()\n", + "for elt in datasets:\n", + "\n", + " dataset = elt()\n", + " X = dataset.data\n", + " y = dataset.target\n", + "\n", + " # split data into training test and test set\n", + " X_train, X_test, y_train, y_test = train_test_split(X, y,\n", + " test_size=0.2, random_state=3137)\n", + "\n", + " # hyperparams tuning\n", + " res1 = optimize_bcn(X_train, y_train)\n", + " print(res1)\n", + " parameters = res1[\"parameters\"]\n", + " estimator = bcn.BCNClassifier(B=int(parameters[0][0]),\n", + " nu=10**parameters[0][1],\n", + " lam=10**parameters[0][2],\n", + " r=1-10**parameters[0][3],\n", + " tol=10**parameters[0][4],\n", + " col_sample=np.ceil(parameters[0][5]),\n", + " n_clusters=np.ceil(parameters[0][6]),\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\").fit(X_train, y_train)\n", + " print(f\"\\n\\n Test set accuracy: {estimator.score(X_test, y_test)}\") \n", + " print(f\"\\n Elapsed: {time() - start}\") " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2 - 2 - bootstrap surrogates" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "id": "zo4LTC_PDEGp" + }, + "outputs": [], + "source": [ + "def bcn_cv(X_train, y_train,\n", + " B = 10, nu = 0.335855,\n", + " lam = 10**0.7837525,\n", + " r = 1 - 10**(-5.470031),\n", + " tol = 10**-7,\n", + " col_sample=1,\n", + " n_clusters = 3):\n", + "\n", + " estimator = bcn.BCNClassifier(B = int(B),\n", + " nu = nu,\n", + " lam = lam,\n", + " r = r,\n", + " tol = tol,\n", + " col_sample = col_sample,\n", + " n_clusters = n_clusters,\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\",\n", + " show_progress = False)\n", + "\n", + " return -cross_val_score(estimator, X_train, y_train,\n", + " scoring='f1_macro',\n", + " cv=5, n_jobs=None,\n", + " verbose=0).mean()\n", + "\n", + "def optimize_bcn2(X_train, y_train):\n", + " # objective function for hyperparams tuning\n", + " def crossval_objective(x):\n", + " return bcn_cv(X_train=X_train,\n", + " y_train=y_train,\n", + " B = int(x[0]),\n", + " nu = 10**x[1],\n", + " lam = 10**x[2],\n", + " r = 1 - 10**x[3],\n", + " tol = 10**x[4],\n", + " col_sample = np.ceil(x[5]),\n", + " n_clusters = np.ceil(x[6]))\n", + " gp_opt = gp.GPOpt(objective_func=crossval_objective,\n", + " lower_bound = np.array([ 3, -6, -10, -10, -6, 0.8, 1]),\n", + " upper_bound = np.array([ 100, -0.1, 10, -1, -0.1, 1, 4]),\n", + " min_value = -1.0, \n", + " n_init=10, n_iter=50, seed=3137)\n", + " return {'parameters': gp_opt.lazyoptimize(method=\"mc\",\n", + " type_pi=\"bootstrap\",\n", + " estimators = [\"BaggingRegressor\", \n", + " \"ExtraTreesRegressor\", \n", + " \"RandomForestRegressor\"],\n", + " verbose=2, abs_tol=1e-1), 'opt_object': gp_opt}" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [25.25482178 -0.68589478 -8.78540039 -5.40057373 -4.60890503 0.93834229\n", + " 1.52459717]\n", + "score for next parameter: -0.9115434958743615 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [21.75289917 -1.17185974 -8.58093262 -1.59408569 -3.98429871 0.8882019\n", + " 1.14968872]\n", + "score for next parameter: -0.8703990911365164 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [ 6.02532959 -1.26782837 -5.56274414 -2.94842529 -5.06408081 0.93502197\n", + " 1.66229248]\n", + "score for next parameter: -0.7336965299744204 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [18.25097656 -0.63583984 -5.29296875 -8.69042969 -3.65498047 0.94433594\n", + " 2.37402344]\n", + "score for next parameter: -0.9467825589704711 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [27.53121948 -0.14051208 -8.60046387 -8.49349976 -0.48693542 0.93253784\n", + " 1.82058716]\n", + "score for next parameter: -0.6457346121444794 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [26.09552002 -1.37081909 -4.28588867 -9.66217041 -3.43999634 0.95438232\n", + " 2.19073486]\n", + "score for next parameter: -0.9467825589704711 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [ 4.75961374 -5.93055824 -3.35033501 -7.81930084 -5.3436628 0.9203518\n", + " 2.84529444]\n", + "score for next parameter: -0.1932624557014801 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9467825589704711\n", + "next parameter: [11.84509277 -1.16663818 -4.52392578 -5.85266113 -2.38812256 0.95124512\n", + " 1.11022949]\n", + "score for next parameter: -0.9782738977419285 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [11.84509277 -1.16663818 -4.52392578 -5.85266113 -2.38812256 0.95124512\n", + " 1.11022949]\n", + "current minimum score: -0.9782738977419285\n", + "next parameter: [20.69906616 -0.26799011 -6.64001465 -7.58053589 -2.45672302 0.92963257\n", + " 1.68106079]\n", + "score for next parameter: -1.0 \n", + "\n", + "{'parameters': DescribeResult(best_params=array([20.69906616, -0.26799011, -6.64001465, -7.58053589, -2.45672302,\n", + " 0.92963257, 1.68106079]), best_score=-1.0, best_surrogate=CustomRegressor(obj=BaggingRegressor(), replications=150, type_pi='bootstrap')), 'opt_object': }\n", + " |======================================================================| 100%\n", + "\n", + "\n", + " Test set accuracy: 0.9722222222222222\n", + "\n", + " Elapsed: 127.63698601722717\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " adjusting surrogate model # 1 (CustomRegressor(BaggingRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [92.09921265 -0.19740906 -4.43786621 -2.19943237 -4.82911072 0.80975952\n", + " 1.52359009]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [54.44836426 -1.16519775 -2.40966797 -7.61706543 -5.84371338 0.81018066\n", + " 1.7364502 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [47.77902222 -1.75235291 -7.12097168 -3.71005249 -3.7120575 0.82125854\n", + " 3.90286255]\n", + "score for next parameter: -0.8085592185592185 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [76.31539917 -1.54060974 0.16906738 -8.90658569 -5.82804871 0.8007019\n", + " 3.58718872]\n", + "score for next parameter: -0.952436974789916 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [47.68725586 -1.87316895 -1.36230469 -9.48803711 -5.08244629 0.92612305\n", + " 1.94995117]\n", + "score for next parameter: -0.9499748617395676 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [ 7.33078003 -4.07432556 -3.46862793 -8.00790405 -4.72035828 0.95543823\n", + " 2.92141724]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [71.58203125 -0.76835937 -1.640625 -9.47265625 -4.13320312 0.80390625\n", + " 2.51171875]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.22140503 -0.11026306 -9.40612793 -3.64852905 -5.36567078 0.95856323\n", + " 1.74954224]\n", + "score for next parameter: -0.9435018919848641 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [37.8001709 -1.08597412 -1.04736328 -1.19445801 -4.8887085 0.80397949\n", + " 2.03015137]\n", + "score for next parameter: -0.9605653021442496 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [54.24707031 -0.98154297 -9.27734375 -8.86621094 -2.89443359 0.96855469\n", + " 2.94824219]\n", + "score for next parameter: -0.7987501433321866 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 6.62921143 -1.30455933 -1.2097168 -8.831604 -5.20020142 0.99412842\n", + " 3.10040283]\n", + "score for next parameter: -0.9517495536226187 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 9.53613281 -1.21201172 -4.12109375 -7.81152344 -5.98271484 0.92011719\n", + " 1.56542969]\n", + "score for next parameter: -0.9602801120448179 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [73.67785645 -0.23756104 -3.24951172 -9.66491699 -5.58443604 0.81311035\n", + " 1.49914551]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 4.5748291 -0.74171143 -8.59130859 -7.22595215 -4.75762939 0.99875488\n", + " 1.80822754]\n", + "score for next parameter: -0.5967955786903155 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [83.84320068 -0.29697876 -4.94750977 -7.89227295 -3.89157104 0.8050415\n", + " 1.59637451]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [36.97131348 -0.47667236 6.99462891 -9.91540527 -5.16094971 0.89055176\n", + " 3.33752441]\n", + "score for next parameter: -0.828478656419833 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [37.41830444 -1.46354675 -7.68493652 -7.76950073 -5.42112732 0.80082397\n", + " 1.02041626]\n", + "score for next parameter: -0.8744472291840714 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [81.91250527 -4.80353203 -3.26054911 -1.17464316 -0.94771943 0.89426076\n", + " 2.25230734]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [78.20697021 -0.40357056 -2.55493164 -3.24725342 -4.59161987 0.8166626\n", + " 1.17596436]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [69.03033447 -1.52782593 1.16821289 -9.74346924 -4.93948364 0.86497803\n", + " 3.09527588]\n", + "score for next parameter: -0.9197504444872866 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [21.74401855 -1.78026123 3.98193359 -9.96154785 -4.98953857 0.86853027\n", + " 1.62731934]\n", + "score for next parameter: -0.7751082251082252 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.2272644 -0.51358337 -5.46081543 -5.14266968 -5.99945984 0.82926636\n", + " 3.51321411]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [35.77539062 -1.05644531 -1.6796875 -5.30664062 -5.29707031 0.93632812\n", + " 1.14648438]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [16.02194214 -1.09407654 -8.92272949 -9.26254272 -4.86872253 0.877948\n", + " 1.57595825]\n", + "score for next parameter: -0.8358646616541353 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [39.32171631 -1.06904907 5.48217773 -7.94500732 -5.95426636 0.87261963\n", + " 3.37176514]\n", + "score for next parameter: -0.7973711301884676 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [55.50219727 -1.15007324 -0.53222656 -7.8840332 -5.06804199 0.93012695\n", + " 2.19165039]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [54.12866211 -0.32902832 -5.65917969 -9.45288086 -5.98127441 0.9456543\n", + " 3.88354492]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [71.16168213 -2.10111694 -2.22045898 -2.64630127 -3.81306763 0.89261475\n", + " 1.88677979]\n", + "score for next parameter: -0.9499748617395676 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [67.14764404 -1.12522583 -6.00708008 -2.04534912 -4.21278687 0.93624268\n", + " 3.20111084]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.17199707 -1.58580322 -1.88232422 -7.08093262 -0.52564697 0.83381348\n", + " 2.02062988]\n", + "score for next parameter: -0.6745103785103785 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.55282593 -1.49091492 -6.43981934 -5.98312378 -1.4268158 0.85985718\n", + " 2.72329712]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [57.81115723 -1.00675049 -5.11474609 -1.79431152 -5.59884033 0.82727051\n", + " 1.96643066]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [31.77911377 -1.53214722 -2.17651367 -8.71295166 -5.90601196 0.93953857\n", + " 3.98370361]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [61.62982178 -1.42339478 -1.28540039 -2.02557373 -5.34640503 0.81334229\n", + " 3.39959717]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.206604 -0.89115601 -1.94702148 -4.98419189 -4.46990356 0.82659912\n", + " 3.68560791]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [76.52261353 -1.38756409 -6.98791504 -9.15542603 -3.69801331 0.92107544\n", + " 3.25997925]\n", + "score for next parameter: -0.8065388143561517 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [53.96881104 -2.07518921 -2.95288086 -1.22686768 -5.55598755 0.85892334\n", + " 2.84039307]\n", + "score for next parameter: -0.8229411764705883 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [67.59759521 -1.04888306 -2.24243164 -5.91912842 -3.57755737 0.8635376\n", + " 2.25408936]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [83.09261445 -5.27003396 -3.95805902 -1.14837026 -0.1333424 0.93540682\n", + " 3.82624314]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [53.00082397 -2.23273621 -6.5423584 -2.17526245 -4.58279724 0.83139038\n", + " 3.60586548]\n", + "score for next parameter: -0.8917293233082706 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [86.59619141 -1.11118164 -2.31445312 -9.81103516 -4.57397461 0.84736328\n", + " 2.73876953]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [47.7701416 -0.87999268 0.31494141 -6.73376465 -5.26466064 0.84719238\n", + " 3.42541504]\n", + "score for next parameter: -0.9445393713040773 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [84.86447144 -1.04654236 -5.6072998 -5.56893921 -4.98251648 0.85397339\n", + " 3.10159302]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [61.94064331 -1.49595642 -2.9901123 -4.77792358 -4.44091492 0.86139526\n", + " 3.61135864]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.40447998 -1.1770813 -4.26879883 -1.94866943 -5.57831421 0.87862549\n", + " 3.4911499 ]\n", + "score for next parameter: -0.9605653021442496 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [87.96380615 -0.37476196 -0.54321289 -9.32049561 -5.47316284 0.84654541\n", + " 3.67498779]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [58.64001465 -0.78636475 1.68701172 -9.38586426 -5.87972412 0.86569824\n", + " 3.28405762]\n", + "score for next parameter: -0.9197504444872866 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [33.37298024 -1.53918059 -7.67205338 -2.09071315 -3.16740687 0.84715434\n", + " 2.65307455]\n", + "score for next parameter: -0.827206273258905 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.48178101 -0.38610535 -2.00134277 -3.71774292 -5.7841156 0.87523804\n", + " 3.66592407]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "Global iteration #1 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "\n", + " adjusting surrogate model # 2 (CustomRegressor(ExtraTreesRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [24.96472168 -1.58436279 -6.05712891 -2.03381348 -5.73856201 0.94938965\n", + " 2.76989746]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [11.72668457 -0.80220947 -8.91357422 -3.63562012 -4.07486572 0.98537598\n", + " 2.41906738]\n", + "score for next parameter: -0.8595710240911479 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [12.19439697 -3.32548218 -6.48803711 -1.23565674 -5.81526489 0.84779053\n", + " 1.80621338]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [29.02316284 -1.51036072 -7.94128418 -3.41122437 -4.11537781 0.94508667\n", + " 2.20950317]\n", + "score for next parameter: -0.7987501433321866 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [24.36972046 -0.88305359 -4.18395996 -3.19259644 -5.81436462 0.98104858\n", + " 1.08120728]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [81.04082666 -1.20941908 -7.65014289 -6.15055122 -2.96474279 0.86446771\n", + " 2.67164216]\n", + "score for next parameter: -0.8173744819565254 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [ 4.75961374 -5.93055824 -3.35033501 -7.81930084 -5.3436628 0.9203518\n", + " 2.84529444]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [86.23144474 -1.26062895 2.30159918 -9.94778117 -4.96713712 0.85116269\n", + " 3.56545594]\n", + "score for next parameter: -0.8234725829153074 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [20.27696505 -5.48194447 -8.70541165 -7.41702071 -3.24336578 0.86186647\n", + " 2.90761422]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [20.6635437 -1.19202576 6.01867676 -4.15609741 -3.77975769 0.94337769\n", + " 3.28396606]\n", + "score for next parameter: -0.8049600307959441 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [38.8480835 -0.60234985 -5.20141602 -7.03973389 -4.86530151 0.96656494\n", + " 2.61883545]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.07629395 -0.65240479 -4.34326172 -3.12585449 -0.83677979 0.94592285\n", + " 1.66320801]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 3.41948841 -1.51446798 2.47332694 -4.49869456 -1.32837366 0.82960593\n", + " 3.54826113]\n", + "score for next parameter: -0.26623712581636844 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [74.48007202 -1.15385437 -2.28942871 -2.849823 -2.28243103 0.9968689\n", + " 2.65444946]\n", + "score for next parameter: -0.951255917571707 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [27.17599487 -0.4761322 -0.47058105 -4.17147827 -5.57597351 0.96432495\n", + " 2.30764771]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [15.90649414 -0.2166748 2.00683594 -3.26098633 -5.05651855 0.98598633\n", + " 1.45922852]\n", + "score for next parameter: -0.9241715147597501 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [29.3458252 -0.21451416 1.51611328 -4.49694824 -3.02623291 0.9373291\n", + " 3.36242676]\n", + "score for next parameter: -0.9197504444872866 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [81.91250527 -4.80353203 -3.26054911 -1.17464316 -0.94771943 0.89426076\n", + " 2.25230734]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [93.91906348 -0.6551101 -1.72077482 -5.59091602 -1.96821904 0.90083125\n", + " 2.00370462]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.18461444 -1.55721418 -0.92942319 -4.17010123 -4.20746241 0.97039887\n", + " 1.73840401]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [22.64096069 -1.11784363 2.08068848 -3.65621948 -5.72073669 0.98754272\n", + " 2.36807251]\n", + "score for next parameter: -0.8224974200206399 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [86.28833008 -0.8907959 -1.05957031 -3.16430664 -3.58728027 0.99946289\n", + " 1.25708008]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [62.53268433 -1.08831482 -5.27038574 -3.36508179 -3.79128113 0.95939331\n", + " 2.49295044]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.57321167 -0.57264099 0.32531738 -1.10189819 -3.10851746 0.9397644\n", + " 2.57937622]\n", + "score for next parameter: -0.9278933444722919 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [41.10375977 -0.91960449 -4.75097656 -6.2668457 -5.85163574 0.86293945\n", + " 2.07446289]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [53.04818726 -0.96227722 -6.61071777 -1.01071167 -4.47044373 0.94320679\n", + " 2.78701782]\n", + "score for next parameter: -0.8960237194292923 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [15.88873291 -1.41835327 -6.97631836 -1.63116455 -2.13352661 0.93118896\n", + " 2.82281494]\n", + "score for next parameter: -0.8175634993026296 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [96.86218262 -1.17528076 -2.79541016 -4.02893066 -4.69569092 0.94528809\n", + " 1.4251709 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [93.0382248 -2.75412712 0.52006781 -5.57328548 -2.8378411 0.98536228\n", + " 2.88598003]\n", + "score for next parameter: -0.6377657527657528 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.37823486 -0.74567261 -2.16674805 -4.37554932 -0.83858032 0.92518311\n", + " 2.08966064]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [36.39274637 -5.06301976 -7.24479204 -2.74657433 -1.66871527 0.8429524\n", + " 3.9728427 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [80.62841797 -0.72514648 -2.02148438 -4.08935547 -1.94086914 0.99716797\n", + " 1.10693359]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [88.21246338 -1.29447632 -2.92358398 -3.80645752 -3.928302 0.9605835\n", + " 1.14849854]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.30957421 -5.06259382 -8.09861429 -9.34766392 -1.41627948 0.83583128\n", + " 1.66314507]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [20.93588257 -0.66842957 -2.64587402 -3.95504761 -1.19202576 0.97855835\n", + " 1.30752563]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [87.56417847 -0.48477478 -2.19909668 -5.71395874 -1.79916687 0.93297729\n", + " 1.7817688 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [57.55570745 -5.98347499 -9.89074106 -5.24899638 -5.85711424 0.87713217\n", + " 1.99379545]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [58.02133179 -1.73146667 -4.49157715 -2.88717651 -5.57957458 0.89564819\n", + " 3.29238892]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [49.68243408 -1.16915894 -1.80541992 -3.72955322 -3.38814087 0.98973389\n", + " 2.04718018]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [50.8193283 -3.05975379 -6.27466769 -6.83094636 -3.91334651 0.89702417\n", + " 2.40270554]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [66.44903564 -0.71398315 -6.19995117 -2.85943604 -2.85230103 0.96727295\n", + " 1.75128174]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [90.36157227 -0.32038574 -4.59472656 -5.2121582 -3.13210449 0.97700195\n", + " 1.01977539]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [16.06723322 -1.88451362 -2.99815455 -5.95832332 -5.56295557 0.86632232\n", + " 1.36581272]\n", + "score for next parameter: -0.9252168883747831 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [70.48675537 -1.23613892 -1.72485352 -3.40106201 -1.62721558 0.93883057\n", + " 1.61688232]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.26795476 -1.9373047 -3.79085411 -8.26376342 -2.26006856 0.97236419\n", + " 2.19545 ]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [34.81126277 -5.45807985 -6.70723536 -4.40920268 -4.24782511 0.99682821\n", + " 3.73510775]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [21.99268954 -2.8553348 4.28831457 -9.26887409 -1.73455867 0.94088029\n", + " 2.90010999]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [33.37298024 -1.53918059 -7.67205338 -2.09071315 -3.16740687 0.84715434\n", + " 2.65307455]\n", + "score for next parameter: -0.827206273258905 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [35.4498724 -0.6684831 -0.75697184 -3.47174887 -3.14412904 0.92486437\n", + " 3.34970469]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.75811768 -0.8666687 -0.5065918 -4.92926025 -2.54981079 0.96522217\n", + " 1.04962158]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "Global iteration #2 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "\n", + " adjusting surrogate model # 3 (CustomRegressor(RandomForestRegressor))... \n", + "\n", + "\n", + " Creating initial design... \n", + "\n", + "\n", + " ...Done. \n", + "\n", + "\n", + " Optimization loop... \n", + "\n", + "iteration 1 -----\n", + "current minimum: [87.875 -0.8375 -7.5 -4.375 -3.7875 0.875 2.875 ]\n", + "current minimum score: -0.9685185185185186\n", + "next parameter: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 2 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [13.42880249 -1.3007782 -3.02185059 -3.93527222 -5.37359314 0.94130249\n", + " 2.83755493]\n", + "score for next parameter: -0.9515861549298081 \n", + "\n", + "iteration 3 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 4.40609741 -0.75197449 -8.12438965 -4.24069214 -5.9828949 0.89447632\n", + " 3.09902954]\n", + "score for next parameter: -0.7166694514062935 \n", + "\n", + "iteration 4 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 9.08026123 -1.84544067 -1.22192383 -5.35882568 -5.50917358 0.97471924\n", + " 2.72943115]\n", + "score for next parameter: -0.6422548562548563 \n", + "\n", + "iteration 5 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [29.02316284 -1.51036072 -7.94128418 -3.41122437 -4.11537781 0.94508667\n", + " 2.20950317]\n", + "score for next parameter: -0.7987501433321866 \n", + "\n", + "iteration 6 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.36972046 -0.88305359 -4.18395996 -3.19259644 -5.81436462 0.98104858\n", + " 1.08120728]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 7 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 4.75961374 -5.93055824 -3.35033501 -7.81930084 -5.3436628 0.9203518\n", + " 2.84529444]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 8 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [86.23144474 -1.26062895 2.30159918 -9.94778117 -4.96713712 0.85116269\n", + " 3.56545594]\n", + "score for next parameter: -0.8234725829153074 \n", + "\n", + "iteration 9 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [79.18383789 -1.39206543 -8.07128906 -2.45239258 -4.34206543 0.93520508\n", + " 1.09594727]\n", + "score for next parameter: -0.8532285842812157 \n", + "\n", + "iteration 10 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [37.83273315 -0.767099 -4.13269043 -5.95126343 -5.28500671 0.94254761\n", + " 3.36087036]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 11 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [30.75916535 -2.8936722 4.84967267 -2.92231716 -1.66099424 0.9341604\n", + " 1.27986004]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 12 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [29.16229248 -1.77630005 -5.36254883 -8.48773193 -5.16347046 0.94581299\n", + " 3.0927124 ]\n", + "score for next parameter: -0.9685173718610252 \n", + "\n", + "iteration 13 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [38.8480835 -0.60234985 -5.20141602 -7.03973389 -4.86530151 0.96656494\n", + " 2.61883545]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 14 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [53.44781494 -0.85082397 -7.70874023 -5.15118408 -5.31687622 0.98187256\n", + " 2.62213135]\n", + "score for next parameter: -0.8974888200894394 \n", + "\n", + "iteration 15 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [64.909729 -0.98334351 -5.38452148 -6.81231689 -4.74646606 0.95472412\n", + " 2.13873291]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 16 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [26.59363994 -5.45847167 7.66782133 -6.80583503 -1.92765282 0.85876589\n", + " 2.62865945]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 17 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [60.29476929 -0.85568542 -5.89782715 -9.84811401 -5.16473083 0.92846069\n", + " 2.94082642]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 18 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [37.43310547 -0.40249023 -7.17773438 -3.59716797 -4.75258789 0.93935547\n", + " 2.86474609]\n", + "score for next parameter: -0.9682972136222912 \n", + "\n", + "iteration 19 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [65.44256592 -0.65276489 -9.32739258 -7.793396 -4.98485718 0.99053955\n", + " 1.09759521]\n", + "score for next parameter: -0.93593567251462 \n", + "\n", + "iteration 20 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [23.01690674 -0.82633667 -4.39331055 -6.22125244 -4.74502563 0.97947998\n", + " 2.96270752]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 21 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.18461444 -1.55721418 -0.92942319 -4.17010123 -4.20746241 0.97039887\n", + " 1.73840401]\n", + "score for next parameter: -0.9680687830687831 \n", + "\n", + "iteration 22 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [18.33978271 -0.17310181 -2.08618164 -4.72381592 -5.55958862 0.9776001\n", + " 1.57440186]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 23 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [44.34003693 -1.63440122 -6.86964265 -8.83658586 -4.06036562 0.99535025\n", + " 1.12731739]\n", + "score for next parameter: -0.8154217762913415 \n", + "\n", + "iteration 24 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.22140503 -0.11026306 -9.40612793 -3.64852905 -5.36567078 0.95856323\n", + " 1.74954224]\n", + "score for next parameter: -0.9435018919848641 \n", + "\n", + "iteration 25 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.08477783 -0.31642456 -7.50854492 -4.04595947 -5.53150024 0.96551514\n", + " 1.33233643]\n", + "score for next parameter: -0.9444849050731404 \n", + "\n", + "iteration 26 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 8.97756801 -3.35099037 5.00761608 -8.45276339 -5.84574241 0.88054979\n", + " 1.30676987]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 27 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [62.17449951 -1.18572388 -9.16137695 -2.86712646 -5.99603882 0.91524658\n", + " 2.28265381]\n", + "score for next parameter: -0.7987501433321866 \n", + "\n", + "iteration 28 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [24.97840402 -4.09657569 -3.3203752 -9.48069362 -2.14510979 0.83312004\n", + " 2.0846341 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 29 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [59.80633545 -0.66140747 -1.1340332 -7.4989624 -5.6215271 0.98966064\n", + " 2.684021 ]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 30 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [40.53244019 -0.93130798 -4.2791748 -5.25253296 -4.82118835 0.96725464\n", + " 3.01956177]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 31 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [46.86727905 -0.76493835 -7.10388184 -7.4069519 -4.54966736 0.95946655\n", + " 2.98696899]\n", + "score for next parameter: -0.9529411764705884 \n", + "\n", + "iteration 32 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [12.68283081 -0.62017517 -2.5213623 -5.83261108 -4.67138367 0.99733276\n", + " 2.55667114]\n", + "score for next parameter: -0.9515316886988714 \n", + "\n", + "iteration 33 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [63.23129272 -0.64250183 -3.8079834 -5.1635437 -4.79021912 0.95404663\n", + " 1.83633423]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 34 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [68.85611999 -1.0064982 -6.12318616 -4.2177702 -3.82647124 0.8896449\n", + " 3.99534442]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 35 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [28.30957421 -5.06259382 -8.09861429 -9.34766392 -1.41627948 0.83583128\n", + " 1.66314507]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 36 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [69.82824076 -3.88455314 -6.66694252 -3.2741885 -2.79463632 0.85075364\n", + " 1.9297718 ]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 37 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [38.40997314 -1.0366394 -3.85620117 -6.58599854 -3.91245728 0.97196045\n", + " 3.08721924]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 38 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [57.55570745 -5.98347499 -9.89074106 -5.24899638 -5.85711424 0.87713217\n", + " 1.99379545]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 39 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [81.18197632 -0.27663269 -6.16149902 -4.62301636 -4.57991638 0.9730896\n", + " 1.27236938]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 40 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [64.29696655 -0.2579071 6.48986816 -7.8991394 -4.78013611 0.93602905\n", + " 3.29165649]\n", + "score for next parameter: -0.8436483668836612 \n", + "\n", + "iteration 41 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [50.8193283 -3.05975379 -6.27466769 -6.83094636 -3.91334651 0.89702417\n", + " 2.40270554]\n", + "score for next parameter: -0.17575757575757572 \n", + "\n", + "iteration 42 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [45.50558472 -0.87657166 -3.21472168 -5.60848999 -4.03471375 0.95407104\n", + " 2.70755005]\n", + "score for next parameter: -0.9434127803168051 \n", + "\n", + "iteration 43 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [ 3.7153757 -0.54264509 -7.58613214 -5.06055548 -0.84674669 0.86606726\n", + " 2.55714102]\n", + "score for next parameter: -0.583122507122507 \n", + "\n", + "iteration 44 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [16.06723322 -1.88451362 -2.99815455 -5.95832332 -5.56295557 0.86632232\n", + " 1.36581272]\n", + "score for next parameter: -0.9252168883747831 \n", + "\n", + "iteration 45 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [89.00908248 -0.9280715 7.76992743 -8.53901055 -0.27853035 0.96162671\n", + " 1.84533372]\n", + "score for next parameter: -0.6223212343212342 \n", + "\n", + "iteration 46 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [77.72149658 -0.47775269 2.72583008 -5.90924072 -4.90923462 0.96629639\n", + " 2.02374268]\n", + "score for next parameter: -0.927004477004477 \n", + "\n", + "iteration 47 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [85.23745728 -0.71920471 -5.65979004 -5.46401978 -3.85934143 0.93279419\n", + " 1.7482605 ]\n", + "score for next parameter: -0.9599498746867168 \n", + "\n", + "iteration 48 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [15.45358276 -0.13763123 -2.24304199 -3.9012146 -2.59860535 0.98849487\n", + " 3.08181763]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "iteration 49 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [33.37298024 -1.53918059 -7.67205338 -2.09071315 -3.16740687 0.84715434\n", + " 2.65307455]\n", + "score for next parameter: -0.827206273258905 \n", + "\n", + "iteration 50 -----\n", + "current minimum: [16.03674316 -0.77052002 -5.91552734 -4.45739746 -5.30499268 0.9630127\n", + " 3.0592041 ]\n", + "current minimum score: -0.9763060428849902\n", + "next parameter: [67.97058105 -0.72010498 -1.48681641 -5.10998535 -5.40438232 0.94821777\n", + " 3.71325684]\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "Global iteration #3 -----\n", + "current minimum: [63.15136719 -0.87783203 -0.72265625 -9.97363281 -5.37197266 0.89238281\n", + " 3.55175781]\n", + "current minimum score: -0.9763060428849902\n", + "score for next parameter: -0.9763060428849902 \n", + "\n", + "{'parameters': DescribeResult(best_params=array([63.15136719, -0.87783203, -0.72265625, -9.97363281, -5.37197266,\n", + " 0.89238281, 3.55175781]), best_score=-0.9763060428849902, best_surrogate=CustomRegressor(obj=BaggingRegressor(), replications=150, type_pi='bootstrap')), 'opt_object': }\n", + " |======================================================================| 100%\n", + "\n", + "\n", + " Test set accuracy: 0.9666666666666667\n", + "\n", + " Elapsed: 2256.0045511722565\n" + ] + } + ], + "source": [ + "start = time()\n", + "for elt in datasets:\n", + "\n", + " dataset = elt()\n", + " X = dataset.data\n", + " y = dataset.target\n", + "\n", + " # split data into training test and test set\n", + " X_train, X_test, y_train, y_test = train_test_split(X, y,\n", + " test_size=0.2, random_state=3137)\n", + "\n", + " # hyperparams tuning\n", + " res1 = optimize_bcn2(X_train, y_train)\n", + " print(res1)\n", + " parameters = res1[\"parameters\"]\n", + "\n", + " estimator = bcn.BCNClassifier(B=int(parameters[0][0]),\n", + " nu=10**parameters[0][1],\n", + " lam=10**parameters[0][2],\n", + " r=1-10**parameters[0][3],\n", + " tol=10**parameters[0][4],\n", + " col_sample=np.ceil(parameters[0][5]),\n", + " n_clusters=np.ceil(parameters[0][6]),\n", + " activation=\"tanh\",\n", + " type_optim=\"nlminb\").fit(X_train, y_train)\n", + " print(f\"\\n\\n Test set accuracy: {estimator.score(X_test, y_test)}\")\n", + " print(f\"\\n Elapsed: {time() - start}\")" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/GPopt/tests/tests_gpopt.py b/GPopt/tests/tests_gpopt.py index baca642..4e6db4d 100644 --- a/GPopt/tests/tests_gpopt.py +++ b/GPopt/tests/tests_gpopt.py @@ -20,7 +20,7 @@ def braninsc(x): x2_bar = 15 * x[1] term1 = ( x2_bar - - (5.1 / (4 * np.pi ** 2)) * x1_bar ** 2 + - (5.1 / (4 * np.pi**2)) * x1_bar**2 + (5 / np.pi) * x1_bar - 6 ) ** 2 @@ -62,7 +62,7 @@ def braninsc(x): x2_bar = 15 * x[1] term1 = ( x2_bar - - (5.1 / (4 * np.pi ** 2)) * x1_bar ** 2 + - (5.1 / (4 * np.pi**2)) * x1_bar**2 + (5 / np.pi) * x1_bar - 6 ) ** 2 @@ -115,7 +115,7 @@ def braninsc(x): x2_bar = 15 * x[1] term1 = ( x2_bar - - (5.1 / (4 * np.pi ** 2)) * x1_bar ** 2 + - (5.1 / (4 * np.pi**2)) * x1_bar**2 + (5 / np.pi) * x1_bar - 6 ) ** 2 diff --git a/GPopt/utils/sobol_lib.py b/GPopt/utils/sobol_lib.py index 8a62f6c..765627a 100644 --- a/GPopt/utils/sobol_lib.py +++ b/GPopt/utils/sobol_lib.py @@ -14698,7 +14698,7 @@ def i4_sobol(dim_num, seed): 16375, 16381, ] - atmost = 2 ** log_max - 1 + atmost = 2**log_max - 1 # # Find the number of bits in ATMOST. # diff --git a/Makefile b/Makefile index 8d83a2c..94e0d09 100644 --- a/Makefile +++ b/Makefile @@ -53,13 +53,17 @@ coverage: ## check code coverage quickly with the default Python coverage html $(BROWSER) htmlcov/index.html -docs: install ## generate docs - pip install pdoc --ignore-installed - pdoc GPopt/GPOpt/* --output-dir gpopt-docs +docs: install ## generate docs + pip install black pdoc + black GPopt/* --line-length=80 + pdoc -t docs GPopt/* --output-dir gpopt-docs + find . -name '__pycache__' -exec rm -fr {} + -servedocs: install ## compile the docs watching for change - pip install pdoc --ignore-installed - pdoc GPopt/GPOpt/* +servedocs: install ## compile the docs watching for change + pip install black pdoc + black GPopt/* --line-length=80 + pdoc -t docs GPopt/* + find . -name '__pycache__' -exec rm -fr {} + release: dist ## package and upload a release pip install twine --ignore-installed diff --git a/docs/.DS_Store b/docs/.DS_Store deleted file mode 100644 index 14ec311..0000000 Binary files a/docs/.DS_Store and /dev/null differ diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 09806c6..0000000 --- a/docs/Makefile +++ /dev/null @@ -1,230 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) - $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " epub3 to make an epub3" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - @echo " dummy to check syntax errors of document sources" - -.PHONY: clean -clean: - rm -rf $(BUILDDIR)/* - -.PHONY: html -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -.PHONY: dirhtml -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -.PHONY: singlehtml -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -.PHONY: pickle -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -.PHONY: json -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -.PHONY: htmlhelp -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -.PHONY: qthelp -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/twitterpandas.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/twitterpandas.qhc" - -.PHONY: applehelp -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -.PHONY: devhelp -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/twitterpandas" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/twitterpandas" - @echo "# devhelp" - -.PHONY: epub -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -.PHONY: epub3 -epub3: - $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 - @echo - @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." - -.PHONY: latex -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -.PHONY: latexpdf -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: latexpdfja -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: text -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -.PHONY: man -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -.PHONY: texinfo -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -.PHONY: info -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -.PHONY: gettext -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -.PHONY: changes -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -.PHONY: doctest -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -.PHONY: coverage -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -.PHONY: xml -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -.PHONY: pseudoxml -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." - -.PHONY: dummy -dummy: - $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy - @echo - @echo "Build finished. Dummy builder generates no files." diff --git a/docs/autogen.py b/docs/autogen.py deleted file mode 100644 index 9b00116..0000000 --- a/docs/autogen.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -import pathlib -import shutil -import keras_autodoc - -PAGES = { - 'documentation/gpopt.md': [ - 'GPopt.GPOpt.GPOpt.GPOpt', - 'GPopt.GPOpt.GPOpt.GPOpt.optimize', - 'GPopt.GPOpt.GPOpt.GPOpt.load', - 'GPopt.GPOpt.GPOpt.GPOpt.close_shelve' - ] -} - -GPopt_dir = pathlib.Path(__file__).resolve().parents[1] - - -def generate(dest_dir): - template_dir = GPopt_dir / 'docs' / 'templates' - - doc_generator = keras_autodoc.DocumentationGenerator( - pages = PAGES, - project_url = 'https://github.com/Techtonique/GPopt/blob/main', - template_dir = template_dir, - #GPopt_dir / 'examples' - ) - doc_generator.generate(dest_dir) - - readme = (GPopt_dir / 'README.md').read_text() - index = (template_dir / 'index.md').read_text() - index = index.replace('{{autogenerated}}', readme[readme.find('##'):]) - (dest_dir / 'index.md').write_text(index, encoding='utf-8') - shutil.copyfile(GPopt_dir / 'CONTRIBUTING.md', - dest_dir / 'contributing.md') - #shutil.copyfile(GPopt_dir / 'docs' / 'extra.css', - # dest_dir / 'extra.css') - - -if __name__ == '__main__': - generate(GPopt_dir / 'docs' / 'sources') \ No newline at end of file diff --git a/docs/error.html.jinja2 b/docs/error.html.jinja2 new file mode 100644 index 0000000..6ffdb5d --- /dev/null +++ b/docs/error.html.jinja2 @@ -0,0 +1,38 @@ +{# this template is used by pdoc's integrated web server to display runtime errors. #} +{% extends "frame.html.jinja2" %} +{% block title %}{{ error }}{% endblock %} +{% block style %} + + +{% endblock %} +{% block body %} +

{{ error }}

+
{{ details }}
+
+ +{% endblock %} diff --git a/docs/frame.html.jinja2 b/docs/frame.html.jinja2 new file mode 100644 index 0000000..2f50eea --- /dev/null +++ b/docs/frame.html.jinja2 @@ -0,0 +1,47 @@ + + + + + + + {% block title %}{% endblock %} + {% block favicon %} + {% if favicon %} + + {% endif %} + {% endblock %} + {% block head %}{% endblock %} + {% filter minify_css | indent %} + {% block style %} + + + + {# + The style_pdoc, style_theme, style_layout, and style_content Jinja2 blocks are deprecated and will be + removed in a future release. Custom templates should either provide alternatives for the specific CSS files, + or append their own styles by providing `custom.css` (see examples/custom-template/). + #} + {% block style_pdoc %} + {% block style_theme %}{% endblock %} + {% block style_syntax %}{% endblock %} + {% block style_layout %}{% endblock %} + {% block style_content %}{% endblock %} + {# Use this file in your custom template directory to add additional CSS styling: #} + + {% endblock %} + {% endblock %} + {% endfilter %} + {% if math %}{% include "math.html.jinja2" %}{% endif %} + {% if mermaid %}{% include "mermaid.html.jinja2" %}{% endif %} + + +{% block body %} + + {% block content %}{% endblock %} +{% endblock body %} + + diff --git a/docs/index.html.jinja2 b/docs/index.html.jinja2 new file mode 100644 index 0000000..ffc615f --- /dev/null +++ b/docs/index.html.jinja2 @@ -0,0 +1,75 @@ +{# this template is used to render the top-level index.html. #} +{% if root_module_name %} +{# +If there is one common parent module for all documented modules, redirect there immediately. +This makes a package's `__init__.py` the main entrypoint by default. +A custom template could override this by setting root_module_name to false before `{% extend ... %}`. +#} + + + + + + + +{% else %} +{% extends "frame.html.jinja2" %} +{% block title %}Module List – pdoc {{ __version__ }}{% endblock %} +{% block style %} + {{ super() | safe }} + +{% endblock %} +{% block nav %} +

Available Modules

+
    + {% for submodule in all_modules if "._" not in submodule and not submodule.startswith("_") %} +
  • {{ submodule }}
  • + {% endfor %} +
+{% endblock %} +{% block content %} +
+ {% block logo %} + {% if logo %} + {% set logo_link = "https://github.com/thierrymoudiki/thierrymoudiki.github.io/blob/master/images/t-logo2.png" %} + {% if logo_link %}{% endif %} + project logo + {% if logo_link %}{% endif %} + {% else %} + + pdoc + + {% endif %} + {% endblock %} + {% if search %} + + {% endif %} +
+
+ {% if search %} + {% include "search.html.jinja2" %} + {% endif %} +{% endblock %} +{% endif %} diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 509abe3..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,281 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. epub3 to make an epub3 - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - echo. dummy to check syntax errors of document sources - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 1>NUL 2>NUL -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\twitterpandas.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\twitterpandas.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "epub3" ( - %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -if "%1" == "dummy" ( - %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. Dummy builder generates no files. - goto end -) - -:end diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml deleted file mode 100644 index d6cfd09..0000000 --- a/docs/mkdocs.yml +++ /dev/null @@ -1,21 +0,0 @@ -site_name: Techtonique/GPopt -theme: - name: darkly # sandstone # slate # lux # darkly - nav_style: dark - #name: null - #custom_dir: 'custom_theme/' - -google_analytics: ['UA-146345113-2', 'https://techtonique.github.io/gpopt/'] - -docs_dir: sources -# repo_url: https://github.com/Techtonique/GPopt -edit_uri: "" -site_description: 'Documentation for GPopt.' - -nav: - - Home: index.md - - Documentation: - - GPopt: documentation/gpopt.md - - Contributing: CONTRIBUTING.md - - License: LICENSE.md - - Techtonique: ../ \ No newline at end of file diff --git a/docs/module.html.jinja2 b/docs/module.html.jinja2 new file mode 100644 index 0000000..cb7ef5d --- /dev/null +++ b/docs/module.html.jinja2 @@ -0,0 +1,304 @@ +{% extends "frame.html.jinja2" %} +{% block title %}{{ module.modulename }} API documentation{% endblock %} +{% block nav %} + {% block module_list_link %} + {% set parentmodule = ".".join(module.modulename.split(".")[:-1]) %} + {% if parentmodule and parentmodule in all_modules %} + + {% include "resources/box-arrow-in-left.svg" %} +   + {{- parentmodule -}} + + {% elif not root_module_name %} + + {% include "resources/box-arrow-in-left.svg" %} +   + Module Index + + {% endif %} + {% endblock %} + + {% block nav_title %} + {% if logo %} + {% set logo_link = "https://github.com/thierrymoudiki/thierrymoudiki.github.io/blob/master/images/t-logo2.png" %} + {% if logo_link %}{% endif %} + + {% if logo_link %}{% endif %} + {% endif %} + {% endblock %} + + {% block search_box %} + {% if search and all_modules|length > 1 %} + {# we set a pattern here so that we can use the :valid CSS selector #} + + {% endif %} + {% endblock %} + + {% block nav_index %} + {% set index = module.docstring | to_markdown | to_html | attr("toc_html") %} + {% if index %} +

Contents

+ {{ index | safe }} + {% endif %} + {% endblock %} + + {% block nav_submodules %} + {% if module.submodules %} +

Submodules

+
    + {% for submodule in module.submodules if is_public(submodule) | trim %} +
  • {{ submodule.taken_from | link(text=submodule.name) }}
  • + {% endfor %} +
+ {% endif %} + {% endblock %} + + {% block nav_members %} + {% if module.members %} +

API Documentation

+ {{ nav_members(module.members.values()) }} + {% endif %} + {% endblock %} + + {% block nav_footer %} + {% if footer_text %} +
{{ footer_text }}
+ {% endif %} + {% endblock %} + + {% block attribution %} + + built with pdocpdoc logo + + {% endblock %} +{% endblock nav %} +{% block content %} +
+ {% block module_info %} +
+ {% block edit_button %} + {% if edit_url %} + {% if "github.com" in edit_url %} + {% set edit_text = "Edit on GitHub" %} + {% elif "gitlab" in edit_url %} + {% set edit_text = "Edit on GitLab" %} + {% else %} + {% set edit_text = "Edit Source" %} + {% endif %} + {{ edit_text }} + {% endif %} + {% endblock %} + {{ module_name() }} + {{ docstring(module) }} + {{ view_source_state(module) }} + {{ view_source_button(module) }} + {{ view_source_code(module) }} +
+ {% endblock %} + {% block module_contents %} + {% for m in module.flattened_own_members if is_public(m) | trim %} +
+ {{ member(m) }} + {% if m.kind == "class" %} + {% for m in m.own_members if m.kind != "class" and is_public(m) | trim %} + {% if (m.name in ["fit", "predict", "predict_proba", "score", "create_layer", "cook_training_set", "cook_test_set", "encode_clusters", "subsample", "download", "provide_models"]) %} +
+ {{ member(m) }} +
+ {% endif %} + {% endfor %} + {% endif %} +
+ {% endfor %} + {% endblock %} +
+ {% if mtime %} + {% include "livereload.html.jinja2" %} + {% endif %} + {% block search_js %} + {% if search and all_modules|length > 1 %} + {% include "search.html.jinja2" %} + {% endif %} + {% endblock %} +{% endblock content %} +{# +End of content, beginning of helper macros. +See https://pdoc.dev/docs/pdoc/render_helpers.html#DefaultMacroExtension for an explanation of defaultmacro. +#} +{% defaultmacro bases(cls) %} + {%- if cls.bases -%} + ( + {%- for base in cls.bases -%} + {{ base[:2] | link(text=base[2]) }} + {%- if loop.nextitem %}, {% endif %} + {%- endfor -%} + ) + {%- endif -%} +{% enddefaultmacro %} +{% defaultmacro default_value(var) -%} + {%- if var.default_value_str %} + = + {% if var.default_value_str | length > 100 -%} + + + {%- endif -%} + {{ var.default_value_str | escape | linkify }} + {%- endif -%} +{% enddefaultmacro %} +{% defaultmacro annotation(var) %} + {%- if var.annotation_str -%} + {{ var.annotation_str | escape | linkify }} + {%- endif -%} +{% enddefaultmacro %} +{% defaultmacro decorators(doc) %} + {% for d in doc.decorators if not d.startswith("@_") %} +
{{ d }}
+ {% endfor %} +{% enddefaultmacro %} +{% defaultmacro function(fn) -%} + {{ decorators(fn) }} + {% if fn.name == "__init__" %} + {{ ".".join(fn.qualname.split(".")[:-1]) }} + {{- fn.signature_without_self | format_signature(colon=False) | linkify }} + {% else %} + {{ fn.funcdef }} + {{ fn.name }} + {{- fn.signature | format_signature(colon=True) | linkify }} + {% endif %} +{% enddefaultmacro %} +{% defaultmacro variable(var) -%} + {%- if var.is_type_alias_type %}type {% endif -%} + {{ var.name }}{{ annotation(var) }}{{ default_value(var) }} +{% enddefaultmacro %} +{% defaultmacro submodule(mod) -%} + {{ mod.taken_from | link }} +{% enddefaultmacro %} +{% defaultmacro class(cls) -%} + {{ decorators(cls) }} + class + {{ cls.qualname }} + {{- bases(cls) -}}: +{% enddefaultmacro %} +{% defaultmacro member(doc) %} + {{- view_source_state(doc) -}} +
+ {% if doc.kind == "class" %} + {{ class(doc) }} + {% elif doc.kind == "function" %} + {{ function(doc) }} + {% elif doc.kind == "module" %} + {{ submodule(doc) }} + {% else %} + {{ variable(doc) }} + {% endif %} + {{ view_source_button(doc) }} +
+ + {{ view_source_code(doc) }} + {{ docstring(doc) }} +{% enddefaultmacro %} +{% defaultmacro docstring(var) %} + {% if var.docstring %} +
{{ var.docstring | replace("@public", "") | to_markdown | to_html | linkify(namespace=var.qualname) }}
+ {% endif %} +{% enddefaultmacro %} +{% defaultmacro nav_members(members) %} +
    + {% for m in members if is_public(m) | trim %} +
  • + {% if m.kind == "class" %} + {{ m.qualname }} + {% if m.own_members %} + {{ nav_members(m.own_members) | indent(12) }} + {% endif %} + {% endif %} +
  • + {% endfor %} +
+{% enddefaultmacro %} +{% defaultmacro is_public(doc) %} + {# + This macro is a bit unconventional in that its output is not rendered, but treated as a boolean: + Returning no text is interpreted as false, returning any other text is iterpreted as true. + Implementing this as a macro makes it very easy to override with a custom template, see + https://github.com/mitmproxy/pdoc/tree/main/examples/custom-template. + #} + {% if "@private" in doc.docstring %} + {# hide members explicitly marked as @private #} + {% elif "@public" in doc.docstring %} + {# show members explicitly marked as @public #} + true + {% elif not include_undocumented and not doc.docstring %} + {# hide members that are undocumented if include_undocumented has been toggled off. #} + {% elif doc.name == "__init__" and (doc.docstring or (doc.kind == "function" and doc.signature_without_self.parameters)) %} + {# show constructors that have a docstring or at least one extra argument #} + true + {% elif doc.name == "__doc__" %} + {# We don't want to document __doc__ itself, https://github.com/mitmproxy/pdoc/issues/235 #} + {% elif doc.kind == "variable" and doc.is_typevar and not doc.docstring %} + {# do not document TypeVars, that only clutters the docs. #} + {% elif doc.kind == "module" and doc.fullname not in all_modules %} + {# Skip modules that were manually excluded, https://github.com/mitmproxy/pdoc/issues/334 #} + {% elif (doc.qualname or doc.name) is in(module.obj.__all__ or []) %} + {# members starting with an underscore are still public if mentioned in __all__ #} + true + {% elif not doc.name.startswith("_") %} + {# members not starting with an underscore are considered public by default #} + true + {% endif %} +{% enddefaultmacro %} +{# fmt: off #} +{% defaultmacro inherited(cls) %} + {% for base, members in cls.inherited_members.items() %} + {% set m = None %}{# workaround for https://github.com/pallets/jinja/issues/1427 #} + {% set member_html %} + {% for m in members if is_public(m) | trim %} +
+ {{- m.taken_from | link(text=m.name.replace("__init__",base[1])) -}} +
+ {% endfor %} + {% endset %} + {# we may not have any public members, in which case we don't want to print anything. #} + {% if member_html %} +
{{ base | link }}
+ {{ member_html }} +
+ {% endif %} + {% endfor %} +{% enddefaultmacro %} +{# fmt: on #} +{% defaultmacro view_source_state(doc) %} + {% if show_source and doc.source %} + + {% endif %} +{% enddefaultmacro %} +{% defaultmacro view_source_button(doc) %} + {% if show_source and doc.source %} + + {% endif %} +{% enddefaultmacro %} +{% defaultmacro view_source_code(doc) %} + {% if show_source and doc.source %} + {{ doc | highlight }} + {% endif %} +{% enddefaultmacro %} +{% defaultmacro module_name() %} +

+ {% set parts = module.modulename.split(".") %} + {% for part in parts %} + {%- set fullname = ".".join(parts[:loop.index]) -%} + {%- if fullname in all_modules and fullname != module.modulename -%} + {{ part }} + {%- else -%} + {{ part }} + {%- endif -%} + {%- if loop.nextitem -%} + . + {%- endif -%} + {% endfor %} +

+{% enddefaultmacro %} diff --git a/docs/site/404.html b/docs/site/404.html deleted file mode 100644 index 2459631..0000000 --- a/docs/site/404.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - Techtonique/GPopt - - - - - - - - - - - - -
-
- -
-
-

404

-

Page not found

-
-
- - -
-
- -
-
-

Documentation built with MkDocs.

-
- - - - - - - - - - diff --git a/docs/site/CONTRIBUTING/index.html b/docs/site/CONTRIBUTING/index.html deleted file mode 100644 index 8729333..0000000 --- a/docs/site/CONTRIBUTING/index.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - Contributing - Techtonique/GPopt - - - - - - - - - - - - -
-
- -
- -

GPopt's Code of Conduct

-

1. Purpose

-

A primary goal of this project is to be inclusive to the largest number of contributors, and most importantly with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion, or lack of religion thereof.

-

This code of conduct outlines our expectations for all those who participate to the project, as well as the consequences for unacceptable behavior.

-

We invite all those who participate in, to help us create safe and positive experiences for everyone.

-

2. Open [Source/Culture/Tech] Citizenship

-

A supplemental goal of this Code of Conduct is to encourage participants to recognize and strengthen the relationships between our actions and their effects on other participants.

-

Communities mirror the societies in which they exist, and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.

-

3. Expected Behavior

-

The following behaviors are expected and requested of all contributors:

-
    -
  • Attempt collaboration before conflict.
  • -
  • Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this project.
  • -
  • Exercise consideration and respect in your speech and actions.
  • -
  • Refrain from demeaning, discriminatory, or harassing behavior and speech.
  • -
  • Be mindful of your surroundings and of your fellow participants.
  • -
-

4. Unacceptable Behavior

-

The following behaviors are considered harassment and are unacceptable:

-
    -
  • Violence, threats of violence or violent language directed against another person.
  • -
  • Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
  • -
  • Posting or displaying sexually explicit or violent material.
  • -
  • Posting or threatening to post other people's personally identifying information ("doxing").
  • -
  • Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
  • -
  • Inappropriate photography or recording.
  • -
  • Unwelcome sexual attention. This includes, sexualized comments or jokes.
  • -
  • Deliberate intimidation, stalking or following (online or in person).
  • -
  • Advocating for, or encouraging, any of the above behavior.
  • -
-

5. Consequences of Unacceptable Behavior

-

Unacceptable behavior from any contributor will not be tolerated.

-

Anyone asked to stop unacceptable behavior is expected to comply immediately.

-

If a contributor engages in unacceptable behavior, appropriate action will be taken, up to and including a temporary ban or permanent expulsion without warning.

-

6. Scope

-

We expect all contributors to abide by this Code of Conduct in all venues, online and in-person.

-

7. Contact info

-

thierry.moudiki AT gmail.com

-

8. License and attribution

-

Portions of text derived from the Citizen Code of Conduct.

-
-
- -
-
-

Documentation built with MkDocs.

-
- - - - - - - - - - diff --git a/docs/site/LICENSE/index.html b/docs/site/LICENSE/index.html deleted file mode 100644 index 0af4e71..0000000 --- a/docs/site/LICENSE/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - License - Techtonique/GPopt - - - - - - - - - - - - -
-
-
-
- -

The Clear BSD License

-

Copyright (c) [2019] [Thierry Moudiki] -All rights reserved.

-

Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the disclaimer -below) provided that the following conditions are met:

-
 * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- * Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY -THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.

-
-
- -
-
-

Documentation built with MkDocs.

-
- - - - - - - - - - diff --git a/docs/site/css/base.css b/docs/site/css/base.css deleted file mode 100644 index 5ea2fd0..0000000 --- a/docs/site/css/base.css +++ /dev/null @@ -1,270 +0,0 @@ -html { - /* The nav header is 4.40625rem high, plus 20px for the margin-top of the - main container. */ - scroll-padding-top: calc(4.40625rem + 20px); -} - -body > .container { - margin-top: 20px; -} - -.navbar.fixed-top { - position: -webkit-sticky; - position: sticky; -} - -.source-links { - float: right; -} - -.col-md-9 img { - max-width: 100%; -} - -pre, code { - background: #444; - color: #e0e2e4; - border: 1px solid rgba(0,0,0,0.125); - border-radius: 0.25rem; -} - -pre { - padding: 0.5em; -} - -code { - padding: 1px 3px; -} - -pre code { - border: none; - /* Override styles from hljs theme */ - background: transparent !important; - padding: 0 !important; -} - -a code { - color: #00bc8c; -} - -a:hover code { - color: #007053; -} - -kbd { - padding: 2px 4px; - font-size: 90%; - color: #fff; - background-color: #333; - border-radius: 3px; - -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); - box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); -} - -footer { - margin-top: 30px; - margin-bottom: 10px; - text-align: center; - font-weight: 200; -} - -.modal-dialog { - margin-top: 60px; -} - -/* Style the admonitions. */ - -.admonition { - margin-bottom: 1rem; - border: 1px solid rgba(0, 0, 0, 0.125); - border-radius: 0.25rem; - color: #fff; -} - -.admonition > .admonition-title { - margin: 0; - padding: 0.75rem 1rem; - background: #444; - border-bottom: 1px solid rgba(0, 0, 0, 0.125); - border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; - font-size: 1rem; -} - -.admonition > * { - margin-left: 1rem; - margin-right: 1rem; -} - -.admonition > *:not(.admonition-title):first-of-type, -.admonition > .admonition-title + * { - margin-top: 1rem; -} - -.admonition > *:last-child { - margin-bottom: 1rem; -} - -/* Style each kind of admonition. */ - -.admonition.note, .admonition.note > .admonition-title { - border-color: #304f6f; -} - -.admonition.note > .admonition-title { - background: #375a7f; -} - -.admonition.warning, .admonition.warning > .admonition-title { - border-color: #d58910; -} - -.admonition.warning > .admonition-title { - background: #f39c12; -} - -.admonition.danger, .admonition.danger > .admonition-title { - border-color: #ca4335; -} - -.admonition.danger > .admonition-title { - background: #e74c3c; -} - -/* - * Side navigation - * - * Scrollspy and affixed enhanced navigation to highlight sections and secondary - * sections of docs content. - */ - -.bs-sidebar.affix { - position: -webkit-sticky; - position: sticky; - /* The nav header is 4.40625rem high, plus 20px for the margin-top of the - main container. */ - top: calc(4.40625rem + 20px); -} - -.bs-sidebar.card { - padding: 0; -} - -/* Toggle (vertically flip) sidebar collapse icon */ -.bs-sidebar .navbar-toggler span { - -moz-transform: scale(1, -1); - -webkit-transform: scale(1, -1); - -o-transform: scale(1, -1); - -ms-transform: scale(1, -1); - transform: scale(1, -1); -} - -.bs-sidebar .navbar-toggler.collapsed span { - -moz-transform: scale(1, 1); - -webkit-transform: scale(1, 1); - -o-transform: scale(1, 1); - -ms-transform: scale(1, 1); - transform: scale(1, 1); -} - -/* First level of nav */ -.bs-sidebar > .navbar-collapse > .nav { - padding-top: 10px; - padding-bottom: 10px; - border-radius: 5px; - width: 100%; -} - -/* All levels of nav */ -.bs-sidebar .nav > li > a { - display: block; - padding: 5px 20px; - z-index: 1; -} -.bs-sidebar .nav > li > a:hover, -.bs-sidebar .nav > li > a:focus { - text-decoration: none; - border-right: 1px solid; -} -.bs-sidebar .nav > li > a.active, -.bs-sidebar .nav > li > a.active:hover, -.bs-sidebar .nav > li > a.active:focus { - font-weight: bold; - background-color: transparent; - border-right: 1px solid; -} - -.bs-sidebar .nav .nav .nav { - margin-left: 1em; -} - -.bs-sidebar .nav > li > a { - font-weight: bold; -} - -.bs-sidebar .nav .nav > li > a { - font-weight: normal; -} - -.headerlink { - display: none; - padding-left: .5em; -} - -h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink, h4:hover .headerlink, h5:hover .headerlink, h6:hover .headerlink{ - display:inline-block; -} - -@media (max-width: 991.98px) { - .navbar-collapse.show { - overflow-y: auto; - max-height: calc(100vh - 4.40625rem); - } -} - -.dropdown-item.open { - color: #fff; - background-color: #375a7f; -} - -.dropdown-submenu > .dropdown-menu { - margin: 0 0 0 1.5rem; - padding: 0; - border-width: 0; -} - -.dropdown-submenu > a::after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #ccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover > a::after { - border-left-color: #404040; -} - -@media (min-width: 992px) { - .dropdown-menu { - overflow-y: auto; - max-height: calc(100vh - 4.40625rem); - } - - .dropdown-submenu { - position: relative; - } - - .dropdown-submenu > .dropdown-menu { - position: fixed !important; - margin-top: -9px; - margin-left: -2px; - border-width: 1px; - padding: 0.5rem 0; - } -} diff --git a/docs/site/css/bootstrap.min.css b/docs/site/css/bootstrap.min.css deleted file mode 100644 index 287e4b7..0000000 --- a/docs/site/css/bootstrap.min.css +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * Bootswatch v4.4.1 - * Homepage: https://bootswatch.com - * Copyright 2012-2019 Thomas Park - * Licensed under MIT - * Based on Bootstrap -*//*! - * Bootstrap v4.4.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors - * Copyright 2011-2019 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");:root{--blue: #375a7f;--indigo: #6610f2;--purple: #6f42c1;--pink: #e83e8c;--red: #E74C3C;--orange: #fd7e14;--yellow: #F39C12;--green: #00bc8c;--teal: #20c997;--cyan: #3498DB;--white: #fff;--gray: #999;--gray-dark: #303030;--primary: #375a7f;--secondary: #444;--success: #00bc8c;--info: #3498DB;--warning: #F39C12;--danger: #E74C3C;--light: #999;--dark: #303030;--breakpoint-xs: 0;--breakpoint-sm: 576px;--breakpoint-md: 768px;--breakpoint-lg: 992px;--breakpoint-xl: 1200px;--font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:0.9375rem;font-weight:400;line-height:1.5;color:#fff;text-align:left;background-color:#222}[tabindex="-1"]:focus:not(:focus-visible){outline:0 !important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0.5rem}p{margin-top:0;margin-bottom:1rem}abbr[title],abbr[data-original-title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#00bc8c;text-decoration:none;background-color:transparent}a:hover{color:#007053;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}pre,code,kbd,samp{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:0.75rem;padding-bottom:0.75rem;color:#999;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:0.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button:not(:disabled),[type="button"]:not(:disabled),[type="reset"]:not(:disabled),[type="submit"]:not(:disabled){cursor:pointer}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{padding:0;border-style:none}input[type="radio"],input[type="checkbox"]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{outline-offset:-2px;-webkit-appearance:none}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none !important}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{margin-bottom:0.5rem;font-weight:500;line-height:1.2}h1,.h1{font-size:3rem}h2,.h2{font-size:2.5rem}h3,.h3{font-size:2rem}h4,.h4{font-size:1.40625rem}h5,.h5{font-size:1.171875rem}h6,.h6{font-size:0.9375rem}.lead{font-size:1.171875rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,0.1)}small,.small{font-size:80%;font-weight:400}mark,.mark{padding:0.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:0.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.171875rem}.blockquote-footer{display:block;font-size:80%;color:#999}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:0.25rem;background-color:#222;border:1px solid #dee2e6;border-radius:0.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:0.5rem;line-height:1}.figure-caption{font-size:90%;color:#999}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:0.2rem 0.4rem;font-size:87.5%;color:#fff;background-color:#222;border-radius:0.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:inherit}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width: 576px){.container{max-width:540px}}@media (min-width: 768px){.container{max-width:720px}}@media (min-width: 992px){.container{max-width:960px}}@media (min-width: 1200px){.container{max-width:1140px}}.container-fluid,.container-sm,.container-md,.container-lg,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width: 576px){.container,.container-sm{max-width:540px}}@media (min-width: 768px){.container,.container-sm,.container-md{max-width:720px}}@media (min-width: 992px){.container,.container-sm,.container-md,.container-lg{max-width:960px}}@media (min-width: 1200px){.container,.container-sm,.container-md,.container-lg,.container-xl{max-width:1140px}}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*="col-"]{padding-right:0;padding-left:0}.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col,.col-auto,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm,.col-sm-auto,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md,.col-md-auto,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg,.col-lg-auto,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-1>*{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-4>*{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-webkit-box-flex:0;-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}@media (min-width: 576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-sm-1>*{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-sm-4>*{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-webkit-box-flex:0;-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}}@media (min-width: 768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-md-1>*{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-md-4>*{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-webkit-box-flex:0;-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}}@media (min-width: 992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-lg-1>*{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-lg-4>*{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-webkit-box-flex:0;-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}}@media (min-width: 1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.row-cols-xl-1>*{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.row-cols-xl-4>*{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-webkit-box-flex:0;-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}}.table{width:100%;margin-bottom:1rem;color:#fff}.table th,.table td{padding:0.75rem;vertical-align:top;border-top:1px solid #444}.table thead th{vertical-align:bottom;border-bottom:2px solid #444}.table tbody+tbody{border-top:2px solid #444}.table-sm th,.table-sm td{padding:0.3rem}.table-bordered{border:1px solid #444}.table-bordered th,.table-bordered td{border:1px solid #444}.table-bordered thead th,.table-bordered thead td{border-bottom-width:2px}.table-borderless th,.table-borderless td,.table-borderless thead th,.table-borderless tbody+tbody{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:#303030}.table-hover tbody tr:hover{color:#fff;background-color:rgba(0,0,0,0.075)}.table-primary,.table-primary>th,.table-primary>td{background-color:#c7d1db}.table-primary th,.table-primary td,.table-primary thead th,.table-primary tbody+tbody{border-color:#97a9bc}.table-hover .table-primary:hover{background-color:#b7c4d1}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#b7c4d1}.table-secondary,.table-secondary>th,.table-secondary>td{background-color:#cbcbcb}.table-secondary th,.table-secondary td,.table-secondary thead th,.table-secondary tbody+tbody{border-color:#9e9e9e}.table-hover .table-secondary:hover{background-color:#bebebe}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#bebebe}.table-success,.table-success>th,.table-success>td{background-color:#b8ecdf}.table-success th,.table-success td,.table-success thead th,.table-success tbody+tbody{border-color:#7adcc3}.table-hover .table-success:hover{background-color:#a4e7d6}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#a4e7d6}.table-info,.table-info>th,.table-info>td{background-color:#c6e2f5}.table-info th,.table-info td,.table-info thead th,.table-info tbody+tbody{border-color:#95c9ec}.table-hover .table-info:hover{background-color:#b0d7f1}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#b0d7f1}.table-warning,.table-warning>th,.table-warning>td{background-color:#fce3bd}.table-warning th,.table-warning td,.table-warning thead th,.table-warning tbody+tbody{border-color:#f9cc84}.table-hover .table-warning:hover{background-color:#fbd9a5}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#fbd9a5}.table-danger,.table-danger>th,.table-danger>td{background-color:#f8cdc8}.table-danger th,.table-danger td,.table-danger thead th,.table-danger tbody+tbody{border-color:#f3a29a}.table-hover .table-danger:hover{background-color:#f5b8b1}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f5b8b1}.table-light,.table-light>th,.table-light>td{background-color:#e2e2e2}.table-light th,.table-light td,.table-light thead th,.table-light tbody+tbody{border-color:#cacaca}.table-hover .table-light:hover{background-color:#d5d5d5}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#d5d5d5}.table-dark,.table-dark>th,.table-dark>td{background-color:#c5c5c5}.table-dark th,.table-dark td,.table-dark thead th,.table-dark tbody+tbody{border-color:#939393}.table-hover .table-dark:hover{background-color:#b8b8b8}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b8b8b8}.table-active,.table-active>th,.table-active>td{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,0.075)}.table .thead-dark th{color:#fff;background-color:#303030;border-color:#434343}.table .thead-light th{color:#444;background-color:#ebebeb;border-color:#444}.table-dark{color:#fff;background-color:#303030}.table-dark th,.table-dark td,.table-dark thead th{border-color:#434343}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,0.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,0.075)}@media (max-width: 575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width: 767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width: 991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width: 1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 0.75rem;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#444;background-color:#fff;background-clip:padding-box;border:1px solid #222;border-radius:0.25rem;-webkit-transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.form-control{-webkit-transition:none;transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #444}.form-control:focus{color:#444;background-color:#fff;border-color:#739ac2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.form-control::-webkit-input-placeholder{color:#999;opacity:1}.form-control::-ms-input-placeholder{color:#999;opacity:1}.form-control::placeholder{color:#999;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#ebebeb;opacity:1}select.form-control:focus::-ms-value{color:#444;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(0.375rem + 1px);padding-bottom:calc(0.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(0.5rem + 1px);padding-bottom:calc(0.5rem + 1px);font-size:1.171875rem;line-height:1.5}.col-form-label-sm{padding-top:calc(0.25rem + 1px);padding-bottom:calc(0.25rem + 1px);font-size:0.8203125rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:0.375rem 0;margin-bottom:0;font-size:0.9375rem;line-height:1.5;color:#fff;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-sm,.form-control-plaintext.form-control-lg{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + 0.5rem + 2px);padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}select.form-control[size],select.form-control[multiple]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:0.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*="col-"]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:0.3rem;margin-left:-1.25rem}.form-check-input[disabled] ~ .form-check-label,.form-check-input:disabled ~ .form-check-label{color:#999}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:0.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:0.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#00bc8c}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.8203125rem;line-height:1.5;color:#fff;background-color:rgba(0,188,140,0.9);border-radius:0.25rem}.was-validated :valid ~ .valid-feedback,.was-validated :valid ~ .valid-tooltip,.is-valid ~ .valid-feedback,.is-valid ~ .valid-tooltip{display:block}.was-validated .form-control:valid,.form-control.is-valid{border-color:#00bc8c;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2300bc8c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:valid:focus,.form-control.is-valid:focus{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .custom-select:valid,.custom-select.is-valid{border-color:#00bc8c;padding-right:calc(0.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2300bc8c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .custom-select:valid:focus,.custom-select.is-valid:focus{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated .form-check-input:valid ~ .form-check-label,.form-check-input.is-valid ~ .form-check-label{color:#00bc8c}.was-validated .form-check-input:valid ~ .valid-feedback,.was-validated .form-check-input:valid ~ .valid-tooltip,.form-check-input.is-valid ~ .valid-feedback,.form-check-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-control-input:valid ~ .custom-control-label,.custom-control-input.is-valid ~ .custom-control-label{color:#00bc8c}.was-validated .custom-control-input:valid ~ .custom-control-label::before,.custom-control-input.is-valid ~ .custom-control-label::before{border-color:#00bc8c}.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before,.custom-control-input.is-valid:checked ~ .custom-control-label::before{border-color:#00efb2;background-color:#00efb2}.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before,.custom-control-input.is-valid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.was-validated .custom-control-input:valid:focus:not(:checked) ~ .custom-control-label::before,.custom-control-input.is-valid:focus:not(:checked) ~ .custom-control-label::before{border-color:#00bc8c}.was-validated .custom-file-input:valid ~ .custom-file-label,.custom-file-input.is-valid ~ .custom-file-label{border-color:#00bc8c}.was-validated .custom-file-input:valid:focus ~ .custom-file-label,.custom-file-input.is-valid:focus ~ .custom-file-label{border-color:#00bc8c;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.25)}.invalid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#E74C3C}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.8203125rem;line-height:1.5;color:#fff;background-color:rgba(231,76,60,0.9);border-radius:0.25rem}.was-validated :invalid ~ .invalid-feedback,.was-validated :invalid ~ .invalid-tooltip,.is-invalid ~ .invalid-feedback,.is-invalid ~ .invalid-tooltip{display:block}.was-validated .form-control:invalid,.form-control.is-invalid{border-color:#E74C3C;padding-right:calc(1.5em + 0.75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23E74C3C' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23E74C3C' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(0.375em + 0.1875rem) center;background-size:calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .form-control:invalid:focus,.form-control.is-invalid:focus{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + 0.75rem);background-position:top calc(0.375em + 0.1875rem) right calc(0.375em + 0.1875rem)}.was-validated .custom-select:invalid,.custom-select.is-invalid{border-color:#E74C3C;padding-right:calc(0.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23E74C3C' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23E74C3C' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(0.75em + 0.375rem) calc(0.75em + 0.375rem)}.was-validated .custom-select:invalid:focus,.custom-select.is-invalid:focus{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated .form-check-input:invalid ~ .form-check-label,.form-check-input.is-invalid ~ .form-check-label{color:#E74C3C}.was-validated .form-check-input:invalid ~ .invalid-feedback,.was-validated .form-check-input:invalid ~ .invalid-tooltip,.form-check-input.is-invalid ~ .invalid-feedback,.form-check-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-control-input:invalid ~ .custom-control-label,.custom-control-input.is-invalid ~ .custom-control-label{color:#E74C3C}.was-validated .custom-control-input:invalid ~ .custom-control-label::before,.custom-control-input.is-invalid ~ .custom-control-label::before{border-color:#E74C3C}.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before,.custom-control-input.is-invalid:checked ~ .custom-control-label::before{border-color:#ed7669;background-color:#ed7669}.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before,.custom-control-input.is-invalid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.was-validated .custom-control-input:invalid:focus:not(:checked) ~ .custom-control-label::before,.custom-control-input.is-invalid:focus:not(:checked) ~ .custom-control-label::before{border-color:#E74C3C}.was-validated .custom-file-input:invalid ~ .custom-file-label,.custom-file-input.is-invalid ~ .custom-file-label{border-color:#E74C3C}.was-validated .custom-file-input:invalid:focus ~ .custom-file-label,.custom-file-input.is-invalid:focus ~ .custom-file-label{border-color:#E74C3C;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width: 576px){.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group,.form-inline .custom-select{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:0.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#fff;text-align:center;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:0.9375rem;line-height:1.5;border-radius:0.25rem;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.btn{-webkit-transition:none;transition:none}}.btn:hover{color:#fff;text-decoration:none}.btn:focus,.btn.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.btn.disabled,.btn:disabled{opacity:0.65}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-primary:hover{color:#fff;background-color:#2b4764;border-color:#28415b}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#2b4764;border-color:#28415b;-webkit-box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5);box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-primary:not(:disabled):not(.disabled):active,.btn-primary:not(:disabled):not(.disabled).active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#28415b;border-color:#243a53}.btn-primary:not(:disabled):not(.disabled):active:focus,.btn-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5);box-shadow:0 0 0 0.2rem rgba(85,115,146,0.5)}.btn-secondary{color:#fff;background-color:#444;border-color:#444}.btn-secondary:hover{color:#fff;background-color:#313131;border-color:#2b2a2a}.btn-secondary:focus,.btn-secondary.focus{color:#fff;background-color:#313131;border-color:#2b2a2a;-webkit-box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5);box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#444;border-color:#444}.btn-secondary:not(:disabled):not(.disabled):active,.btn-secondary:not(:disabled):not(.disabled).active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#2b2a2a;border-color:#242424}.btn-secondary:not(:disabled):not(.disabled):active:focus,.btn-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5);box-shadow:0 0 0 0.2rem rgba(96,96,96,0.5)}.btn-success{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-success:hover{color:#fff;background-color:#009670;border-color:#008966}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#009670;border-color:#008966;-webkit-box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5);box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-success:not(:disabled):not(.disabled):active,.btn-success:not(:disabled):not(.disabled).active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#008966;border-color:#007c5d}.btn-success:not(:disabled):not(.disabled):active:focus,.btn-success:not(:disabled):not(.disabled).active:focus,.show>.btn-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5);box-shadow:0 0 0 0.2rem rgba(38,198,157,0.5)}.btn-info{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-info:hover{color:#fff;background-color:#2384c6;border-color:#217dbb}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#2384c6;border-color:#217dbb;-webkit-box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5);box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-info:not(:disabled):not(.disabled):active,.btn-info:not(:disabled):not(.disabled).active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#217dbb;border-color:#1f76b0}.btn-info:not(:disabled):not(.disabled):active:focus,.btn-info:not(:disabled):not(.disabled).active:focus,.show>.btn-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5);box-shadow:0 0 0 0.2rem rgba(82,167,224,0.5)}.btn-warning{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-warning:hover{color:#fff;background-color:#d4860b;border-color:#c87f0a}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#d4860b;border-color:#c87f0a;-webkit-box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5);box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5)}.btn-warning.disabled,.btn-warning:disabled{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-warning:not(:disabled):not(.disabled):active,.btn-warning:not(:disabled):not(.disabled).active,.show>.btn-warning.dropdown-toggle{color:#fff;background-color:#c87f0a;border-color:#bc770a}.btn-warning:not(:disabled):not(.disabled):active:focus,.btn-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5);box-shadow:0 0 0 0.2rem rgba(245,171,54,0.5)}.btn-danger{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-danger:hover{color:#fff;background-color:#e12e1c;border-color:#d62c1a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#e12e1c;border-color:#d62c1a;-webkit-box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5);box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-danger:not(:disabled):not(.disabled):active,.btn-danger:not(:disabled):not(.disabled).active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#d62c1a;border-color:#ca2a19}.btn-danger:not(:disabled):not(.disabled):active:focus,.btn-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5);box-shadow:0 0 0 0.2rem rgba(235,103,89,0.5)}.btn-light{color:#fff;background-color:#999;border-color:#999}.btn-light:hover{color:#fff;background-color:#868686;border-color:#807f7f}.btn-light:focus,.btn-light.focus{color:#fff;background-color:#868686;border-color:#807f7f;-webkit-box-shadow:0 0 0 0.2rem rgba(168,168,168,0.5);box-shadow:0 0 0 0.2rem rgba(168,168,168,0.5)}.btn-light.disabled,.btn-light:disabled{color:#fff;background-color:#999;border-color:#999}.btn-light:not(:disabled):not(.disabled):active,.btn-light:not(:disabled):not(.disabled).active,.show>.btn-light.dropdown-toggle{color:#fff;background-color:#807f7f;border-color:#797979}.btn-light:not(:disabled):not(.disabled):active:focus,.btn-light:not(:disabled):not(.disabled).active:focus,.show>.btn-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(168,168,168,0.5);box-shadow:0 0 0 0.2rem rgba(168,168,168,0.5)}.btn-dark{color:#fff;background-color:#303030;border-color:#303030}.btn-dark:hover{color:#fff;background-color:#1d1d1d;border-color:#171616}.btn-dark:focus,.btn-dark.focus{color:#fff;background-color:#1d1d1d;border-color:#171616;-webkit-box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5);box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#303030;border-color:#303030}.btn-dark:not(:disabled):not(.disabled):active,.btn-dark:not(:disabled):not(.disabled).active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#171616;border-color:#101010}.btn-dark:not(:disabled):not(.disabled):active:focus,.btn-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5);box-shadow:0 0 0 0.2rem rgba(79,79,79,0.5)}.btn-outline-primary{color:#375a7f;border-color:#375a7f}.btn-outline-primary:hover{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-outline-primary:focus,.btn-outline-primary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#375a7f;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled):active,.btn-outline-primary:not(:disabled):not(.disabled).active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#375a7f;border-color:#375a7f}.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.btn-outline-secondary{color:#444;border-color:#444}.btn-outline-secondary:hover{color:#fff;background-color:#444;border-color:#444}.btn-outline-secondary:focus,.btn-outline-secondary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#444;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled):active,.btn-outline-secondary:not(:disabled):not(.disabled).active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#444;border-color:#444}.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.btn-outline-success{color:#00bc8c;border-color:#00bc8c}.btn-outline-success:hover{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-outline-success:focus,.btn-outline-success.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#00bc8c;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled):active,.btn-outline-success:not(:disabled):not(.disabled).active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#00bc8c;border-color:#00bc8c}.btn-outline-success:not(:disabled):not(.disabled):active:focus,.btn-outline-success:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.btn-outline-info{color:#3498DB;border-color:#3498DB}.btn-outline-info:hover{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-outline-info:focus,.btn-outline-info.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#3498DB;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled):active,.btn-outline-info:not(:disabled):not(.disabled).active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#3498DB;border-color:#3498DB}.btn-outline-info:not(:disabled):not(.disabled):active:focus,.btn-outline-info:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.btn-outline-warning{color:#F39C12;border-color:#F39C12}.btn-outline-warning:hover{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-outline-warning:focus,.btn-outline-warning.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#F39C12;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled):active,.btn-outline-warning:not(:disabled):not(.disabled).active,.show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#F39C12;border-color:#F39C12}.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.btn-outline-danger{color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:hover{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:focus,.btn-outline-danger.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#E74C3C;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled):active,.btn-outline-danger:not(:disabled):not(.disabled).active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#E74C3C;border-color:#E74C3C}.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.btn-outline-light{color:#999;border-color:#999}.btn-outline-light:hover{color:#fff;background-color:#999;border-color:#999}.btn-outline-light:focus,.btn-outline-light.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5);box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#999;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled):active,.btn-outline-light:not(:disabled):not(.disabled).active,.show>.btn-outline-light.dropdown-toggle{color:#fff;background-color:#999;border-color:#999}.btn-outline-light:not(:disabled):not(.disabled):active:focus,.btn-outline-light:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5);box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5)}.btn-outline-dark{color:#303030;border-color:#303030}.btn-outline-dark:hover{color:#fff;background-color:#303030;border-color:#303030}.btn-outline-dark:focus,.btn-outline-dark.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#303030;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled):active,.btn-outline-dark:not(:disabled):not(.disabled).active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#303030;border-color:#303030}.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.btn-link{font-weight:400;color:#00bc8c;text-decoration:none}.btn-link:hover{color:#007053;text-decoration:underline}.btn-link:focus,.btn-link.focus{text-decoration:underline;-webkit-box-shadow:none;box-shadow:none}.btn-link:disabled,.btn-link.disabled{color:#999;pointer-events:none}.btn-lg,.btn-group-lg>.btn{padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}.btn-sm,.btn-group-sm>.btn{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:0.5rem}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{-webkit-transition:opacity 0.15s linear;transition:opacity 0.15s linear}@media (prefers-reduced-motion: reduce){.fade{-webkit-transition:none;transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;transition:height 0.35s ease}@media (prefers-reduced-motion: reduce){.collapsing{-webkit-transition:none;transition:none}}.dropup,.dropright,.dropdown,.dropleft{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid;border-right:0.3em solid transparent;border-bottom:0;border-left:0.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:0.5rem 0;margin:0.125rem 0 0;font-size:0.9375rem;color:#fff;text-align:left;list-style:none;background-color:#222;background-clip:padding-box;border:1px solid #444;border-radius:0.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width: 576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width: 768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width: 992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width: 1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:0.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0;border-right:0.3em solid transparent;border-bottom:0.3em solid;border-left:0.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:0.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0;border-bottom:0.3em solid transparent;border-left:0.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:0.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:0.255em;vertical-align:0.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0.3em solid;border-bottom:0.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^="top"],.dropdown-menu[x-placement^="right"],.dropdown-menu[x-placement^="bottom"],.dropdown-menu[x-placement^="left"]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:0.5rem 0;overflow:hidden;border-top:1px solid #444}.dropdown-item{display:block;width:100%;padding:0.25rem 1.5rem;clear:both;font-weight:400;color:#fff;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:hover,.dropdown-item:focus{color:#fff;text-decoration:none;background-color:#375a7f}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#375a7f}.dropdown-item.disabled,.dropdown-item:disabled{color:#999;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:0.5rem 1.5rem;margin-bottom:0;font-size:0.8203125rem;color:#999;white-space:nowrap}.dropdown-item-text{display:block;padding:0.25rem 1.5rem;color:#fff}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover{z-index:1}.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn.active{z-index:1}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:not(:first-child),.btn-group>.btn-group:not(:first-child){margin-left:-1px}.btn-group>.btn:not(:last-child):not(.dropdown-toggle),.btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:not(:first-child),.btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:0.5625rem;padding-left:0.5625rem}.dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-sm+.dropdown-toggle-split,.btn-group-sm>.btn+.dropdown-toggle-split{padding-right:0.375rem;padding-left:0.375rem}.btn-lg+.dropdown-toggle-split,.btn-group-lg>.btn+.dropdown-toggle-split{padding-right:0.75rem;padding-left:0.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle),.btn-group-vertical>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type="radio"],.btn-group-toggle>.btn input[type="checkbox"],.btn-group-toggle>.btn-group>.btn input[type="radio"],.btn-group-toggle>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.form-control-plaintext,.input-group>.custom-select,.input-group>.custom-file{position:relative;-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%;min-width:0;margin-bottom:0}.input-group>.form-control+.form-control,.input-group>.form-control+.custom-select,.input-group>.form-control+.custom-file,.input-group>.form-control-plaintext+.form-control,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.custom-file,.input-group>.custom-select+.form-control,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.custom-file,.input-group>.custom-file+.form-control,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.custom-file{margin-left:-1px}.input-group>.form-control:focus,.input-group>.custom-select:focus,.input-group>.custom-file .custom-file-input:focus ~ .custom-file-label{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.form-control:not(:last-child),.input-group>.custom-select:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.form-control:not(:first-child),.input-group>.custom-select:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-prepend,.input-group-append{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-prepend .btn,.input-group-append .btn{position:relative;z-index:2}.input-group-prepend .btn:focus,.input-group-append .btn:focus{z-index:3}.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.input-group-text,.input-group-append .input-group-text+.btn{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.375rem 0.75rem;margin-bottom:0;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#adb5bd;text-align:center;white-space:nowrap;background-color:#444;border:1px solid #222;border-radius:0.25rem}.input-group-text input[type="radio"],.input-group-text input[type="checkbox"]{margin-top:0}.input-group-lg>.form-control:not(textarea),.input-group-lg>.custom-select{height:calc(1.5em + 1rem + 2px)}.input-group-lg>.form-control,.input-group-lg>.custom-select,.input-group-lg>.input-group-prepend>.input-group-text,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-append>.btn{padding:0.5rem 1rem;font-size:1.171875rem;line-height:1.5;border-radius:0.3rem}.input-group-sm>.form-control:not(textarea),.input-group-sm>.custom-select{height:calc(1.5em + 0.5rem + 2px)}.input-group-sm>.form-control,.input-group-sm>.custom-select,.input-group-sm>.input-group-prepend>.input-group-text,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-append>.btn{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5;border-radius:0.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text,.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.40625rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.203125rem;opacity:0}.custom-control-input:checked ~ .custom-control-label::before{color:#fff;border-color:#375a7f;background-color:#375a7f}.custom-control-input:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-control-input:focus:not(:checked) ~ .custom-control-label::before{border-color:#739ac2}.custom-control-input:not(:disabled):active ~ .custom-control-label::before{color:#fff;background-color:#97b3d2;border-color:#97b3d2}.custom-control-input[disabled] ~ .custom-control-label,.custom-control-input:disabled ~ .custom-control-label{color:#999}.custom-control-input[disabled] ~ .custom-control-label::before,.custom-control-input:disabled ~ .custom-control-label::before{background-color:#ebebeb}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:0.203125rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:0.203125rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50% / 50% 50%}.custom-checkbox .custom-control-label::before{border-radius:0.25rem}.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before{border-color:#375a7f;background-color:#375a7f}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:0.5rem}.custom-switch .custom-control-label::after{top:calc(0.203125rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:0.5rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:transform 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-transform 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.custom-switch .custom-control-label::after{-webkit-transition:none;transition:none}}.custom-switch .custom-control-input:checked ~ .custom-control-label::after{background-color:#fff;-webkit-transform:translateX(0.75rem);transform:translateX(0.75rem)}.custom-switch .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(55,90,127,0.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 1.75rem 0.375rem 0.75rem;font-size:0.9375rem;font-weight:400;line-height:1.5;color:#444;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23303030' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px;border:1px solid #222;border-radius:0.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#739ac2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-select:focus::-ms-value{color:#444;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:0.75rem;background-image:none}.custom-select:disabled{color:#999;background-color:#ebebeb}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #444}.custom-select-sm{height:calc(1.5em + 0.5rem + 2px);padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.5rem;font-size:0.8203125rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;font-size:1.171875rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + 0.75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + 0.75rem + 2px);margin:0;opacity:0}.custom-file-input:focus ~ .custom-file-label{border-color:#739ac2;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-file-input[disabled] ~ .custom-file-label,.custom-file-input:disabled ~ .custom-file-label{background-color:#ebebeb}.custom-file-input:lang(en) ~ .custom-file-label::after{content:"Browse"}.custom-file-input ~ .custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + 0.75rem + 2px);padding:0.375rem 0.75rem;font-weight:400;line-height:1.5;color:#adb5bd;background-color:#fff;border:1px solid #222;border-radius:0.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + 0.75rem);padding:0.375rem 0.75rem;line-height:1.5;color:#adb5bd;content:"Browse";background-color:#444;border-left:inherit;border-radius:0 0.25rem 0.25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:none}.custom-range:focus::-webkit-slider-thumb{-webkit-box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #222,0 0 0 0.2rem rgba(55,90,127,0.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-0.25rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#97b3d2}.custom-range::-webkit-slider-runnable-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-moz-range-thumb{-webkit-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#97b3d2}.custom-range::-moz-range-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:0.2rem;margin-left:0.2rem;background-color:#375a7f;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;appearance:none}@media (prefers-reduced-motion: reduce){.custom-range::-ms-thumb{-webkit-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#97b3d2}.custom-range::-ms-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:0.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:none;transition:none}}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:0.5rem 2rem}.nav-link:hover,.nav-link:focus{text-decoration:none}.nav-link.disabled{color:#adb5bd;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #444}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{border-color:#444 #444 transparent}.nav-tabs .nav-link.disabled{color:#adb5bd;background-color:transparent;border-color:transparent}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:#fff;background-color:#222;border-color:#444 #444 transparent}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:0.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#375a7f}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-sm,.navbar .container-md,.navbar .container-lg,.navbar .container-xl{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:0.32421875rem;padding-bottom:0.32421875rem;margin-right:1rem;font-size:1.171875rem;line-height:inherit;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:0.5rem;padding-bottom:0.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:0.25rem 0.75rem;font-size:1.171875rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:0.25rem}.navbar-toggler:hover,.navbar-toggler:focus{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width: 575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width: 576px){.navbar-expand-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width: 767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-md,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width: 768px){.navbar-expand-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-md,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width: 991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width: 992px){.navbar-expand-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width: 1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width: 1200px){.navbar-expand-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-sm,.navbar-expand>.container-md,.navbar-expand>.container-lg,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-sm,.navbar-expand>.container-md,.navbar-expand>.container-lg,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:#fff}.navbar-light .navbar-brand:hover,.navbar-light .navbar-brand:focus{color:#fff}.navbar-light .navbar-nav .nav-link{color:#fff}.navbar-light .navbar-nav .nav-link:hover,.navbar-light .navbar-nav .nav-link:focus{color:#00bc8c}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(255,255,255,0.3)}.navbar-light .navbar-nav .show>.nav-link,.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .nav-link.active{color:#fff}.navbar-light .navbar-toggler{color:#fff;border-color:rgba(255,255,255,0.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:#fff}.navbar-light .navbar-text a{color:#fff}.navbar-light .navbar-text a:hover,.navbar-light .navbar-text a:focus{color:#fff}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:hover,.navbar-dark .navbar-brand:focus{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,0.6)}.navbar-dark .navbar-nav .nav-link:hover,.navbar-dark .navbar-nav .nav-link:focus{color:#fff}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,0.25)}.navbar-dark .navbar-nav .show>.nav-link,.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .nav-link.active{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,0.6);border-color:rgba(255,255,255,0.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.6)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,0.6)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:hover,.navbar-dark .navbar-text a:focus{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#303030;background-clip:border-box;border:1px solid rgba(0,0,0,0.125);border-radius:0.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:0.75rem}.card-subtitle{margin-top:-0.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:0.75rem 1.25rem;margin-bottom:0;background-color:#444;border-bottom:1px solid rgba(0,0,0,0.125)}.card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:0.75rem 1.25rem;background-color:#444;border-top:1px solid rgba(0,0,0,0.125)}.card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.card-header-tabs{margin-right:-0.625rem;margin-bottom:-0.75rem;margin-left:-0.625rem;border-bottom:0}.card-header-pills{margin-right:-0.625rem;margin-left:-0.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img,.card-img-top,.card-img-bottom{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(0.25rem - 1px);border-bottom-left-radius:calc(0.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width: 576px){.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width: 576px){.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-img-top,.card-group>.card:not(:last-child) .card-header{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-img-bottom,.card-group>.card:not(:last-child) .card-footer{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-img-top,.card-group>.card:not(:first-child) .card-header{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-img-bottom,.card-group>.card:not(:first-child) .card-footer{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:0.75rem}@media (min-width: 576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#444;border-radius:0.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:0.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:0.5rem;color:#999;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#999}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:0.25rem}.page-link{position:relative;display:block;padding:0.5rem 0.75rem;margin-left:0;line-height:1.25;color:#fff;background-color:#00bc8c;border:0 solid transparent}.page-link:hover{z-index:2;color:#fff;text-decoration:none;background-color:#00efb2;border-color:transparent}.page-link:focus{z-index:3;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem}.page-item:last-child .page-link{border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#00efb2;border-color:transparent}.page-item.disabled .page-link{color:#fff;pointer-events:none;cursor:auto;background-color:#007053;border-color:transparent}.pagination-lg .page-link{padding:0.75rem 1.5rem;font-size:1.171875rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:0.3rem;border-bottom-left-radius:0.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:0.3rem;border-bottom-right-radius:0.3rem}.pagination-sm .page-link{padding:0.25rem 0.5rem;font-size:0.8203125rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:0.2rem;border-bottom-left-radius:0.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:0.2rem;border-bottom-right-radius:0.2rem}.badge{display:inline-block;padding:0.25em 0.4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:0.25rem;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media (prefers-reduced-motion: reduce){.badge{-webkit-transition:none;transition:none}}a.badge:hover,a.badge:focus{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:0.6em;padding-left:0.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#375a7f}a.badge-primary:hover,a.badge-primary:focus{color:#fff;background-color:#28415b}a.badge-primary:focus,a.badge-primary.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5);box-shadow:0 0 0 0.2rem rgba(55,90,127,0.5)}.badge-secondary{color:#fff;background-color:#444}a.badge-secondary:hover,a.badge-secondary:focus{color:#fff;background-color:#2b2a2a}a.badge-secondary:focus,a.badge-secondary.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5);box-shadow:0 0 0 0.2rem rgba(68,68,68,0.5)}.badge-success{color:#fff;background-color:#00bc8c}a.badge-success:hover,a.badge-success:focus{color:#fff;background-color:#008966}a.badge-success:focus,a.badge-success.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5);box-shadow:0 0 0 0.2rem rgba(0,188,140,0.5)}.badge-info{color:#fff;background-color:#3498DB}a.badge-info:hover,a.badge-info:focus{color:#fff;background-color:#217dbb}a.badge-info:focus,a.badge-info.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5);box-shadow:0 0 0 0.2rem rgba(52,152,219,0.5)}.badge-warning{color:#fff;background-color:#F39C12}a.badge-warning:hover,a.badge-warning:focus{color:#fff;background-color:#c87f0a}a.badge-warning:focus,a.badge-warning.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5);box-shadow:0 0 0 0.2rem rgba(243,156,18,0.5)}.badge-danger{color:#fff;background-color:#E74C3C}a.badge-danger:hover,a.badge-danger:focus{color:#fff;background-color:#d62c1a}a.badge-danger:focus,a.badge-danger.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5);box-shadow:0 0 0 0.2rem rgba(231,76,60,0.5)}.badge-light{color:#fff;background-color:#999}a.badge-light:hover,a.badge-light:focus{color:#fff;background-color:#807f7f}a.badge-light:focus,a.badge-light.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5);box-shadow:0 0 0 0.2rem rgba(153,153,153,0.5)}.badge-dark{color:#fff;background-color:#303030}a.badge-dark:hover,a.badge-dark:focus{color:#fff;background-color:#171616}a.badge-dark:focus,a.badge-dark.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5);box-shadow:0 0 0 0.2rem rgba(48,48,48,0.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#303030;border-radius:0.3rem}@media (min-width: 576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:3.90625rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:0.75rem 1.25rem;color:inherit}.alert-primary{color:#1d2f42;background-color:#d7dee5;border-color:#c7d1db}.alert-primary hr{border-top-color:#b7c4d1}.alert-primary .alert-link{color:#0d161f}.alert-secondary{color:#232323;background-color:#dadada;border-color:#cbcbcb}.alert-secondary hr{border-top-color:#bebebe}.alert-secondary .alert-link{color:#0a0909}.alert-success{color:#006249;background-color:#ccf2e8;border-color:#b8ecdf}.alert-success hr{border-top-color:#a4e7d6}.alert-success .alert-link{color:#002f23}.alert-info{color:#1b4f72;background-color:#d6eaf8;border-color:#c6e2f5}.alert-info hr{border-top-color:#b0d7f1}.alert-info .alert-link{color:#113249}.alert-warning{color:#7e5109;background-color:#fdebd0;border-color:#fce3bd}.alert-warning hr{border-top-color:#fbd9a5}.alert-warning .alert-link{color:#4e3206}.alert-danger{color:#78281f;background-color:#fadbd8;border-color:#f8cdc8}.alert-danger hr{border-top-color:#f5b8b1}.alert-danger .alert-link{color:#4f1a15}.alert-light{color:#505050;background-color:#ebebeb;border-color:#e2e2e2}.alert-light hr{border-top-color:#d5d5d5}.alert-light .alert-link{color:#373636}.alert-dark{color:#191919;background-color:#d6d6d6;border-color:#c5c5c5}.alert-dark hr{border-top-color:#b8b8b8}.alert-dark .alert-link{color:black}@-webkit-keyframes progress-bar-stripes{from{background-position:0.625rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:0.625rem 0}to{background-position:0 0}}.progress{display:-webkit-box;display:-ms-flexbox;display:flex;height:0.625rem;overflow:hidden;font-size:0.625rem;background-color:#444;border-radius:0.25rem}.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#375a7f;-webkit-transition:width 0.6s ease;transition:width 0.6s ease}@media (prefers-reduced-motion: reduce){.progress-bar{-webkit-transition:none;transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-size:0.625rem 0.625rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion: reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#444;text-align:inherit}.list-group-item-action:hover,.list-group-item-action:focus{z-index:1;color:#444;text-decoration:none;background-color:#444}.list-group-item-action:active{color:#fff;background-color:#ebebeb}.list-group-item{position:relative;display:block;padding:0.75rem 1.25rem;background-color:#303030;border:1px solid #444}.list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.list-group-item.disabled,.list-group-item:disabled{color:#999;pointer-events:none;background-color:#303030}.list-group-item.active{z-index:2;color:#fff;background-color:#375a7f;border-color:#375a7f}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal .list-group-item:first-child{border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal .list-group-item:last-child{border-top-right-radius:0.25rem;border-bottom-left-radius:0}.list-group-horizontal .list-group-item.active{margin-top:0}.list-group-horizontal .list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal .list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width: 576px){.list-group-horizontal-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm .list-group-item:first-child{border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-sm .list-group-item:last-child{border-top-right-radius:0.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm .list-group-item.active{margin-top:0}.list-group-horizontal-sm .list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm .list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width: 768px){.list-group-horizontal-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md .list-group-item:first-child{border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-md .list-group-item:last-child{border-top-right-radius:0.25rem;border-bottom-left-radius:0}.list-group-horizontal-md .list-group-item.active{margin-top:0}.list-group-horizontal-md .list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md .list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width: 992px){.list-group-horizontal-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg .list-group-item:first-child{border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-lg .list-group-item:last-child{border-top-right-radius:0.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg .list-group-item.active{margin-top:0}.list-group-horizontal-lg .list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg .list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width: 1200px){.list-group-horizontal-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl .list-group-item:first-child{border-bottom-left-radius:0.25rem;border-top-right-radius:0}.list-group-horizontal-xl .list-group-item:last-child{border-top-right-radius:0.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl .list-group-item.active{margin-top:0}.list-group-horizontal-xl .list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl .list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush .list-group-item{border-right-width:0;border-left-width:0;border-radius:0}.list-group-flush .list-group-item:first-child{border-top-width:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#1d2f42;background-color:#c7d1db}.list-group-item-primary.list-group-item-action:hover,.list-group-item-primary.list-group-item-action:focus{color:#1d2f42;background-color:#b7c4d1}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#1d2f42;border-color:#1d2f42}.list-group-item-secondary{color:#232323;background-color:#cbcbcb}.list-group-item-secondary.list-group-item-action:hover,.list-group-item-secondary.list-group-item-action:focus{color:#232323;background-color:#bebebe}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#232323;border-color:#232323}.list-group-item-success{color:#006249;background-color:#b8ecdf}.list-group-item-success.list-group-item-action:hover,.list-group-item-success.list-group-item-action:focus{color:#006249;background-color:#a4e7d6}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#006249;border-color:#006249}.list-group-item-info{color:#1b4f72;background-color:#c6e2f5}.list-group-item-info.list-group-item-action:hover,.list-group-item-info.list-group-item-action:focus{color:#1b4f72;background-color:#b0d7f1}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#1b4f72;border-color:#1b4f72}.list-group-item-warning{color:#7e5109;background-color:#fce3bd}.list-group-item-warning.list-group-item-action:hover,.list-group-item-warning.list-group-item-action:focus{color:#7e5109;background-color:#fbd9a5}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#7e5109;border-color:#7e5109}.list-group-item-danger{color:#78281f;background-color:#f8cdc8}.list-group-item-danger.list-group-item-action:hover,.list-group-item-danger.list-group-item-action:focus{color:#78281f;background-color:#f5b8b1}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#78281f;border-color:#78281f}.list-group-item-light{color:#505050;background-color:#e2e2e2}.list-group-item-light.list-group-item-action:hover,.list-group-item-light.list-group-item-action:focus{color:#505050;background-color:#d5d5d5}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#505050;border-color:#505050}.list-group-item-dark{color:#191919;background-color:#c5c5c5}.list-group-item-dark.list-group-item-action:hover,.list-group-item-dark.list-group-item-action:focus{color:#191919;background-color:#b8b8b8}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#191919;border-color:#191919}.close{float:right;font-size:1.40625rem;font-weight:700;line-height:1;color:#fff;text-shadow:none;opacity:.5}.close:hover{color:#fff;text-decoration:none}.close:not(:disabled):not(.disabled):hover,.close:not(:disabled):not(.disabled):focus{opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:0.875rem;background-color:rgba(255,255,255,0.85);background-clip:padding-box;border:1px solid rgba(0,0,0,0.1);-webkit-box-shadow:0 0.25rem 0.75rem rgba(0,0,0,0.1);box-shadow:0 0.25rem 0.75rem rgba(0,0,0,0.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:0.25rem}.toast:not(:last-child){margin-bottom:0.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.25rem 0.75rem;color:#999;background-color:rgba(255,255,255,0.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,0.05)}.toast-body{padding:0.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:0.5rem;pointer-events:none}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform 0.3s ease-out;transition:-webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out;transition:transform 0.3s ease-out, -webkit-transform 0.3s ease-out;-webkit-transform:translate(0, -50px);transform:translate(0, -50px)}@media (prefers-reduced-motion: reduce){.modal.fade .modal-dialog{-webkit-transition:none;transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-webkit-box;display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-header,.modal-dialog-scrollable .modal-footer{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);content:""}.modal-dialog-centered.modal-dialog-scrollable{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#303030;background-clip:padding-box;border:1px solid #444;border-radius:0.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:0.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #444;border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:0.75rem;border-top:1px solid #444;border-bottom-right-radius:calc(0.3rem - 1px);border-bottom-left-radius:calc(0.3rem - 1px)}.modal-footer>*{margin:0.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width: 576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem)}.modal-sm{max-width:300px}}@media (min-width: 992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width: 1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.8203125rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:0.9}.tooltip .arrow{position:absolute;display:block;width:0.8rem;height:0.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-top,.bs-tooltip-auto[x-placement^="top"]{padding:0.4rem 0}.bs-tooltip-top .arrow,.bs-tooltip-auto[x-placement^="top"] .arrow{bottom:0}.bs-tooltip-top .arrow::before,.bs-tooltip-auto[x-placement^="top"] .arrow::before{top:0;border-width:0.4rem 0.4rem 0;border-top-color:#000}.bs-tooltip-right,.bs-tooltip-auto[x-placement^="right"]{padding:0 0.4rem}.bs-tooltip-right .arrow,.bs-tooltip-auto[x-placement^="right"] .arrow{left:0;width:0.4rem;height:0.8rem}.bs-tooltip-right .arrow::before,.bs-tooltip-auto[x-placement^="right"] .arrow::before{right:0;border-width:0.4rem 0.4rem 0.4rem 0;border-right-color:#000}.bs-tooltip-bottom,.bs-tooltip-auto[x-placement^="bottom"]{padding:0.4rem 0}.bs-tooltip-bottom .arrow,.bs-tooltip-auto[x-placement^="bottom"] .arrow{top:0}.bs-tooltip-bottom .arrow::before,.bs-tooltip-auto[x-placement^="bottom"] .arrow::before{bottom:0;border-width:0 0.4rem 0.4rem;border-bottom-color:#000}.bs-tooltip-left,.bs-tooltip-auto[x-placement^="left"]{padding:0 0.4rem}.bs-tooltip-left .arrow,.bs-tooltip-auto[x-placement^="left"] .arrow{right:0;width:0.4rem;height:0.8rem}.bs-tooltip-left .arrow::before,.bs-tooltip-auto[x-placement^="left"] .arrow::before{left:0;border-width:0.4rem 0 0.4rem 0.4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:0.25rem 0.5rem;color:#fff;text-align:center;background-color:#000;border-radius:0.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:"Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.8203125rem;word-wrap:break-word;background-color:#303030;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:0.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:0.5rem;margin:0 0.3rem}.popover .arrow::before,.popover .arrow::after{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-top,.bs-popover-auto[x-placement^="top"]{margin-bottom:0.5rem}.bs-popover-top>.arrow,.bs-popover-auto[x-placement^="top"]>.arrow{bottom:calc(-0.5rem - 1px)}.bs-popover-top>.arrow::before,.bs-popover-auto[x-placement^="top"]>.arrow::before{bottom:0;border-width:0.5rem 0.5rem 0;border-top-color:rgba(0,0,0,0.25)}.bs-popover-top>.arrow::after,.bs-popover-auto[x-placement^="top"]>.arrow::after{bottom:1px;border-width:0.5rem 0.5rem 0;border-top-color:#303030}.bs-popover-right,.bs-popover-auto[x-placement^="right"]{margin-left:0.5rem}.bs-popover-right>.arrow,.bs-popover-auto[x-placement^="right"]>.arrow{left:calc(-0.5rem - 1px);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-right>.arrow::before,.bs-popover-auto[x-placement^="right"]>.arrow::before{left:0;border-width:0.5rem 0.5rem 0.5rem 0;border-right-color:rgba(0,0,0,0.25)}.bs-popover-right>.arrow::after,.bs-popover-auto[x-placement^="right"]>.arrow::after{left:1px;border-width:0.5rem 0.5rem 0.5rem 0;border-right-color:#303030}.bs-popover-bottom,.bs-popover-auto[x-placement^="bottom"]{margin-top:0.5rem}.bs-popover-bottom>.arrow,.bs-popover-auto[x-placement^="bottom"]>.arrow{top:calc(-0.5rem - 1px)}.bs-popover-bottom>.arrow::before,.bs-popover-auto[x-placement^="bottom"]>.arrow::before{top:0;border-width:0 0.5rem 0.5rem 0.5rem;border-bottom-color:rgba(0,0,0,0.25)}.bs-popover-bottom>.arrow::after,.bs-popover-auto[x-placement^="bottom"]>.arrow::after{top:1px;border-width:0 0.5rem 0.5rem 0.5rem;border-bottom-color:#303030}.bs-popover-bottom .popover-header::before,.bs-popover-auto[x-placement^="bottom"] .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-0.5rem;content:"";border-bottom:1px solid #444}.bs-popover-left,.bs-popover-auto[x-placement^="left"]{margin-right:0.5rem}.bs-popover-left>.arrow,.bs-popover-auto[x-placement^="left"]>.arrow{right:calc(-0.5rem - 1px);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-left>.arrow::before,.bs-popover-auto[x-placement^="left"]>.arrow::before{right:0;border-width:0.5rem 0 0.5rem 0.5rem;border-left-color:rgba(0,0,0,0.25)}.bs-popover-left>.arrow::after,.bs-popover-auto[x-placement^="left"]>.arrow::after{right:1px;border-width:0.5rem 0 0.5rem 0.5rem;border-left-color:#303030}.popover-header{padding:0.5rem 0.75rem;margin-bottom:0;font-size:0.9375rem;background-color:#444;border-bottom:1px solid #373737;border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:0.5rem 0.75rem;color:#fff}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:-webkit-transform 0.6s ease-in-out;transition:-webkit-transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out, -webkit-transform 0.6s ease-in-out}@media (prefers-reduced-motion: reduce){.carousel-item{-webkit-transition:none;transition:none}}.carousel-item.active,.carousel-item-next,.carousel-item-prev{display:block}.carousel-item-next:not(.carousel-item-left),.active.carousel-item-right{-webkit-transform:translateX(100%);transform:translateX(100%)}.carousel-item-prev:not(.carousel-item-right),.active.carousel-item-left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;-webkit-transition-property:opacity;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item.active,.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;-webkit-transition:opacity 0s 0.6s;transition:opacity 0s 0.6s}@media (prefers-reduced-motion: reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{-webkit-transition:none;transition:none}}.carousel-control-prev,.carousel-control-next{position:absolute;top:0;bottom:0;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:0.5;-webkit-transition:opacity 0.15s ease;transition:opacity 0.15s ease}@media (prefers-reduced-motion: reduce){.carousel-control-prev,.carousel-control-next{-webkit-transition:none;transition:none}}.carousel-control-prev:hover,.carousel-control-prev:focus,.carousel-control-next:hover,.carousel-control-next:focus{color:#fff;text-decoration:none;outline:0;opacity:0.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-prev-icon,.carousel-control-next-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50% / 100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;-webkit-transition:opacity 0.6s ease;transition:opacity 0.6s ease}@media (prefers-reduced-motion: reduce){.carousel-indicators li{-webkit-transition:none;transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:0.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:0.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline !important}.align-top{vertical-align:top !important}.align-middle{vertical-align:middle !important}.align-bottom{vertical-align:bottom !important}.align-text-bottom{vertical-align:text-bottom !important}.align-text-top{vertical-align:text-top !important}.bg-primary{background-color:#375a7f !important}a.bg-primary:hover,a.bg-primary:focus,button.bg-primary:hover,button.bg-primary:focus{background-color:#28415b !important}.bg-secondary{background-color:#444 !important}a.bg-secondary:hover,a.bg-secondary:focus,button.bg-secondary:hover,button.bg-secondary:focus{background-color:#2b2a2a !important}.bg-success{background-color:#00bc8c !important}a.bg-success:hover,a.bg-success:focus,button.bg-success:hover,button.bg-success:focus{background-color:#008966 !important}.bg-info{background-color:#3498DB !important}a.bg-info:hover,a.bg-info:focus,button.bg-info:hover,button.bg-info:focus{background-color:#217dbb !important}.bg-warning{background-color:#F39C12 !important}a.bg-warning:hover,a.bg-warning:focus,button.bg-warning:hover,button.bg-warning:focus{background-color:#c87f0a !important}.bg-danger{background-color:#E74C3C !important}a.bg-danger:hover,a.bg-danger:focus,button.bg-danger:hover,button.bg-danger:focus{background-color:#d62c1a !important}.bg-light{background-color:#999 !important}a.bg-light:hover,a.bg-light:focus,button.bg-light:hover,button.bg-light:focus{background-color:#807f7f !important}.bg-dark{background-color:#303030 !important}a.bg-dark:hover,a.bg-dark:focus,button.bg-dark:hover,button.bg-dark:focus{background-color:#171616 !important}.bg-white{background-color:#fff !important}.bg-transparent{background-color:transparent !important}.border{border:1px solid #dee2e6 !important}.border-top{border-top:1px solid #dee2e6 !important}.border-right{border-right:1px solid #dee2e6 !important}.border-bottom{border-bottom:1px solid #dee2e6 !important}.border-left{border-left:1px solid #dee2e6 !important}.border-0{border:0 !important}.border-top-0{border-top:0 !important}.border-right-0{border-right:0 !important}.border-bottom-0{border-bottom:0 !important}.border-left-0{border-left:0 !important}.border-primary{border-color:#375a7f !important}.border-secondary{border-color:#444 !important}.border-success{border-color:#00bc8c !important}.border-info{border-color:#3498DB !important}.border-warning{border-color:#F39C12 !important}.border-danger{border-color:#E74C3C !important}.border-light{border-color:#999 !important}.border-dark{border-color:#303030 !important}.border-white{border-color:#fff !important}.rounded-sm{border-radius:0.2rem !important}.rounded{border-radius:0.25rem !important}.rounded-top{border-top-left-radius:0.25rem !important;border-top-right-radius:0.25rem !important}.rounded-right{border-top-right-radius:0.25rem !important;border-bottom-right-radius:0.25rem !important}.rounded-bottom{border-bottom-right-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-left{border-top-left-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-lg{border-radius:0.3rem !important}.rounded-circle{border-radius:50% !important}.rounded-pill{border-radius:50rem !important}.rounded-0{border-radius:0 !important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none !important}.d-inline{display:inline !important}.d-inline-block{display:inline-block !important}.d-block{display:block !important}.d-table{display:table !important}.d-table-row{display:table-row !important}.d-table-cell{display:table-cell !important}.d-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}@media (min-width: 576px){.d-sm-none{display:none !important}.d-sm-inline{display:inline !important}.d-sm-inline-block{display:inline-block !important}.d-sm-block{display:block !important}.d-sm-table{display:table !important}.d-sm-table-row{display:table-row !important}.d-sm-table-cell{display:table-cell !important}.d-sm-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-sm-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 768px){.d-md-none{display:none !important}.d-md-inline{display:inline !important}.d-md-inline-block{display:inline-block !important}.d-md-block{display:block !important}.d-md-table{display:table !important}.d-md-table-row{display:table-row !important}.d-md-table-cell{display:table-cell !important}.d-md-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-md-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 992px){.d-lg-none{display:none !important}.d-lg-inline{display:inline !important}.d-lg-inline-block{display:inline-block !important}.d-lg-block{display:block !important}.d-lg-table{display:table !important}.d-lg-table-row{display:table-row !important}.d-lg-table-cell{display:table-cell !important}.d-lg-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-lg-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 1200px){.d-xl-none{display:none !important}.d-xl-inline{display:inline !important}.d-xl-inline-block{display:inline-block !important}.d-xl-block{display:block !important}.d-xl-table{display:table !important}.d-xl-table-row{display:table-row !important}.d-xl-table-cell{display:table-cell !important}.d-xl-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-xl-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media print{.d-print-none{display:none !important}.d-print-inline{display:inline !important}.d-print-inline-block{display:inline-block !important}.d-print-block{display:block !important}.d-print-table{display:table !important}.d-print-table-row{display:table-row !important}.d-print-table-cell{display:table-cell !important}.d-print-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-print-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.8571428571%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}@media (min-width: 576px){.flex-sm-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-sm-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-sm-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-sm-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-sm-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-sm-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-sm-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-sm-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-sm-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-sm-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-sm-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-sm-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-sm-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-sm-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-sm-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-sm-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-sm-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-sm-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-sm-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-sm-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-sm-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-sm-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-sm-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-sm-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-sm-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-sm-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-sm-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-sm-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-sm-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-sm-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-sm-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-sm-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-sm-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 768px){.flex-md-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-md-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-md-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-md-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-md-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-md-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-md-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-md-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-md-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-md-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-md-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-md-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-md-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-md-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-md-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-md-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-md-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-md-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-md-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-md-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-md-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-md-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-md-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-md-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-md-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-md-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-md-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-md-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-md-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-md-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-md-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-md-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-md-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 992px){.flex-lg-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-lg-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-lg-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-lg-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-lg-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-lg-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-lg-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-lg-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-lg-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-lg-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-lg-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-lg-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-lg-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-lg-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-lg-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-lg-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-lg-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-lg-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-lg-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-lg-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-lg-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-lg-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-lg-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-lg-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-lg-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-lg-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-lg-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-lg-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-lg-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-lg-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-lg-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-lg-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-lg-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 1200px){.flex-xl-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-xl-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-xl-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-xl-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-xl-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-xl-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-xl-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-xl-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-xl-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-xl-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-xl-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-xl-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-xl-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-xl-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-xl-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-xl-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-xl-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-xl-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-xl-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-xl-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-xl-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-xl-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-xl-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-xl-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-xl-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-xl-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-xl-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-xl-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-xl-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-xl-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-xl-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-xl-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-xl-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}.float-left{float:left !important}.float-right{float:right !important}.float-none{float:none !important}@media (min-width: 576px){.float-sm-left{float:left !important}.float-sm-right{float:right !important}.float-sm-none{float:none !important}}@media (min-width: 768px){.float-md-left{float:left !important}.float-md-right{float:right !important}.float-md-none{float:none !important}}@media (min-width: 992px){.float-lg-left{float:left !important}.float-lg-right{float:right !important}.float-lg-none{float:none !important}}@media (min-width: 1200px){.float-xl-left{float:left !important}.float-xl-right{float:right !important}.float-xl-none{float:none !important}}.overflow-auto{overflow:auto !important}.overflow-hidden{overflow:hidden !important}.position-static{position:static !important}.position-relative{position:relative !important}.position-absolute{position:absolute !important}.position-fixed{position:fixed !important}.position-sticky{position:-webkit-sticky !important;position:sticky !important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports (position: -webkit-sticky) or (position: sticky){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{-webkit-box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important}.shadow{-webkit-box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important;box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important}.shadow-lg{-webkit-box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important;box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important}.shadow-none{-webkit-box-shadow:none !important;box-shadow:none !important}.w-25{width:25% !important}.w-50{width:50% !important}.w-75{width:75% !important}.w-100{width:100% !important}.w-auto{width:auto !important}.h-25{height:25% !important}.h-50{height:50% !important}.h-75{height:75% !important}.h-100{height:100% !important}.h-auto{height:auto !important}.mw-100{max-width:100% !important}.mh-100{max-height:100% !important}.min-vw-100{min-width:100vw !important}.min-vh-100{min-height:100vh !important}.vw-100{width:100vw !important}.vh-100{height:100vh !important}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.m-0{margin:0 !important}.mt-0,.my-0{margin-top:0 !important}.mr-0,.mx-0{margin-right:0 !important}.mb-0,.my-0{margin-bottom:0 !important}.ml-0,.mx-0{margin-left:0 !important}.m-1{margin:0.25rem !important}.mt-1,.my-1{margin-top:0.25rem !important}.mr-1,.mx-1{margin-right:0.25rem !important}.mb-1,.my-1{margin-bottom:0.25rem !important}.ml-1,.mx-1{margin-left:0.25rem !important}.m-2{margin:0.5rem !important}.mt-2,.my-2{margin-top:0.5rem !important}.mr-2,.mx-2{margin-right:0.5rem !important}.mb-2,.my-2{margin-bottom:0.5rem !important}.ml-2,.mx-2{margin-left:0.5rem !important}.m-3{margin:1rem !important}.mt-3,.my-3{margin-top:1rem !important}.mr-3,.mx-3{margin-right:1rem !important}.mb-3,.my-3{margin-bottom:1rem !important}.ml-3,.mx-3{margin-left:1rem !important}.m-4{margin:1.5rem !important}.mt-4,.my-4{margin-top:1.5rem !important}.mr-4,.mx-4{margin-right:1.5rem !important}.mb-4,.my-4{margin-bottom:1.5rem !important}.ml-4,.mx-4{margin-left:1.5rem !important}.m-5{margin:3rem !important}.mt-5,.my-5{margin-top:3rem !important}.mr-5,.mx-5{margin-right:3rem !important}.mb-5,.my-5{margin-bottom:3rem !important}.ml-5,.mx-5{margin-left:3rem !important}.p-0{padding:0 !important}.pt-0,.py-0{padding-top:0 !important}.pr-0,.px-0{padding-right:0 !important}.pb-0,.py-0{padding-bottom:0 !important}.pl-0,.px-0{padding-left:0 !important}.p-1{padding:0.25rem !important}.pt-1,.py-1{padding-top:0.25rem !important}.pr-1,.px-1{padding-right:0.25rem !important}.pb-1,.py-1{padding-bottom:0.25rem !important}.pl-1,.px-1{padding-left:0.25rem !important}.p-2{padding:0.5rem !important}.pt-2,.py-2{padding-top:0.5rem !important}.pr-2,.px-2{padding-right:0.5rem !important}.pb-2,.py-2{padding-bottom:0.5rem !important}.pl-2,.px-2{padding-left:0.5rem !important}.p-3{padding:1rem !important}.pt-3,.py-3{padding-top:1rem !important}.pr-3,.px-3{padding-right:1rem !important}.pb-3,.py-3{padding-bottom:1rem !important}.pl-3,.px-3{padding-left:1rem !important}.p-4{padding:1.5rem !important}.pt-4,.py-4{padding-top:1.5rem !important}.pr-4,.px-4{padding-right:1.5rem !important}.pb-4,.py-4{padding-bottom:1.5rem !important}.pl-4,.px-4{padding-left:1.5rem !important}.p-5{padding:3rem !important}.pt-5,.py-5{padding-top:3rem !important}.pr-5,.px-5{padding-right:3rem !important}.pb-5,.py-5{padding-bottom:3rem !important}.pl-5,.px-5{padding-left:3rem !important}.m-n1{margin:-0.25rem !important}.mt-n1,.my-n1{margin-top:-0.25rem !important}.mr-n1,.mx-n1{margin-right:-0.25rem !important}.mb-n1,.my-n1{margin-bottom:-0.25rem !important}.ml-n1,.mx-n1{margin-left:-0.25rem !important}.m-n2{margin:-0.5rem !important}.mt-n2,.my-n2{margin-top:-0.5rem !important}.mr-n2,.mx-n2{margin-right:-0.5rem !important}.mb-n2,.my-n2{margin-bottom:-0.5rem !important}.ml-n2,.mx-n2{margin-left:-0.5rem !important}.m-n3{margin:-1rem !important}.mt-n3,.my-n3{margin-top:-1rem !important}.mr-n3,.mx-n3{margin-right:-1rem !important}.mb-n3,.my-n3{margin-bottom:-1rem !important}.ml-n3,.mx-n3{margin-left:-1rem !important}.m-n4{margin:-1.5rem !important}.mt-n4,.my-n4{margin-top:-1.5rem !important}.mr-n4,.mx-n4{margin-right:-1.5rem !important}.mb-n4,.my-n4{margin-bottom:-1.5rem !important}.ml-n4,.mx-n4{margin-left:-1.5rem !important}.m-n5{margin:-3rem !important}.mt-n5,.my-n5{margin-top:-3rem !important}.mr-n5,.mx-n5{margin-right:-3rem !important}.mb-n5,.my-n5{margin-bottom:-3rem !important}.ml-n5,.mx-n5{margin-left:-3rem !important}.m-auto{margin:auto !important}.mt-auto,.my-auto{margin-top:auto !important}.mr-auto,.mx-auto{margin-right:auto !important}.mb-auto,.my-auto{margin-bottom:auto !important}.ml-auto,.mx-auto{margin-left:auto !important}@media (min-width: 576px){.m-sm-0{margin:0 !important}.mt-sm-0,.my-sm-0{margin-top:0 !important}.mr-sm-0,.mx-sm-0{margin-right:0 !important}.mb-sm-0,.my-sm-0{margin-bottom:0 !important}.ml-sm-0,.mx-sm-0{margin-left:0 !important}.m-sm-1{margin:0.25rem !important}.mt-sm-1,.my-sm-1{margin-top:0.25rem !important}.mr-sm-1,.mx-sm-1{margin-right:0.25rem !important}.mb-sm-1,.my-sm-1{margin-bottom:0.25rem !important}.ml-sm-1,.mx-sm-1{margin-left:0.25rem !important}.m-sm-2{margin:0.5rem !important}.mt-sm-2,.my-sm-2{margin-top:0.5rem !important}.mr-sm-2,.mx-sm-2{margin-right:0.5rem !important}.mb-sm-2,.my-sm-2{margin-bottom:0.5rem !important}.ml-sm-2,.mx-sm-2{margin-left:0.5rem !important}.m-sm-3{margin:1rem !important}.mt-sm-3,.my-sm-3{margin-top:1rem !important}.mr-sm-3,.mx-sm-3{margin-right:1rem !important}.mb-sm-3,.my-sm-3{margin-bottom:1rem !important}.ml-sm-3,.mx-sm-3{margin-left:1rem !important}.m-sm-4{margin:1.5rem !important}.mt-sm-4,.my-sm-4{margin-top:1.5rem !important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem !important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem !important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem !important}.m-sm-5{margin:3rem !important}.mt-sm-5,.my-sm-5{margin-top:3rem !important}.mr-sm-5,.mx-sm-5{margin-right:3rem !important}.mb-sm-5,.my-sm-5{margin-bottom:3rem !important}.ml-sm-5,.mx-sm-5{margin-left:3rem !important}.p-sm-0{padding:0 !important}.pt-sm-0,.py-sm-0{padding-top:0 !important}.pr-sm-0,.px-sm-0{padding-right:0 !important}.pb-sm-0,.py-sm-0{padding-bottom:0 !important}.pl-sm-0,.px-sm-0{padding-left:0 !important}.p-sm-1{padding:0.25rem !important}.pt-sm-1,.py-sm-1{padding-top:0.25rem !important}.pr-sm-1,.px-sm-1{padding-right:0.25rem !important}.pb-sm-1,.py-sm-1{padding-bottom:0.25rem !important}.pl-sm-1,.px-sm-1{padding-left:0.25rem !important}.p-sm-2{padding:0.5rem !important}.pt-sm-2,.py-sm-2{padding-top:0.5rem !important}.pr-sm-2,.px-sm-2{padding-right:0.5rem !important}.pb-sm-2,.py-sm-2{padding-bottom:0.5rem !important}.pl-sm-2,.px-sm-2{padding-left:0.5rem !important}.p-sm-3{padding:1rem !important}.pt-sm-3,.py-sm-3{padding-top:1rem !important}.pr-sm-3,.px-sm-3{padding-right:1rem !important}.pb-sm-3,.py-sm-3{padding-bottom:1rem !important}.pl-sm-3,.px-sm-3{padding-left:1rem !important}.p-sm-4{padding:1.5rem !important}.pt-sm-4,.py-sm-4{padding-top:1.5rem !important}.pr-sm-4,.px-sm-4{padding-right:1.5rem !important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem !important}.pl-sm-4,.px-sm-4{padding-left:1.5rem !important}.p-sm-5{padding:3rem !important}.pt-sm-5,.py-sm-5{padding-top:3rem !important}.pr-sm-5,.px-sm-5{padding-right:3rem !important}.pb-sm-5,.py-sm-5{padding-bottom:3rem !important}.pl-sm-5,.px-sm-5{padding-left:3rem !important}.m-sm-n1{margin:-0.25rem !important}.mt-sm-n1,.my-sm-n1{margin-top:-0.25rem !important}.mr-sm-n1,.mx-sm-n1{margin-right:-0.25rem !important}.mb-sm-n1,.my-sm-n1{margin-bottom:-0.25rem !important}.ml-sm-n1,.mx-sm-n1{margin-left:-0.25rem !important}.m-sm-n2{margin:-0.5rem !important}.mt-sm-n2,.my-sm-n2{margin-top:-0.5rem !important}.mr-sm-n2,.mx-sm-n2{margin-right:-0.5rem !important}.mb-sm-n2,.my-sm-n2{margin-bottom:-0.5rem !important}.ml-sm-n2,.mx-sm-n2{margin-left:-0.5rem !important}.m-sm-n3{margin:-1rem !important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem !important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem !important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem !important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem !important}.m-sm-n4{margin:-1.5rem !important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem !important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem !important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem !important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem !important}.m-sm-n5{margin:-3rem !important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem !important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem !important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem !important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem !important}.m-sm-auto{margin:auto !important}.mt-sm-auto,.my-sm-auto{margin-top:auto !important}.mr-sm-auto,.mx-sm-auto{margin-right:auto !important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto !important}.ml-sm-auto,.mx-sm-auto{margin-left:auto !important}}@media (min-width: 768px){.m-md-0{margin:0 !important}.mt-md-0,.my-md-0{margin-top:0 !important}.mr-md-0,.mx-md-0{margin-right:0 !important}.mb-md-0,.my-md-0{margin-bottom:0 !important}.ml-md-0,.mx-md-0{margin-left:0 !important}.m-md-1{margin:0.25rem !important}.mt-md-1,.my-md-1{margin-top:0.25rem !important}.mr-md-1,.mx-md-1{margin-right:0.25rem !important}.mb-md-1,.my-md-1{margin-bottom:0.25rem !important}.ml-md-1,.mx-md-1{margin-left:0.25rem !important}.m-md-2{margin:0.5rem !important}.mt-md-2,.my-md-2{margin-top:0.5rem !important}.mr-md-2,.mx-md-2{margin-right:0.5rem !important}.mb-md-2,.my-md-2{margin-bottom:0.5rem !important}.ml-md-2,.mx-md-2{margin-left:0.5rem !important}.m-md-3{margin:1rem !important}.mt-md-3,.my-md-3{margin-top:1rem !important}.mr-md-3,.mx-md-3{margin-right:1rem !important}.mb-md-3,.my-md-3{margin-bottom:1rem !important}.ml-md-3,.mx-md-3{margin-left:1rem !important}.m-md-4{margin:1.5rem !important}.mt-md-4,.my-md-4{margin-top:1.5rem !important}.mr-md-4,.mx-md-4{margin-right:1.5rem !important}.mb-md-4,.my-md-4{margin-bottom:1.5rem !important}.ml-md-4,.mx-md-4{margin-left:1.5rem !important}.m-md-5{margin:3rem !important}.mt-md-5,.my-md-5{margin-top:3rem !important}.mr-md-5,.mx-md-5{margin-right:3rem !important}.mb-md-5,.my-md-5{margin-bottom:3rem !important}.ml-md-5,.mx-md-5{margin-left:3rem !important}.p-md-0{padding:0 !important}.pt-md-0,.py-md-0{padding-top:0 !important}.pr-md-0,.px-md-0{padding-right:0 !important}.pb-md-0,.py-md-0{padding-bottom:0 !important}.pl-md-0,.px-md-0{padding-left:0 !important}.p-md-1{padding:0.25rem !important}.pt-md-1,.py-md-1{padding-top:0.25rem !important}.pr-md-1,.px-md-1{padding-right:0.25rem !important}.pb-md-1,.py-md-1{padding-bottom:0.25rem !important}.pl-md-1,.px-md-1{padding-left:0.25rem !important}.p-md-2{padding:0.5rem !important}.pt-md-2,.py-md-2{padding-top:0.5rem !important}.pr-md-2,.px-md-2{padding-right:0.5rem !important}.pb-md-2,.py-md-2{padding-bottom:0.5rem !important}.pl-md-2,.px-md-2{padding-left:0.5rem !important}.p-md-3{padding:1rem !important}.pt-md-3,.py-md-3{padding-top:1rem !important}.pr-md-3,.px-md-3{padding-right:1rem !important}.pb-md-3,.py-md-3{padding-bottom:1rem !important}.pl-md-3,.px-md-3{padding-left:1rem !important}.p-md-4{padding:1.5rem !important}.pt-md-4,.py-md-4{padding-top:1.5rem !important}.pr-md-4,.px-md-4{padding-right:1.5rem !important}.pb-md-4,.py-md-4{padding-bottom:1.5rem !important}.pl-md-4,.px-md-4{padding-left:1.5rem !important}.p-md-5{padding:3rem !important}.pt-md-5,.py-md-5{padding-top:3rem !important}.pr-md-5,.px-md-5{padding-right:3rem !important}.pb-md-5,.py-md-5{padding-bottom:3rem !important}.pl-md-5,.px-md-5{padding-left:3rem !important}.m-md-n1{margin:-0.25rem !important}.mt-md-n1,.my-md-n1{margin-top:-0.25rem !important}.mr-md-n1,.mx-md-n1{margin-right:-0.25rem !important}.mb-md-n1,.my-md-n1{margin-bottom:-0.25rem !important}.ml-md-n1,.mx-md-n1{margin-left:-0.25rem !important}.m-md-n2{margin:-0.5rem !important}.mt-md-n2,.my-md-n2{margin-top:-0.5rem !important}.mr-md-n2,.mx-md-n2{margin-right:-0.5rem !important}.mb-md-n2,.my-md-n2{margin-bottom:-0.5rem !important}.ml-md-n2,.mx-md-n2{margin-left:-0.5rem !important}.m-md-n3{margin:-1rem !important}.mt-md-n3,.my-md-n3{margin-top:-1rem !important}.mr-md-n3,.mx-md-n3{margin-right:-1rem !important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem !important}.ml-md-n3,.mx-md-n3{margin-left:-1rem !important}.m-md-n4{margin:-1.5rem !important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem !important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem !important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem !important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem !important}.m-md-n5{margin:-3rem !important}.mt-md-n5,.my-md-n5{margin-top:-3rem !important}.mr-md-n5,.mx-md-n5{margin-right:-3rem !important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem !important}.ml-md-n5,.mx-md-n5{margin-left:-3rem !important}.m-md-auto{margin:auto !important}.mt-md-auto,.my-md-auto{margin-top:auto !important}.mr-md-auto,.mx-md-auto{margin-right:auto !important}.mb-md-auto,.my-md-auto{margin-bottom:auto !important}.ml-md-auto,.mx-md-auto{margin-left:auto !important}}@media (min-width: 992px){.m-lg-0{margin:0 !important}.mt-lg-0,.my-lg-0{margin-top:0 !important}.mr-lg-0,.mx-lg-0{margin-right:0 !important}.mb-lg-0,.my-lg-0{margin-bottom:0 !important}.ml-lg-0,.mx-lg-0{margin-left:0 !important}.m-lg-1{margin:0.25rem !important}.mt-lg-1,.my-lg-1{margin-top:0.25rem !important}.mr-lg-1,.mx-lg-1{margin-right:0.25rem !important}.mb-lg-1,.my-lg-1{margin-bottom:0.25rem !important}.ml-lg-1,.mx-lg-1{margin-left:0.25rem !important}.m-lg-2{margin:0.5rem !important}.mt-lg-2,.my-lg-2{margin-top:0.5rem !important}.mr-lg-2,.mx-lg-2{margin-right:0.5rem !important}.mb-lg-2,.my-lg-2{margin-bottom:0.5rem !important}.ml-lg-2,.mx-lg-2{margin-left:0.5rem !important}.m-lg-3{margin:1rem !important}.mt-lg-3,.my-lg-3{margin-top:1rem !important}.mr-lg-3,.mx-lg-3{margin-right:1rem !important}.mb-lg-3,.my-lg-3{margin-bottom:1rem !important}.ml-lg-3,.mx-lg-3{margin-left:1rem !important}.m-lg-4{margin:1.5rem !important}.mt-lg-4,.my-lg-4{margin-top:1.5rem !important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem !important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem !important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem !important}.m-lg-5{margin:3rem !important}.mt-lg-5,.my-lg-5{margin-top:3rem !important}.mr-lg-5,.mx-lg-5{margin-right:3rem !important}.mb-lg-5,.my-lg-5{margin-bottom:3rem !important}.ml-lg-5,.mx-lg-5{margin-left:3rem !important}.p-lg-0{padding:0 !important}.pt-lg-0,.py-lg-0{padding-top:0 !important}.pr-lg-0,.px-lg-0{padding-right:0 !important}.pb-lg-0,.py-lg-0{padding-bottom:0 !important}.pl-lg-0,.px-lg-0{padding-left:0 !important}.p-lg-1{padding:0.25rem !important}.pt-lg-1,.py-lg-1{padding-top:0.25rem !important}.pr-lg-1,.px-lg-1{padding-right:0.25rem !important}.pb-lg-1,.py-lg-1{padding-bottom:0.25rem !important}.pl-lg-1,.px-lg-1{padding-left:0.25rem !important}.p-lg-2{padding:0.5rem !important}.pt-lg-2,.py-lg-2{padding-top:0.5rem !important}.pr-lg-2,.px-lg-2{padding-right:0.5rem !important}.pb-lg-2,.py-lg-2{padding-bottom:0.5rem !important}.pl-lg-2,.px-lg-2{padding-left:0.5rem !important}.p-lg-3{padding:1rem !important}.pt-lg-3,.py-lg-3{padding-top:1rem !important}.pr-lg-3,.px-lg-3{padding-right:1rem !important}.pb-lg-3,.py-lg-3{padding-bottom:1rem !important}.pl-lg-3,.px-lg-3{padding-left:1rem !important}.p-lg-4{padding:1.5rem !important}.pt-lg-4,.py-lg-4{padding-top:1.5rem !important}.pr-lg-4,.px-lg-4{padding-right:1.5rem !important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem !important}.pl-lg-4,.px-lg-4{padding-left:1.5rem !important}.p-lg-5{padding:3rem !important}.pt-lg-5,.py-lg-5{padding-top:3rem !important}.pr-lg-5,.px-lg-5{padding-right:3rem !important}.pb-lg-5,.py-lg-5{padding-bottom:3rem !important}.pl-lg-5,.px-lg-5{padding-left:3rem !important}.m-lg-n1{margin:-0.25rem !important}.mt-lg-n1,.my-lg-n1{margin-top:-0.25rem !important}.mr-lg-n1,.mx-lg-n1{margin-right:-0.25rem !important}.mb-lg-n1,.my-lg-n1{margin-bottom:-0.25rem !important}.ml-lg-n1,.mx-lg-n1{margin-left:-0.25rem !important}.m-lg-n2{margin:-0.5rem !important}.mt-lg-n2,.my-lg-n2{margin-top:-0.5rem !important}.mr-lg-n2,.mx-lg-n2{margin-right:-0.5rem !important}.mb-lg-n2,.my-lg-n2{margin-bottom:-0.5rem !important}.ml-lg-n2,.mx-lg-n2{margin-left:-0.5rem !important}.m-lg-n3{margin:-1rem !important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem !important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem !important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem !important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem !important}.m-lg-n4{margin:-1.5rem !important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem !important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem !important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem !important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem !important}.m-lg-n5{margin:-3rem !important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem !important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem !important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem !important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem !important}.m-lg-auto{margin:auto !important}.mt-lg-auto,.my-lg-auto{margin-top:auto !important}.mr-lg-auto,.mx-lg-auto{margin-right:auto !important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto !important}.ml-lg-auto,.mx-lg-auto{margin-left:auto !important}}@media (min-width: 1200px){.m-xl-0{margin:0 !important}.mt-xl-0,.my-xl-0{margin-top:0 !important}.mr-xl-0,.mx-xl-0{margin-right:0 !important}.mb-xl-0,.my-xl-0{margin-bottom:0 !important}.ml-xl-0,.mx-xl-0{margin-left:0 !important}.m-xl-1{margin:0.25rem !important}.mt-xl-1,.my-xl-1{margin-top:0.25rem !important}.mr-xl-1,.mx-xl-1{margin-right:0.25rem !important}.mb-xl-1,.my-xl-1{margin-bottom:0.25rem !important}.ml-xl-1,.mx-xl-1{margin-left:0.25rem !important}.m-xl-2{margin:0.5rem !important}.mt-xl-2,.my-xl-2{margin-top:0.5rem !important}.mr-xl-2,.mx-xl-2{margin-right:0.5rem !important}.mb-xl-2,.my-xl-2{margin-bottom:0.5rem !important}.ml-xl-2,.mx-xl-2{margin-left:0.5rem !important}.m-xl-3{margin:1rem !important}.mt-xl-3,.my-xl-3{margin-top:1rem !important}.mr-xl-3,.mx-xl-3{margin-right:1rem !important}.mb-xl-3,.my-xl-3{margin-bottom:1rem !important}.ml-xl-3,.mx-xl-3{margin-left:1rem !important}.m-xl-4{margin:1.5rem !important}.mt-xl-4,.my-xl-4{margin-top:1.5rem !important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem !important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem !important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem !important}.m-xl-5{margin:3rem !important}.mt-xl-5,.my-xl-5{margin-top:3rem !important}.mr-xl-5,.mx-xl-5{margin-right:3rem !important}.mb-xl-5,.my-xl-5{margin-bottom:3rem !important}.ml-xl-5,.mx-xl-5{margin-left:3rem !important}.p-xl-0{padding:0 !important}.pt-xl-0,.py-xl-0{padding-top:0 !important}.pr-xl-0,.px-xl-0{padding-right:0 !important}.pb-xl-0,.py-xl-0{padding-bottom:0 !important}.pl-xl-0,.px-xl-0{padding-left:0 !important}.p-xl-1{padding:0.25rem !important}.pt-xl-1,.py-xl-1{padding-top:0.25rem !important}.pr-xl-1,.px-xl-1{padding-right:0.25rem !important}.pb-xl-1,.py-xl-1{padding-bottom:0.25rem !important}.pl-xl-1,.px-xl-1{padding-left:0.25rem !important}.p-xl-2{padding:0.5rem !important}.pt-xl-2,.py-xl-2{padding-top:0.5rem !important}.pr-xl-2,.px-xl-2{padding-right:0.5rem !important}.pb-xl-2,.py-xl-2{padding-bottom:0.5rem !important}.pl-xl-2,.px-xl-2{padding-left:0.5rem !important}.p-xl-3{padding:1rem !important}.pt-xl-3,.py-xl-3{padding-top:1rem !important}.pr-xl-3,.px-xl-3{padding-right:1rem !important}.pb-xl-3,.py-xl-3{padding-bottom:1rem !important}.pl-xl-3,.px-xl-3{padding-left:1rem !important}.p-xl-4{padding:1.5rem !important}.pt-xl-4,.py-xl-4{padding-top:1.5rem !important}.pr-xl-4,.px-xl-4{padding-right:1.5rem !important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem !important}.pl-xl-4,.px-xl-4{padding-left:1.5rem !important}.p-xl-5{padding:3rem !important}.pt-xl-5,.py-xl-5{padding-top:3rem !important}.pr-xl-5,.px-xl-5{padding-right:3rem !important}.pb-xl-5,.py-xl-5{padding-bottom:3rem !important}.pl-xl-5,.px-xl-5{padding-left:3rem !important}.m-xl-n1{margin:-0.25rem !important}.mt-xl-n1,.my-xl-n1{margin-top:-0.25rem !important}.mr-xl-n1,.mx-xl-n1{margin-right:-0.25rem !important}.mb-xl-n1,.my-xl-n1{margin-bottom:-0.25rem !important}.ml-xl-n1,.mx-xl-n1{margin-left:-0.25rem !important}.m-xl-n2{margin:-0.5rem !important}.mt-xl-n2,.my-xl-n2{margin-top:-0.5rem !important}.mr-xl-n2,.mx-xl-n2{margin-right:-0.5rem !important}.mb-xl-n2,.my-xl-n2{margin-bottom:-0.5rem !important}.ml-xl-n2,.mx-xl-n2{margin-left:-0.5rem !important}.m-xl-n3{margin:-1rem !important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem !important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem !important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem !important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem !important}.m-xl-n4{margin:-1.5rem !important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem !important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem !important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem !important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem !important}.m-xl-n5{margin:-3rem !important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem !important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem !important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem !important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem !important}.m-xl-auto{margin:auto !important}.mt-xl-auto,.my-xl-auto{margin-top:auto !important}.mr-xl-auto,.mx-xl-auto{margin-right:auto !important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto !important}.ml-xl-auto,.mx-xl-auto{margin-left:auto !important}}.text-monospace{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important}.text-justify{text-align:justify !important}.text-wrap{white-space:normal !important}.text-nowrap{white-space:nowrap !important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left !important}.text-right{text-align:right !important}.text-center{text-align:center !important}@media (min-width: 576px){.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}.text-sm-center{text-align:center !important}}@media (min-width: 768px){.text-md-left{text-align:left !important}.text-md-right{text-align:right !important}.text-md-center{text-align:center !important}}@media (min-width: 992px){.text-lg-left{text-align:left !important}.text-lg-right{text-align:right !important}.text-lg-center{text-align:center !important}}@media (min-width: 1200px){.text-xl-left{text-align:left !important}.text-xl-right{text-align:right !important}.text-xl-center{text-align:center !important}}.text-lowercase{text-transform:lowercase !important}.text-uppercase{text-transform:uppercase !important}.text-capitalize{text-transform:capitalize !important}.font-weight-light{font-weight:300 !important}.font-weight-lighter{font-weight:lighter !important}.font-weight-normal{font-weight:400 !important}.font-weight-bold{font-weight:700 !important}.font-weight-bolder{font-weight:bolder !important}.font-italic{font-style:italic !important}.text-white{color:#fff !important}.text-primary{color:#375a7f !important}a.text-primary:hover,a.text-primary:focus{color:#20344a !important}.text-secondary{color:#444 !important}a.text-secondary:hover,a.text-secondary:focus{color:#1e1e1e !important}.text-success{color:#00bc8c !important}a.text-success:hover,a.text-success:focus{color:#007053 !important}.text-info{color:#3498DB !important}a.text-info:hover,a.text-info:focus{color:#1d6fa5 !important}.text-warning{color:#F39C12 !important}a.text-warning:hover,a.text-warning:focus{color:#b06f09 !important}.text-danger{color:#E74C3C !important}a.text-danger:hover,a.text-danger:focus{color:#bf2718 !important}.text-light{color:#999 !important}a.text-light:hover,a.text-light:focus{color:#737373 !important}.text-dark{color:#303030 !important}a.text-dark:hover,a.text-dark:focus{color:#0a0a0a !important}.text-body{color:#fff !important}.text-muted{color:#999 !important}.text-black-50{color:rgba(0,0,0,0.5) !important}.text-white-50{color:rgba(255,255,255,0.5) !important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none !important}.text-break{word-break:break-word !important;overflow-wrap:break-word !important}.text-reset{color:inherit !important}.visible{visibility:visible !important}.invisible{visibility:hidden !important}@media print{*,*::before,*::after{text-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap !important}pre,blockquote{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px !important}.container{min-width:992px !important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #dee2e6 !important}.table-dark{color:inherit}.table-dark th,.table-dark td,.table-dark thead th,.table-dark tbody+tbody{border-color:#444}.table .thead-dark th{color:inherit;border-color:#444}}.bg-primary .navbar-nav .active>.nav-link{color:#00bc8c !important}.bg-light.navbar{background-color:#00bc8c !important}.bg-light.navbar-light .navbar-nav .nav-link:focus,.bg-light.navbar-light .navbar-nav .nav-link:hover,.bg-light.navbar-light .navbar-nav .active>.nav-link{color:#375a7f !important}.blockquote-footer{color:#999}.table-primary,.table-primary>th,.table-primary>td{background-color:#375a7f}.table-secondary,.table-secondary>th,.table-secondary>td{background-color:#444}.table-light,.table-light>th,.table-light>td{background-color:#999}.table-dark,.table-dark>th,.table-dark>td{background-color:#303030}.table-success,.table-success>th,.table-success>td{background-color:#00bc8c}.table-info,.table-info>th,.table-info>td{background-color:#3498DB}.table-danger,.table-danger>th,.table-danger>td{background-color:#E74C3C}.table-warning,.table-warning>th,.table-warning>td{background-color:#F39C12}.table-active,.table-active>th,.table-active>td{background-color:rgba(0,0,0,0.075)}.table-hover .table-primary:hover,.table-hover .table-primary:hover>th,.table-hover .table-primary:hover>td{background-color:#2f4d6d}.table-hover .table-secondary:hover,.table-hover .table-secondary:hover>th,.table-hover .table-secondary:hover>td{background-color:#373737}.table-hover .table-light:hover,.table-hover .table-light:hover>th,.table-hover .table-light:hover>td{background-color:#8c8c8c}.table-hover .table-dark:hover,.table-hover .table-dark:hover>th,.table-hover .table-dark:hover>td{background-color:#232323}.table-hover .table-success:hover,.table-hover .table-success:hover>th,.table-hover .table-success:hover>td{background-color:#00a379}.table-hover .table-info:hover,.table-hover .table-info:hover>th,.table-hover .table-info:hover>td{background-color:#258cd1}.table-hover .table-danger:hover,.table-hover .table-danger:hover>th,.table-hover .table-danger:hover>td{background-color:#e43725}.table-hover .table-warning:hover,.table-hover .table-warning:hover>th,.table-hover .table-warning:hover>td{background-color:#e08e0b}.table-hover .table-active:hover,.table-hover .table-active:hover>th,.table-hover .table-active:hover>td{background-color:rgba(0,0,0,0.075)}.input-group-addon{color:#fff}.nav-tabs .nav-link,.nav-tabs .nav-link.active,.nav-tabs .nav-link.active:focus,.nav-tabs .nav-link.active:hover,.nav-tabs .nav-item.open .nav-link,.nav-tabs .nav-item.open .nav-link:focus,.nav-tabs .nav-item.open .nav-link:hover,.nav-pills .nav-link,.nav-pills .nav-link.active,.nav-pills .nav-link.active:focus,.nav-pills .nav-link.active:hover,.nav-pills .nav-item.open .nav-link,.nav-pills .nav-item.open .nav-link:focus,.nav-pills .nav-item.open .nav-link:hover{color:#fff}.breadcrumb a{color:#fff}.pagination a:hover{text-decoration:none}.close{opacity:0.4}.close:hover,.close:focus{opacity:1}.alert{border:none;color:#fff}.alert a,.alert .alert-link{color:#fff;text-decoration:underline}.alert-primary{background-color:#375a7f}.alert-secondary{background-color:#444}.alert-success{background-color:#00bc8c}.alert-info{background-color:#3498DB}.alert-warning{background-color:#F39C12}.alert-danger{background-color:#E74C3C}.alert-light{background-color:#999}.alert-dark{background-color:#303030}.list-group-item-action{color:#fff}.list-group-item-action:hover,.list-group-item-action:focus{background-color:#444;color:#fff}.list-group-item-action .list-group-item-heading{color:#fff} diff --git a/docs/site/css/font-awesome.min.css b/docs/site/css/font-awesome.min.css deleted file mode 100644 index 540440c..0000000 --- a/docs/site/css/font-awesome.min.css +++ /dev/null @@ -1,4 +0,0 @@ -/*! - * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome - * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/docs/site/documentation/gpopt/index.html b/docs/site/documentation/gpopt/index.html deleted file mode 100644 index 713271b..0000000 --- a/docs/site/documentation/gpopt/index.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - GPopt - Techtonique/GPopt - - - - - - - - - - - - -
-
-
-
- -

GPopt

-

Bayesian optimization using Gaussian Process Regression

-

[source]

-

GPOpt

-
GPopt.GPOpt.GPOpt.GPOpt(
-    lower_bound,
-    upper_bound,
-    objective_func=None,
-    x_init=None,
-    y_init=None,
-    n_init=10,
-    n_choices=25000,
-    n_iter=190,
-    alpha=1e-06,
-    n_restarts_optimizer=25,
-    seed=123,
-    save=None,
-    n_jobs=1,
-    per_second=False,
-    log_scale=False,
-)
-
-

Class GPOpt.

-

Arguments:

-

lower_bound: a numpy array; - lower bound for researched minimum

-

upper_bound: a numpy array; - upper bound for researched minimum

-

objective_func: a function; - the objective function to be minimized

-

x_init: - initial setting of points where objective_func is evaluated (optional)

-

y_init: - initial setting values at points where objective_func is evaluated (optional)

-

n_init: an integer; - number of points in the initial setting, when x_init and y_init are not provided

-

n_choices: an integer; - number of points for the calculation of expected improvement

-

n_iter: an integer; - number of iterations of the minimization algorithm

-

alpha: a float; - Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)

-

n_restarts_optimizer: an integer; - The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood.

-

seed: an integer; - reproducibility seed

-

save: a string; - Specifies where to save the optimizer in its current state

-

n_jobs: an integer; - number of jobs for parallel computing on initial setting (can be -1)

-

per_second: a boolean; - experimental, default is False (leave to default for now)

-

log_scale: a boolean; - experimental, default is False (leave to default for now)

-

see also Bayesian Optimization with GPopt - and Hyperparameters tuning with GPopt

-
-

[source]

-

optimize

-
GPOpt.optimize(verbose=1, n_more_iter=None, abs_tol=None, min_budget=50, func_args=None)
-
-

Launch optimization loop.

-

Arguments:

-

verbose: an integer; - verbose = 0: nothing is printed, - verbose = 1: a progress bar is printed (longer than 0), - verbose = 2: information about each iteration is printed (longer than 1)

-

n_more_iter: an integer; - additional number of iterations for the optimizer (which has been run once)

-

abs_tol: a float; - tolerance for convergence of the optimizer (early stopping based on expected improvement)

-

min_budget: an integer (default is 50); - minimum number of iterations before early stopping controlled by abs_tol

-

func_args: a list; - additional parameters for the objective function (if necessary)

-

see also Bayesian Optimization with GPopt -and Hyperparameters tuning with GPopt

-
-

[source]

-

load

-
GPOpt.load(path)
-
-

load data from stored shelve.

-

Arguments

-

path : a string; path to stored shelve.

-

See also: Bayesian Optimization with GPopt Part 2 (save and resume)

-
-

[source]

-

close_shelve

-
GPOpt.close_shelve()
-
-

Close shelve.

-

Arguments

-

No argument.

-

See also: Bayesian Optimization with GPopt Part 2 (save and resume)

-
-
-
- -
-
-

Documentation built with MkDocs.

-
- - - - - - - - - - diff --git a/docs/site/fonts/fontawesome-webfont.eot b/docs/site/fonts/fontawesome-webfont.eot deleted file mode 100644 index e9f60ca..0000000 Binary files a/docs/site/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/docs/site/fonts/fontawesome-webfont.svg b/docs/site/fonts/fontawesome-webfont.svg deleted file mode 100644 index 855c845..0000000 --- a/docs/site/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/site/fonts/fontawesome-webfont.ttf b/docs/site/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 35acda2..0000000 Binary files a/docs/site/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/docs/site/fonts/fontawesome-webfont.woff b/docs/site/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a..0000000 Binary files a/docs/site/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/docs/site/fonts/fontawesome-webfont.woff2 b/docs/site/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc6..0000000 Binary files a/docs/site/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/docs/site/img/favicon.ico b/docs/site/img/favicon.ico deleted file mode 100644 index e85006a..0000000 Binary files a/docs/site/img/favicon.ico and /dev/null differ diff --git a/docs/site/img/grid.png b/docs/site/img/grid.png deleted file mode 100644 index 878c3ed..0000000 Binary files a/docs/site/img/grid.png and /dev/null differ diff --git a/docs/site/index.html b/docs/site/index.html deleted file mode 100644 index 2540985..0000000 --- a/docs/site/index.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - Techtonique/GPopt - - - - - - - - - - - - -
-
-
-
- -

GPopt | Star

-

PyPI PyPI - License Downloads Last Commit

-

Welcome to GPopt's website.

-

GPopt does Bayesian optimization using Gaussian Process regression

-

Installing

-
    -
  • 1st method: by using pip at the command line for the stable version
  • -
-
pip install mlsauce
-
-

Quickstart

- -

Documentation

-

The documentation can be found (work in progress) here.

-

Contributing

-

Want to contribute to mlsauce's development on Github, read this!

-
-
-
- -
-
-

Documentation built with MkDocs.

-
- - - - - - - - - - - - diff --git a/docs/site/js/base.js b/docs/site/js/base.js deleted file mode 100644 index b0f4726..0000000 --- a/docs/site/js/base.js +++ /dev/null @@ -1,283 +0,0 @@ -function getSearchTerm() { - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == 'q') { - return sParameterName[1]; - } - } -} - -function applyTopPadding() { - // Update various absolute positions to match where the main container - // starts. This is necessary for handling multi-line nav headers, since - // that pushes the main container down. - var offset = $('body > .container').offset(); - $('html').css('scroll-padding-top', offset.top + 'px'); - $('.bs-sidebar.affix').css('top', offset.top + 'px'); -} - -$(document).ready(function() { - - applyTopPadding(); - - var search_term = getSearchTerm(), - $search_modal = $('#mkdocs_search_modal'), - $keyboard_modal = $('#mkdocs_keyboard_modal'); - - if (search_term) { - $search_modal.modal(); - } - - // make sure search input gets autofocus every time modal opens. - $search_modal.on('shown.bs.modal', function() { - $search_modal.find('#mkdocs-search-query').focus(); - }); - - // Close search modal when result is selected - // The links get added later so listen to parent - $('#mkdocs-search-results').click(function(e) { - if ($(e.target).is('a')) { - $search_modal.modal('hide'); - } - }); - - // Populate keyboard modal with proper Keys - $keyboard_modal.find('.help.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.help]; - $keyboard_modal.find('.prev.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.previous]; - $keyboard_modal.find('.next.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.next]; - $keyboard_modal.find('.search.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.search]; - - // Keyboard navigation - document.addEventListener("keydown", function(e) { - if ($(e.target).is(':input')) return true; - var key = e.which || e.keyCode || window.event && window.event.keyCode; - var page; - switch (key) { - case shortcuts.next: - page = $('.navbar a[rel="next"]:first').prop('href'); - break; - case shortcuts.previous: - page = $('.navbar a[rel="prev"]:first').prop('href'); - break; - case shortcuts.search: - e.preventDefault(); - $keyboard_modal.modal('hide'); - $search_modal.modal('show'); - $search_modal.find('#mkdocs-search-query').focus(); - break; - case shortcuts.help: - $search_modal.modal('hide'); - $keyboard_modal.modal('show'); - break; - default: break; - } - if (page) { - $keyboard_modal.modal('hide'); - window.location.href = page; - } - }); - - $('table').addClass('table table-striped table-hover'); - - // Improve the scrollspy behaviour when users click on a TOC item. - $(".bs-sidenav a").on("click", function() { - var clicked = this; - setTimeout(function() { - var active = $('.nav li.active a'); - active = active[active.length - 1]; - if (clicked !== active) { - $(active).parent().removeClass("active"); - $(clicked).parent().addClass("active"); - } - }, 50); - }); - - function showInnerDropdown(item) { - var popup = $(item).next('.dropdown-menu'); - popup.addClass('show'); - $(item).addClass('open'); - - // First, close any sibling dropdowns. - var container = $(item).parent().parent(); - container.find('> .dropdown-submenu > a').each(function(i, el) { - if (el !== item) { - hideInnerDropdown(el); - } - }); - - var popupMargin = 10; - var maxBottom = $(window).height() - popupMargin; - var bounds = item.getBoundingClientRect(); - - popup.css('left', bounds.right + 'px'); - if (bounds.top + popup.height() > maxBottom && - bounds.top > $(window).height() / 2) { - popup.css({ - 'top': (bounds.bottom - popup.height()) + 'px', - 'max-height': (bounds.bottom - popupMargin) + 'px', - }); - } else { - popup.css({ - 'top': bounds.top + 'px', - 'max-height': (maxBottom - bounds.top) + 'px', - }); - } - } - - function hideInnerDropdown(item) { - var popup = $(item).next('.dropdown-menu'); - popup.removeClass('show'); - $(item).removeClass('open'); - - popup.scrollTop(0); - popup.find('.dropdown-menu').scrollTop(0).removeClass('show'); - popup.find('.dropdown-submenu > a').removeClass('open'); - } - - $('.dropdown-submenu > a').on('click', function(e) { - if ($(this).next('.dropdown-menu').hasClass('show')) { - hideInnerDropdown(this); - } else { - showInnerDropdown(this); - } - - e.stopPropagation(); - e.preventDefault(); - }); - - $('.dropdown-menu').parent().on('hide.bs.dropdown', function(e) { - $(this).find('.dropdown-menu').scrollTop(0); - $(this).find('.dropdown-submenu > a').removeClass('open'); - $(this).find('.dropdown-menu .dropdown-menu').removeClass('show'); - }); -}); - -$(window).on('resize', applyTopPadding); - -$('body').scrollspy({ - target: '.bs-sidebar', - offset: 100 -}); - -/* Prevent disabled links from causing a page reload */ -$("li.disabled a").click(function() { - event.preventDefault(); -}); - -// See https://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes -// We only list common keys below. Obscure keys are omitted and their use is discouraged. -var keyCodes = { - 8: 'backspace', - 9: 'tab', - 13: 'enter', - 16: 'shift', - 17: 'ctrl', - 18: 'alt', - 19: 'pause/break', - 20: 'caps lock', - 27: 'escape', - 32: 'spacebar', - 33: 'page up', - 34: 'page down', - 35: 'end', - 36: 'home', - 37: '←', - 38: '↑', - 39: '→', - 40: '↓', - 45: 'insert', - 46: 'delete', - 48: '0', - 49: '1', - 50: '2', - 51: '3', - 52: '4', - 53: '5', - 54: '6', - 55: '7', - 56: '8', - 57: '9', - 65: 'a', - 66: 'b', - 67: 'c', - 68: 'd', - 69: 'e', - 70: 'f', - 71: 'g', - 72: 'h', - 73: 'i', - 74: 'j', - 75: 'k', - 76: 'l', - 77: 'm', - 78: 'n', - 79: 'o', - 80: 'p', - 81: 'q', - 82: 'r', - 83: 's', - 84: 't', - 85: 'u', - 86: 'v', - 87: 'w', - 88: 'x', - 89: 'y', - 90: 'z', - 91: 'Left Windows Key / Left ⌘', - 92: 'Right Windows Key', - 93: 'Windows Menu / Right ⌘', - 96: 'numpad 0', - 97: 'numpad 1', - 98: 'numpad 2', - 99: 'numpad 3', - 100: 'numpad 4', - 101: 'numpad 5', - 102: 'numpad 6', - 103: 'numpad 7', - 104: 'numpad 8', - 105: 'numpad 9', - 106: 'multiply', - 107: 'add', - 109: 'subtract', - 110: 'decimal point', - 111: 'divide', - 112: 'f1', - 113: 'f2', - 114: 'f3', - 115: 'f4', - 116: 'f5', - 117: 'f6', - 118: 'f7', - 119: 'f8', - 120: 'f9', - 121: 'f10', - 122: 'f11', - 123: 'f12', - 124: 'f13', - 125: 'f14', - 126: 'f15', - 127: 'f16', - 128: 'f17', - 129: 'f18', - 130: 'f19', - 131: 'f20', - 132: 'f21', - 133: 'f22', - 134: 'f23', - 135: 'f24', - 144: 'num lock', - 145: 'scroll lock', - 186: ';', - 187: '=', - 188: ',', - 189: '‐', - 190: '.', - 191: '?', - 192: '`', - 219: '[', - 220: '\', - 221: ']', - 222: ''', -}; diff --git a/docs/site/js/bootstrap.min.js b/docs/site/js/bootstrap.min.js deleted file mode 100644 index ca013b7..0000000 --- a/docs/site/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 0) { - var tokenMetadata = lunr.utils.clone(metadata) || {} - tokenMetadata["position"] = [sliceStart, sliceLength] - tokenMetadata["index"] = tokens.length - - tokens.push( - new lunr.Token ( - str.slice(sliceStart, sliceEnd), - tokenMetadata - ) - ) - } - - sliceStart = sliceEnd + 1 - } - - } - - return tokens -} - -/** - * The separator used to split a string into tokens. Override this property to change the behaviour of - * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. - * - * @static - * @see lunr.tokenizer - */ -lunr.tokenizer.separator = /[\s\-]+/ -/*! - * lunr.Pipeline - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * lunr.Pipelines maintain an ordered list of functions to be applied to all - * tokens in documents entering the search index and queries being ran against - * the index. - * - * An instance of lunr.Index created with the lunr shortcut will contain a - * pipeline with a stop word filter and an English language stemmer. Extra - * functions can be added before or after either of these functions or these - * default functions can be removed. - * - * When run the pipeline will call each function in turn, passing a token, the - * index of that token in the original list of all tokens and finally a list of - * all the original tokens. - * - * The output of functions in the pipeline will be passed to the next function - * in the pipeline. To exclude a token from entering the index the function - * should return undefined, the rest of the pipeline will not be called with - * this token. - * - * For serialisation of pipelines to work, all functions used in an instance of - * a pipeline should be registered with lunr.Pipeline. Registered functions can - * then be loaded. If trying to load a serialised pipeline that uses functions - * that are not registered an error will be thrown. - * - * If not planning on serialising the pipeline then registering pipeline functions - * is not necessary. - * - * @constructor - */ -lunr.Pipeline = function () { - this._stack = [] -} - -lunr.Pipeline.registeredFunctions = Object.create(null) - -/** - * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token - * string as well as all known metadata. A pipeline function can mutate the token string - * or mutate (or add) metadata for a given token. - * - * A pipeline function can indicate that the passed token should be discarded by returning - * null, undefined or an empty string. This token will not be passed to any downstream pipeline - * functions and will not be added to the index. - * - * Multiple tokens can be returned by returning an array of tokens. Each token will be passed - * to any downstream pipeline functions and all will returned tokens will be added to the index. - * - * Any number of pipeline functions may be chained together using a lunr.Pipeline. - * - * @interface lunr.PipelineFunction - * @param {lunr.Token} token - A token from the document being processed. - * @param {number} i - The index of this token in the complete list of tokens for this document/field. - * @param {lunr.Token[]} tokens - All tokens for this document/field. - * @returns {(?lunr.Token|lunr.Token[])} - */ - -/** - * Register a function with the pipeline. - * - * Functions that are used in the pipeline should be registered if the pipeline - * needs to be serialised, or a serialised pipeline needs to be loaded. - * - * Registering a function does not add it to a pipeline, functions must still be - * added to instances of the pipeline for them to be used when running a pipeline. - * - * @param {lunr.PipelineFunction} fn - The function to check for. - * @param {String} label - The label to register this function with - */ -lunr.Pipeline.registerFunction = function (fn, label) { - if (label in this.registeredFunctions) { - lunr.utils.warn('Overwriting existing registered function: ' + label) - } - - fn.label = label - lunr.Pipeline.registeredFunctions[fn.label] = fn -} - -/** - * Warns if the function is not registered as a Pipeline function. - * - * @param {lunr.PipelineFunction} fn - The function to check for. - * @private - */ -lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { - var isRegistered = fn.label && (fn.label in this.registeredFunctions) - - if (!isRegistered) { - lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) - } -} - -/** - * Loads a previously serialised pipeline. - * - * All functions to be loaded must already be registered with lunr.Pipeline. - * If any function from the serialised data has not been registered then an - * error will be thrown. - * - * @param {Object} serialised - The serialised pipeline to load. - * @returns {lunr.Pipeline} - */ -lunr.Pipeline.load = function (serialised) { - var pipeline = new lunr.Pipeline - - serialised.forEach(function (fnName) { - var fn = lunr.Pipeline.registeredFunctions[fnName] - - if (fn) { - pipeline.add(fn) - } else { - throw new Error('Cannot load unregistered function: ' + fnName) - } - }) - - return pipeline -} - -/** - * Adds new functions to the end of the pipeline. - * - * Logs a warning if the function has not been registered. - * - * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. - */ -lunr.Pipeline.prototype.add = function () { - var fns = Array.prototype.slice.call(arguments) - - fns.forEach(function (fn) { - lunr.Pipeline.warnIfFunctionNotRegistered(fn) - this._stack.push(fn) - }, this) -} - -/** - * Adds a single function after a function that already exists in the - * pipeline. - * - * Logs a warning if the function has not been registered. - * - * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. - * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. - */ -lunr.Pipeline.prototype.after = function (existingFn, newFn) { - lunr.Pipeline.warnIfFunctionNotRegistered(newFn) - - var pos = this._stack.indexOf(existingFn) - if (pos == -1) { - throw new Error('Cannot find existingFn') - } - - pos = pos + 1 - this._stack.splice(pos, 0, newFn) -} - -/** - * Adds a single function before a function that already exists in the - * pipeline. - * - * Logs a warning if the function has not been registered. - * - * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. - * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. - */ -lunr.Pipeline.prototype.before = function (existingFn, newFn) { - lunr.Pipeline.warnIfFunctionNotRegistered(newFn) - - var pos = this._stack.indexOf(existingFn) - if (pos == -1) { - throw new Error('Cannot find existingFn') - } - - this._stack.splice(pos, 0, newFn) -} - -/** - * Removes a function from the pipeline. - * - * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. - */ -lunr.Pipeline.prototype.remove = function (fn) { - var pos = this._stack.indexOf(fn) - if (pos == -1) { - return - } - - this._stack.splice(pos, 1) -} - -/** - * Runs the current list of functions that make up the pipeline against the - * passed tokens. - * - * @param {Array} tokens The tokens to run through the pipeline. - * @returns {Array} - */ -lunr.Pipeline.prototype.run = function (tokens) { - var stackLength = this._stack.length - - for (var i = 0; i < stackLength; i++) { - var fn = this._stack[i] - var memo = [] - - for (var j = 0; j < tokens.length; j++) { - var result = fn(tokens[j], j, tokens) - - if (result === null || result === void 0 || result === '') continue - - if (Array.isArray(result)) { - for (var k = 0; k < result.length; k++) { - memo.push(result[k]) - } - } else { - memo.push(result) - } - } - - tokens = memo - } - - return tokens -} - -/** - * Convenience method for passing a string through a pipeline and getting - * strings out. This method takes care of wrapping the passed string in a - * token and mapping the resulting tokens back to strings. - * - * @param {string} str - The string to pass through the pipeline. - * @param {?object} metadata - Optional metadata to associate with the token - * passed to the pipeline. - * @returns {string[]} - */ -lunr.Pipeline.prototype.runString = function (str, metadata) { - var token = new lunr.Token (str, metadata) - - return this.run([token]).map(function (t) { - return t.toString() - }) -} - -/** - * Resets the pipeline by removing any existing processors. - * - */ -lunr.Pipeline.prototype.reset = function () { - this._stack = [] -} - -/** - * Returns a representation of the pipeline ready for serialisation. - * - * Logs a warning if the function has not been registered. - * - * @returns {Array} - */ -lunr.Pipeline.prototype.toJSON = function () { - return this._stack.map(function (fn) { - lunr.Pipeline.warnIfFunctionNotRegistered(fn) - - return fn.label - }) -} -/*! - * lunr.Vector - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * A vector is used to construct the vector space of documents and queries. These - * vectors support operations to determine the similarity between two documents or - * a document and a query. - * - * Normally no parameters are required for initializing a vector, but in the case of - * loading a previously dumped vector the raw elements can be provided to the constructor. - * - * For performance reasons vectors are implemented with a flat array, where an elements - * index is immediately followed by its value. E.g. [index, value, index, value]. This - * allows the underlying array to be as sparse as possible and still offer decent - * performance when being used for vector calculations. - * - * @constructor - * @param {Number[]} [elements] - The flat list of element index and element value pairs. - */ -lunr.Vector = function (elements) { - this._magnitude = 0 - this.elements = elements || [] -} - - -/** - * Calculates the position within the vector to insert a given index. - * - * This is used internally by insert and upsert. If there are duplicate indexes then - * the position is returned as if the value for that index were to be updated, but it - * is the callers responsibility to check whether there is a duplicate at that index - * - * @param {Number} insertIdx - The index at which the element should be inserted. - * @returns {Number} - */ -lunr.Vector.prototype.positionForIndex = function (index) { - // For an empty vector the tuple can be inserted at the beginning - if (this.elements.length == 0) { - return 0 - } - - var start = 0, - end = this.elements.length / 2, - sliceLength = end - start, - pivotPoint = Math.floor(sliceLength / 2), - pivotIndex = this.elements[pivotPoint * 2] - - while (sliceLength > 1) { - if (pivotIndex < index) { - start = pivotPoint - } - - if (pivotIndex > index) { - end = pivotPoint - } - - if (pivotIndex == index) { - break - } - - sliceLength = end - start - pivotPoint = start + Math.floor(sliceLength / 2) - pivotIndex = this.elements[pivotPoint * 2] - } - - if (pivotIndex == index) { - return pivotPoint * 2 - } - - if (pivotIndex > index) { - return pivotPoint * 2 - } - - if (pivotIndex < index) { - return (pivotPoint + 1) * 2 - } -} - -/** - * Inserts an element at an index within the vector. - * - * Does not allow duplicates, will throw an error if there is already an entry - * for this index. - * - * @param {Number} insertIdx - The index at which the element should be inserted. - * @param {Number} val - The value to be inserted into the vector. - */ -lunr.Vector.prototype.insert = function (insertIdx, val) { - this.upsert(insertIdx, val, function () { - throw "duplicate index" - }) -} - -/** - * Inserts or updates an existing index within the vector. - * - * @param {Number} insertIdx - The index at which the element should be inserted. - * @param {Number} val - The value to be inserted into the vector. - * @param {function} fn - A function that is called for updates, the existing value and the - * requested value are passed as arguments - */ -lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { - this._magnitude = 0 - var position = this.positionForIndex(insertIdx) - - if (this.elements[position] == insertIdx) { - this.elements[position + 1] = fn(this.elements[position + 1], val) - } else { - this.elements.splice(position, 0, insertIdx, val) - } -} - -/** - * Calculates the magnitude of this vector. - * - * @returns {Number} - */ -lunr.Vector.prototype.magnitude = function () { - if (this._magnitude) return this._magnitude - - var sumOfSquares = 0, - elementsLength = this.elements.length - - for (var i = 1; i < elementsLength; i += 2) { - var val = this.elements[i] - sumOfSquares += val * val - } - - return this._magnitude = Math.sqrt(sumOfSquares) -} - -/** - * Calculates the dot product of this vector and another vector. - * - * @param {lunr.Vector} otherVector - The vector to compute the dot product with. - * @returns {Number} - */ -lunr.Vector.prototype.dot = function (otherVector) { - var dotProduct = 0, - a = this.elements, b = otherVector.elements, - aLen = a.length, bLen = b.length, - aVal = 0, bVal = 0, - i = 0, j = 0 - - while (i < aLen && j < bLen) { - aVal = a[i], bVal = b[j] - if (aVal < bVal) { - i += 2 - } else if (aVal > bVal) { - j += 2 - } else if (aVal == bVal) { - dotProduct += a[i + 1] * b[j + 1] - i += 2 - j += 2 - } - } - - return dotProduct -} - -/** - * Calculates the similarity between this vector and another vector. - * - * @param {lunr.Vector} otherVector - The other vector to calculate the - * similarity with. - * @returns {Number} - */ -lunr.Vector.prototype.similarity = function (otherVector) { - return this.dot(otherVector) / this.magnitude() || 0 -} - -/** - * Converts the vector to an array of the elements within the vector. - * - * @returns {Number[]} - */ -lunr.Vector.prototype.toArray = function () { - var output = new Array (this.elements.length / 2) - - for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { - output[j] = this.elements[i] - } - - return output -} - -/** - * A JSON serializable representation of the vector. - * - * @returns {Number[]} - */ -lunr.Vector.prototype.toJSON = function () { - return this.elements -} -/* eslint-disable */ -/*! - * lunr.stemmer - * Copyright (C) 2020 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - */ - -/** - * lunr.stemmer is an english language stemmer, this is a JavaScript - * implementation of the PorterStemmer taken from http://tartarus.org/~martin - * - * @static - * @implements {lunr.PipelineFunction} - * @param {lunr.Token} token - The string to stem - * @returns {lunr.Token} - * @see {@link lunr.Pipeline} - * @function - */ -lunr.stemmer = (function(){ - var step2list = { - "ational" : "ate", - "tional" : "tion", - "enci" : "ence", - "anci" : "ance", - "izer" : "ize", - "bli" : "ble", - "alli" : "al", - "entli" : "ent", - "eli" : "e", - "ousli" : "ous", - "ization" : "ize", - "ation" : "ate", - "ator" : "ate", - "alism" : "al", - "iveness" : "ive", - "fulness" : "ful", - "ousness" : "ous", - "aliti" : "al", - "iviti" : "ive", - "biliti" : "ble", - "logi" : "log" - }, - - step3list = { - "icate" : "ic", - "ative" : "", - "alize" : "al", - "iciti" : "ic", - "ical" : "ic", - "ful" : "", - "ness" : "" - }, - - c = "[^aeiou]", // consonant - v = "[aeiouy]", // vowel - C = c + "[^aeiouy]*", // consonant sequence - V = v + "[aeiou]*", // vowel sequence - - mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 - meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 - mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 - s_v = "^(" + C + ")?" + v; // vowel in stem - - var re_mgr0 = new RegExp(mgr0); - var re_mgr1 = new RegExp(mgr1); - var re_meq1 = new RegExp(meq1); - var re_s_v = new RegExp(s_v); - - var re_1a = /^(.+?)(ss|i)es$/; - var re2_1a = /^(.+?)([^s])s$/; - var re_1b = /^(.+?)eed$/; - var re2_1b = /^(.+?)(ed|ing)$/; - var re_1b_2 = /.$/; - var re2_1b_2 = /(at|bl|iz)$/; - var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); - var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - - var re_1c = /^(.+?[^aeiou])y$/; - var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - - var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - - var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - var re2_4 = /^(.+?)(s|t)(ion)$/; - - var re_5 = /^(.+?)e$/; - var re_5_1 = /ll$/; - var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - - var porterStemmer = function porterStemmer(w) { - var stem, - suffix, - firstch, - re, - re2, - re3, - re4; - - if (w.length < 3) { return w; } - - firstch = w.substr(0,1); - if (firstch == "y") { - w = firstch.toUpperCase() + w.substr(1); - } - - // Step 1a - re = re_1a - re2 = re2_1a; - - if (re.test(w)) { w = w.replace(re,"$1$2"); } - else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } - - // Step 1b - re = re_1b; - re2 = re2_1b; - if (re.test(w)) { - var fp = re.exec(w); - re = re_mgr0; - if (re.test(fp[1])) { - re = re_1b_2; - w = w.replace(re,""); - } - } else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = re_s_v; - if (re2.test(stem)) { - w = stem; - re2 = re2_1b_2; - re3 = re3_1b_2; - re4 = re4_1b_2; - if (re2.test(w)) { w = w + "e"; } - else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } - else if (re4.test(w)) { w = w + "e"; } - } - } - - // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) - re = re_1c; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - w = stem + "i"; - } - - // Step 2 - re = re_2; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = re_mgr0; - if (re.test(stem)) { - w = stem + step2list[suffix]; - } - } - - // Step 3 - re = re_3; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = re_mgr0; - if (re.test(stem)) { - w = stem + step3list[suffix]; - } - } - - // Step 4 - re = re_4; - re2 = re2_4; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = re_mgr1; - if (re.test(stem)) { - w = stem; - } - } else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = re_mgr1; - if (re2.test(stem)) { - w = stem; - } - } - - // Step 5 - re = re_5; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = re_mgr1; - re2 = re_meq1; - re3 = re3_5; - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { - w = stem; - } - } - - re = re_5_1; - re2 = re_mgr1; - if (re.test(w) && re2.test(w)) { - re = re_1b_2; - w = w.replace(re,""); - } - - // and turn initial Y back to y - - if (firstch == "y") { - w = firstch.toLowerCase() + w.substr(1); - } - - return w; - }; - - return function (token) { - return token.update(porterStemmer); - } -})(); - -lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') -/*! - * lunr.stopWordFilter - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * lunr.generateStopWordFilter builds a stopWordFilter function from the provided - * list of stop words. - * - * The built in lunr.stopWordFilter is built using this generator and can be used - * to generate custom stopWordFilters for applications or non English languages. - * - * @function - * @param {Array} token The token to pass through the filter - * @returns {lunr.PipelineFunction} - * @see lunr.Pipeline - * @see lunr.stopWordFilter - */ -lunr.generateStopWordFilter = function (stopWords) { - var words = stopWords.reduce(function (memo, stopWord) { - memo[stopWord] = stopWord - return memo - }, {}) - - return function (token) { - if (token && words[token.toString()] !== token.toString()) return token - } -} - -/** - * lunr.stopWordFilter is an English language stop word list filter, any words - * contained in the list will not be passed through the filter. - * - * This is intended to be used in the Pipeline. If the token does not pass the - * filter then undefined will be returned. - * - * @function - * @implements {lunr.PipelineFunction} - * @params {lunr.Token} token - A token to check for being a stop word. - * @returns {lunr.Token} - * @see {@link lunr.Pipeline} - */ -lunr.stopWordFilter = lunr.generateStopWordFilter([ - 'a', - 'able', - 'about', - 'across', - 'after', - 'all', - 'almost', - 'also', - 'am', - 'among', - 'an', - 'and', - 'any', - 'are', - 'as', - 'at', - 'be', - 'because', - 'been', - 'but', - 'by', - 'can', - 'cannot', - 'could', - 'dear', - 'did', - 'do', - 'does', - 'either', - 'else', - 'ever', - 'every', - 'for', - 'from', - 'get', - 'got', - 'had', - 'has', - 'have', - 'he', - 'her', - 'hers', - 'him', - 'his', - 'how', - 'however', - 'i', - 'if', - 'in', - 'into', - 'is', - 'it', - 'its', - 'just', - 'least', - 'let', - 'like', - 'likely', - 'may', - 'me', - 'might', - 'most', - 'must', - 'my', - 'neither', - 'no', - 'nor', - 'not', - 'of', - 'off', - 'often', - 'on', - 'only', - 'or', - 'other', - 'our', - 'own', - 'rather', - 'said', - 'say', - 'says', - 'she', - 'should', - 'since', - 'so', - 'some', - 'than', - 'that', - 'the', - 'their', - 'them', - 'then', - 'there', - 'these', - 'they', - 'this', - 'tis', - 'to', - 'too', - 'twas', - 'us', - 'wants', - 'was', - 'we', - 'were', - 'what', - 'when', - 'where', - 'which', - 'while', - 'who', - 'whom', - 'why', - 'will', - 'with', - 'would', - 'yet', - 'you', - 'your' -]) - -lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') -/*! - * lunr.trimmer - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * lunr.trimmer is a pipeline function for trimming non word - * characters from the beginning and end of tokens before they - * enter the index. - * - * This implementation may not work correctly for non latin - * characters and should either be removed or adapted for use - * with languages with non-latin characters. - * - * @static - * @implements {lunr.PipelineFunction} - * @param {lunr.Token} token The token to pass through the filter - * @returns {lunr.Token} - * @see lunr.Pipeline - */ -lunr.trimmer = function (token) { - return token.update(function (s) { - return s.replace(/^\W+/, '').replace(/\W+$/, '') - }) -} - -lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') -/*! - * lunr.TokenSet - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * A token set is used to store the unique list of all tokens - * within an index. Token sets are also used to represent an - * incoming query to the index, this query token set and index - * token set are then intersected to find which tokens to look - * up in the inverted index. - * - * A token set can hold multiple tokens, as in the case of the - * index token set, or it can hold a single token as in the - * case of a simple query token set. - * - * Additionally token sets are used to perform wildcard matching. - * Leading, contained and trailing wildcards are supported, and - * from this edit distance matching can also be provided. - * - * Token sets are implemented as a minimal finite state automata, - * where both common prefixes and suffixes are shared between tokens. - * This helps to reduce the space used for storing the token set. - * - * @constructor - */ -lunr.TokenSet = function () { - this.final = false - this.edges = {} - this.id = lunr.TokenSet._nextId - lunr.TokenSet._nextId += 1 -} - -/** - * Keeps track of the next, auto increment, identifier to assign - * to a new tokenSet. - * - * TokenSets require a unique identifier to be correctly minimised. - * - * @private - */ -lunr.TokenSet._nextId = 1 - -/** - * Creates a TokenSet instance from the given sorted array of words. - * - * @param {String[]} arr - A sorted array of strings to create the set from. - * @returns {lunr.TokenSet} - * @throws Will throw an error if the input array is not sorted. - */ -lunr.TokenSet.fromArray = function (arr) { - var builder = new lunr.TokenSet.Builder - - for (var i = 0, len = arr.length; i < len; i++) { - builder.insert(arr[i]) - } - - builder.finish() - return builder.root -} - -/** - * Creates a token set from a query clause. - * - * @private - * @param {Object} clause - A single clause from lunr.Query. - * @param {string} clause.term - The query clause term. - * @param {number} [clause.editDistance] - The optional edit distance for the term. - * @returns {lunr.TokenSet} - */ -lunr.TokenSet.fromClause = function (clause) { - if ('editDistance' in clause) { - return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) - } else { - return lunr.TokenSet.fromString(clause.term) - } -} - -/** - * Creates a token set representing a single string with a specified - * edit distance. - * - * Insertions, deletions, substitutions and transpositions are each - * treated as an edit distance of 1. - * - * Increasing the allowed edit distance will have a dramatic impact - * on the performance of both creating and intersecting these TokenSets. - * It is advised to keep the edit distance less than 3. - * - * @param {string} str - The string to create the token set from. - * @param {number} editDistance - The allowed edit distance to match. - * @returns {lunr.Vector} - */ -lunr.TokenSet.fromFuzzyString = function (str, editDistance) { - var root = new lunr.TokenSet - - var stack = [{ - node: root, - editsRemaining: editDistance, - str: str - }] - - while (stack.length) { - var frame = stack.pop() - - // no edit - if (frame.str.length > 0) { - var char = frame.str.charAt(0), - noEditNode - - if (char in frame.node.edges) { - noEditNode = frame.node.edges[char] - } else { - noEditNode = new lunr.TokenSet - frame.node.edges[char] = noEditNode - } - - if (frame.str.length == 1) { - noEditNode.final = true - } - - stack.push({ - node: noEditNode, - editsRemaining: frame.editsRemaining, - str: frame.str.slice(1) - }) - } - - if (frame.editsRemaining == 0) { - continue - } - - // insertion - if ("*" in frame.node.edges) { - var insertionNode = frame.node.edges["*"] - } else { - var insertionNode = new lunr.TokenSet - frame.node.edges["*"] = insertionNode - } - - if (frame.str.length == 0) { - insertionNode.final = true - } - - stack.push({ - node: insertionNode, - editsRemaining: frame.editsRemaining - 1, - str: frame.str - }) - - // deletion - // can only do a deletion if we have enough edits remaining - // and if there are characters left to delete in the string - if (frame.str.length > 1) { - stack.push({ - node: frame.node, - editsRemaining: frame.editsRemaining - 1, - str: frame.str.slice(1) - }) - } - - // deletion - // just removing the last character from the str - if (frame.str.length == 1) { - frame.node.final = true - } - - // substitution - // can only do a substitution if we have enough edits remaining - // and if there are characters left to substitute - if (frame.str.length >= 1) { - if ("*" in frame.node.edges) { - var substitutionNode = frame.node.edges["*"] - } else { - var substitutionNode = new lunr.TokenSet - frame.node.edges["*"] = substitutionNode - } - - if (frame.str.length == 1) { - substitutionNode.final = true - } - - stack.push({ - node: substitutionNode, - editsRemaining: frame.editsRemaining - 1, - str: frame.str.slice(1) - }) - } - - // transposition - // can only do a transposition if there are edits remaining - // and there are enough characters to transpose - if (frame.str.length > 1) { - var charA = frame.str.charAt(0), - charB = frame.str.charAt(1), - transposeNode - - if (charB in frame.node.edges) { - transposeNode = frame.node.edges[charB] - } else { - transposeNode = new lunr.TokenSet - frame.node.edges[charB] = transposeNode - } - - if (frame.str.length == 1) { - transposeNode.final = true - } - - stack.push({ - node: transposeNode, - editsRemaining: frame.editsRemaining - 1, - str: charA + frame.str.slice(2) - }) - } - } - - return root -} - -/** - * Creates a TokenSet from a string. - * - * The string may contain one or more wildcard characters (*) - * that will allow wildcard matching when intersecting with - * another TokenSet. - * - * @param {string} str - The string to create a TokenSet from. - * @returns {lunr.TokenSet} - */ -lunr.TokenSet.fromString = function (str) { - var node = new lunr.TokenSet, - root = node - - /* - * Iterates through all characters within the passed string - * appending a node for each character. - * - * When a wildcard character is found then a self - * referencing edge is introduced to continually match - * any number of any characters. - */ - for (var i = 0, len = str.length; i < len; i++) { - var char = str[i], - final = (i == len - 1) - - if (char == "*") { - node.edges[char] = node - node.final = final - - } else { - var next = new lunr.TokenSet - next.final = final - - node.edges[char] = next - node = next - } - } - - return root -} - -/** - * Converts this TokenSet into an array of strings - * contained within the TokenSet. - * - * This is not intended to be used on a TokenSet that - * contains wildcards, in these cases the results are - * undefined and are likely to cause an infinite loop. - * - * @returns {string[]} - */ -lunr.TokenSet.prototype.toArray = function () { - var words = [] - - var stack = [{ - prefix: "", - node: this - }] - - while (stack.length) { - var frame = stack.pop(), - edges = Object.keys(frame.node.edges), - len = edges.length - - if (frame.node.final) { - /* In Safari, at this point the prefix is sometimes corrupted, see: - * https://github.com/olivernn/lunr.js/issues/279 Calling any - * String.prototype method forces Safari to "cast" this string to what - * it's supposed to be, fixing the bug. */ - frame.prefix.charAt(0) - words.push(frame.prefix) - } - - for (var i = 0; i < len; i++) { - var edge = edges[i] - - stack.push({ - prefix: frame.prefix.concat(edge), - node: frame.node.edges[edge] - }) - } - } - - return words -} - -/** - * Generates a string representation of a TokenSet. - * - * This is intended to allow TokenSets to be used as keys - * in objects, largely to aid the construction and minimisation - * of a TokenSet. As such it is not designed to be a human - * friendly representation of the TokenSet. - * - * @returns {string} - */ -lunr.TokenSet.prototype.toString = function () { - // NOTE: Using Object.keys here as this.edges is very likely - // to enter 'hash-mode' with many keys being added - // - // avoiding a for-in loop here as it leads to the function - // being de-optimised (at least in V8). From some simple - // benchmarks the performance is comparable, but allowing - // V8 to optimize may mean easy performance wins in the future. - - if (this._str) { - return this._str - } - - var str = this.final ? '1' : '0', - labels = Object.keys(this.edges).sort(), - len = labels.length - - for (var i = 0; i < len; i++) { - var label = labels[i], - node = this.edges[label] - - str = str + label + node.id - } - - return str -} - -/** - * Returns a new TokenSet that is the intersection of - * this TokenSet and the passed TokenSet. - * - * This intersection will take into account any wildcards - * contained within the TokenSet. - * - * @param {lunr.TokenSet} b - An other TokenSet to intersect with. - * @returns {lunr.TokenSet} - */ -lunr.TokenSet.prototype.intersect = function (b) { - var output = new lunr.TokenSet, - frame = undefined - - var stack = [{ - qNode: b, - output: output, - node: this - }] - - while (stack.length) { - frame = stack.pop() - - // NOTE: As with the #toString method, we are using - // Object.keys and a for loop instead of a for-in loop - // as both of these objects enter 'hash' mode, causing - // the function to be de-optimised in V8 - var qEdges = Object.keys(frame.qNode.edges), - qLen = qEdges.length, - nEdges = Object.keys(frame.node.edges), - nLen = nEdges.length - - for (var q = 0; q < qLen; q++) { - var qEdge = qEdges[q] - - for (var n = 0; n < nLen; n++) { - var nEdge = nEdges[n] - - if (nEdge == qEdge || qEdge == '*') { - var node = frame.node.edges[nEdge], - qNode = frame.qNode.edges[qEdge], - final = node.final && qNode.final, - next = undefined - - if (nEdge in frame.output.edges) { - // an edge already exists for this character - // no need to create a new node, just set the finality - // bit unless this node is already final - next = frame.output.edges[nEdge] - next.final = next.final || final - - } else { - // no edge exists yet, must create one - // set the finality bit and insert it - // into the output - next = new lunr.TokenSet - next.final = final - frame.output.edges[nEdge] = next - } - - stack.push({ - qNode: qNode, - output: next, - node: node - }) - } - } - } - } - - return output -} -lunr.TokenSet.Builder = function () { - this.previousWord = "" - this.root = new lunr.TokenSet - this.uncheckedNodes = [] - this.minimizedNodes = {} -} - -lunr.TokenSet.Builder.prototype.insert = function (word) { - var node, - commonPrefix = 0 - - if (word < this.previousWord) { - throw new Error ("Out of order word insertion") - } - - for (var i = 0; i < word.length && i < this.previousWord.length; i++) { - if (word[i] != this.previousWord[i]) break - commonPrefix++ - } - - this.minimize(commonPrefix) - - if (this.uncheckedNodes.length == 0) { - node = this.root - } else { - node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child - } - - for (var i = commonPrefix; i < word.length; i++) { - var nextNode = new lunr.TokenSet, - char = word[i] - - node.edges[char] = nextNode - - this.uncheckedNodes.push({ - parent: node, - char: char, - child: nextNode - }) - - node = nextNode - } - - node.final = true - this.previousWord = word -} - -lunr.TokenSet.Builder.prototype.finish = function () { - this.minimize(0) -} - -lunr.TokenSet.Builder.prototype.minimize = function (downTo) { - for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { - var node = this.uncheckedNodes[i], - childKey = node.child.toString() - - if (childKey in this.minimizedNodes) { - node.parent.edges[node.char] = this.minimizedNodes[childKey] - } else { - // Cache the key for this node since - // we know it can't change anymore - node.child._str = childKey - - this.minimizedNodes[childKey] = node.child - } - - this.uncheckedNodes.pop() - } -} -/*! - * lunr.Index - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * An index contains the built index of all documents and provides a query interface - * to the index. - * - * Usually instances of lunr.Index will not be created using this constructor, instead - * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be - * used to load previously built and serialized indexes. - * - * @constructor - * @param {Object} attrs - The attributes of the built search index. - * @param {Object} attrs.invertedIndex - An index of term/field to document reference. - * @param {Object} attrs.fieldVectors - Field vectors - * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. - * @param {string[]} attrs.fields - The names of indexed document fields. - * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. - */ -lunr.Index = function (attrs) { - this.invertedIndex = attrs.invertedIndex - this.fieldVectors = attrs.fieldVectors - this.tokenSet = attrs.tokenSet - this.fields = attrs.fields - this.pipeline = attrs.pipeline -} - -/** - * A result contains details of a document matching a search query. - * @typedef {Object} lunr.Index~Result - * @property {string} ref - The reference of the document this result represents. - * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. - * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. - */ - -/** - * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple - * query language which itself is parsed into an instance of lunr.Query. - * - * For programmatically building queries it is advised to directly use lunr.Query, the query language - * is best used for human entered text rather than program generated text. - * - * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported - * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' - * or 'world', though those that contain both will rank higher in the results. - * - * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can - * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding - * wildcards will increase the number of documents that will be found but can also have a negative - * impact on query performance, especially with wildcards at the beginning of a term. - * - * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term - * hello in the title field will match this query. Using a field not present in the index will lead - * to an error being thrown. - * - * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term - * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported - * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. - * Avoid large values for edit distance to improve query performance. - * - * Each term also supports a presence modifier. By default a term's presence in document is optional, however - * this can be changed to either required or prohibited. For a term's presence to be required in a document the - * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and - * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not - * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'. - * - * To escape special characters the backslash character '\' can be used, this allows searches to include - * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead - * of attempting to apply a boost of 2 to the search term "foo". - * - * @typedef {string} lunr.Index~QueryString - * @example Simple single term query - * hello - * @example Multiple term query - * hello world - * @example term scoped to a field - * title:hello - * @example term with a boost of 10 - * hello^10 - * @example term with an edit distance of 2 - * hello~2 - * @example terms with presence modifiers - * -foo +bar baz - */ - -/** - * Performs a search against the index using lunr query syntax. - * - * Results will be returned sorted by their score, the most relevant results - * will be returned first. For details on how the score is calculated, please see - * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}. - * - * For more programmatic querying use lunr.Index#query. - * - * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. - * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. - * @returns {lunr.Index~Result[]} - */ -lunr.Index.prototype.search = function (queryString) { - return this.query(function (query) { - var parser = new lunr.QueryParser(queryString, query) - parser.parse() - }) -} - -/** - * A query builder callback provides a query object to be used to express - * the query to perform on the index. - * - * @callback lunr.Index~queryBuilder - * @param {lunr.Query} query - The query object to build up. - * @this lunr.Query - */ - -/** - * Performs a query against the index using the yielded lunr.Query object. - * - * If performing programmatic queries against the index, this method is preferred - * over lunr.Index#search so as to avoid the additional query parsing overhead. - * - * A query object is yielded to the supplied function which should be used to - * express the query to be run against the index. - * - * Note that although this function takes a callback parameter it is _not_ an - * asynchronous operation, the callback is just yielded a query object to be - * customized. - * - * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. - * @returns {lunr.Index~Result[]} - */ -lunr.Index.prototype.query = function (fn) { - // for each query clause - // * process terms - // * expand terms from token set - // * find matching documents and metadata - // * get document vectors - // * score documents - - var query = new lunr.Query(this.fields), - matchingFields = Object.create(null), - queryVectors = Object.create(null), - termFieldCache = Object.create(null), - requiredMatches = Object.create(null), - prohibitedMatches = Object.create(null) - - /* - * To support field level boosts a query vector is created per - * field. An empty vector is eagerly created to support negated - * queries. - */ - for (var i = 0; i < this.fields.length; i++) { - queryVectors[this.fields[i]] = new lunr.Vector - } - - fn.call(query, query) - - for (var i = 0; i < query.clauses.length; i++) { - /* - * Unless the pipeline has been disabled for this term, which is - * the case for terms with wildcards, we need to pass the clause - * term through the search pipeline. A pipeline returns an array - * of processed terms. Pipeline functions may expand the passed - * term, which means we may end up performing multiple index lookups - * for a single query term. - */ - var clause = query.clauses[i], - terms = null, - clauseMatches = lunr.Set.empty - - if (clause.usePipeline) { - terms = this.pipeline.runString(clause.term, { - fields: clause.fields - }) - } else { - terms = [clause.term] - } - - for (var m = 0; m < terms.length; m++) { - var term = terms[m] - - /* - * Each term returned from the pipeline needs to use the same query - * clause object, e.g. the same boost and or edit distance. The - * simplest way to do this is to re-use the clause object but mutate - * its term property. - */ - clause.term = term - - /* - * From the term in the clause we create a token set which will then - * be used to intersect the indexes token set to get a list of terms - * to lookup in the inverted index - */ - var termTokenSet = lunr.TokenSet.fromClause(clause), - expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() - - /* - * If a term marked as required does not exist in the tokenSet it is - * impossible for the search to return any matches. We set all the field - * scoped required matches set to empty and stop examining any further - * clauses. - */ - if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) { - for (var k = 0; k < clause.fields.length; k++) { - var field = clause.fields[k] - requiredMatches[field] = lunr.Set.empty - } - - break - } - - for (var j = 0; j < expandedTerms.length; j++) { - /* - * For each term get the posting and termIndex, this is required for - * building the query vector. - */ - var expandedTerm = expandedTerms[j], - posting = this.invertedIndex[expandedTerm], - termIndex = posting._index - - for (var k = 0; k < clause.fields.length; k++) { - /* - * For each field that this query term is scoped by (by default - * all fields are in scope) we need to get all the document refs - * that have this term in that field. - * - * The posting is the entry in the invertedIndex for the matching - * term from above. - */ - var field = clause.fields[k], - fieldPosting = posting[field], - matchingDocumentRefs = Object.keys(fieldPosting), - termField = expandedTerm + "/" + field, - matchingDocumentsSet = new lunr.Set(matchingDocumentRefs) - - /* - * if the presence of this term is required ensure that the matching - * documents are added to the set of required matches for this clause. - * - */ - if (clause.presence == lunr.Query.presence.REQUIRED) { - clauseMatches = clauseMatches.union(matchingDocumentsSet) - - if (requiredMatches[field] === undefined) { - requiredMatches[field] = lunr.Set.complete - } - } - - /* - * if the presence of this term is prohibited ensure that the matching - * documents are added to the set of prohibited matches for this field, - * creating that set if it does not yet exist. - */ - if (clause.presence == lunr.Query.presence.PROHIBITED) { - if (prohibitedMatches[field] === undefined) { - prohibitedMatches[field] = lunr.Set.empty - } - - prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet) - - /* - * Prohibited matches should not be part of the query vector used for - * similarity scoring and no metadata should be extracted so we continue - * to the next field - */ - continue - } - - /* - * The query field vector is populated using the termIndex found for - * the term and a unit value with the appropriate boost applied. - * Using upsert because there could already be an entry in the vector - * for the term we are working with. In that case we just add the scores - * together. - */ - queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) - - /** - * If we've already seen this term, field combo then we've already collected - * the matching documents and metadata, no need to go through all that again - */ - if (termFieldCache[termField]) { - continue - } - - for (var l = 0; l < matchingDocumentRefs.length; l++) { - /* - * All metadata for this term/field/document triple - * are then extracted and collected into an instance - * of lunr.MatchData ready to be returned in the query - * results - */ - var matchingDocumentRef = matchingDocumentRefs[l], - matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), - metadata = fieldPosting[matchingDocumentRef], - fieldMatch - - if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { - matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) - } else { - fieldMatch.add(expandedTerm, field, metadata) - } - - } - - termFieldCache[termField] = true - } - } - } - - /** - * If the presence was required we need to update the requiredMatches field sets. - * We do this after all fields for the term have collected their matches because - * the clause terms presence is required in _any_ of the fields not _all_ of the - * fields. - */ - if (clause.presence === lunr.Query.presence.REQUIRED) { - for (var k = 0; k < clause.fields.length; k++) { - var field = clause.fields[k] - requiredMatches[field] = requiredMatches[field].intersect(clauseMatches) - } - } - } - - /** - * Need to combine the field scoped required and prohibited - * matching documents into a global set of required and prohibited - * matches - */ - var allRequiredMatches = lunr.Set.complete, - allProhibitedMatches = lunr.Set.empty - - for (var i = 0; i < this.fields.length; i++) { - var field = this.fields[i] - - if (requiredMatches[field]) { - allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field]) - } - - if (prohibitedMatches[field]) { - allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field]) - } - } - - var matchingFieldRefs = Object.keys(matchingFields), - results = [], - matches = Object.create(null) - - /* - * If the query is negated (contains only prohibited terms) - * we need to get _all_ fieldRefs currently existing in the - * index. This is only done when we know that the query is - * entirely prohibited terms to avoid any cost of getting all - * fieldRefs unnecessarily. - * - * Additionally, blank MatchData must be created to correctly - * populate the results. - */ - if (query.isNegated()) { - matchingFieldRefs = Object.keys(this.fieldVectors) - - for (var i = 0; i < matchingFieldRefs.length; i++) { - var matchingFieldRef = matchingFieldRefs[i] - var fieldRef = lunr.FieldRef.fromString(matchingFieldRef) - matchingFields[matchingFieldRef] = new lunr.MatchData - } - } - - for (var i = 0; i < matchingFieldRefs.length; i++) { - /* - * Currently we have document fields that match the query, but we - * need to return documents. The matchData and scores are combined - * from multiple fields belonging to the same document. - * - * Scores are calculated by field, using the query vectors created - * above, and combined into a final document score using addition. - */ - var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), - docRef = fieldRef.docRef - - if (!allRequiredMatches.contains(docRef)) { - continue - } - - if (allProhibitedMatches.contains(docRef)) { - continue - } - - var fieldVector = this.fieldVectors[fieldRef], - score = queryVectors[fieldRef.fieldName].similarity(fieldVector), - docMatch - - if ((docMatch = matches[docRef]) !== undefined) { - docMatch.score += score - docMatch.matchData.combine(matchingFields[fieldRef]) - } else { - var match = { - ref: docRef, - score: score, - matchData: matchingFields[fieldRef] - } - matches[docRef] = match - results.push(match) - } - } - - /* - * Sort the results objects by score, highest first. - */ - return results.sort(function (a, b) { - return b.score - a.score - }) -} - -/** - * Prepares the index for JSON serialization. - * - * The schema for this JSON blob will be described in a - * separate JSON schema file. - * - * @returns {Object} - */ -lunr.Index.prototype.toJSON = function () { - var invertedIndex = Object.keys(this.invertedIndex) - .sort() - .map(function (term) { - return [term, this.invertedIndex[term]] - }, this) - - var fieldVectors = Object.keys(this.fieldVectors) - .map(function (ref) { - return [ref, this.fieldVectors[ref].toJSON()] - }, this) - - return { - version: lunr.version, - fields: this.fields, - fieldVectors: fieldVectors, - invertedIndex: invertedIndex, - pipeline: this.pipeline.toJSON() - } -} - -/** - * Loads a previously serialized lunr.Index - * - * @param {Object} serializedIndex - A previously serialized lunr.Index - * @returns {lunr.Index} - */ -lunr.Index.load = function (serializedIndex) { - var attrs = {}, - fieldVectors = {}, - serializedVectors = serializedIndex.fieldVectors, - invertedIndex = Object.create(null), - serializedInvertedIndex = serializedIndex.invertedIndex, - tokenSetBuilder = new lunr.TokenSet.Builder, - pipeline = lunr.Pipeline.load(serializedIndex.pipeline) - - if (serializedIndex.version != lunr.version) { - lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") - } - - for (var i = 0; i < serializedVectors.length; i++) { - var tuple = serializedVectors[i], - ref = tuple[0], - elements = tuple[1] - - fieldVectors[ref] = new lunr.Vector(elements) - } - - for (var i = 0; i < serializedInvertedIndex.length; i++) { - var tuple = serializedInvertedIndex[i], - term = tuple[0], - posting = tuple[1] - - tokenSetBuilder.insert(term) - invertedIndex[term] = posting - } - - tokenSetBuilder.finish() - - attrs.fields = serializedIndex.fields - - attrs.fieldVectors = fieldVectors - attrs.invertedIndex = invertedIndex - attrs.tokenSet = tokenSetBuilder.root - attrs.pipeline = pipeline - - return new lunr.Index(attrs) -} -/*! - * lunr.Builder - * Copyright (C) 2020 Oliver Nightingale - */ - -/** - * lunr.Builder performs indexing on a set of documents and - * returns instances of lunr.Index ready for querying. - * - * All configuration of the index is done via the builder, the - * fields to index, the document reference, the text processing - * pipeline and document scoring parameters are all set on the - * builder before indexing. - * - * @constructor - * @property {string} _ref - Internal reference to the document reference field. - * @property {string[]} _fields - Internal reference to the document fields to index. - * @property {object} invertedIndex - The inverted index maps terms to document fields. - * @property {object} documentTermFrequencies - Keeps track of document term frequencies. - * @property {object} documentLengths - Keeps track of the length of documents added to the index. - * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. - * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. - * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. - * @property {number} documentCount - Keeps track of the total number of documents indexed. - * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. - * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. - * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. - * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. - */ -lunr.Builder = function () { - this._ref = "id" - this._fields = Object.create(null) - this._documents = Object.create(null) - this.invertedIndex = Object.create(null) - this.fieldTermFrequencies = {} - this.fieldLengths = {} - this.tokenizer = lunr.tokenizer - this.pipeline = new lunr.Pipeline - this.searchPipeline = new lunr.Pipeline - this.documentCount = 0 - this._b = 0.75 - this._k1 = 1.2 - this.termIndex = 0 - this.metadataWhitelist = [] -} - -/** - * Sets the document field used as the document reference. Every document must have this field. - * The type of this field in the document should be a string, if it is not a string it will be - * coerced into a string by calling toString. - * - * The default ref is 'id'. - * - * The ref should _not_ be changed during indexing, it should be set before any documents are - * added to the index. Changing it during indexing can lead to inconsistent results. - * - * @param {string} ref - The name of the reference field in the document. - */ -lunr.Builder.prototype.ref = function (ref) { - this._ref = ref -} - -/** - * A function that is used to extract a field from a document. - * - * Lunr expects a field to be at the top level of a document, if however the field - * is deeply nested within a document an extractor function can be used to extract - * the right field for indexing. - * - * @callback fieldExtractor - * @param {object} doc - The document being added to the index. - * @returns {?(string|object|object[])} obj - The object that will be indexed for this field. - * @example Extracting a nested field - * function (doc) { return doc.nested.field } - */ - -/** - * Adds a field to the list of document fields that will be indexed. Every document being - * indexed should have this field. Null values for this field in indexed documents will - * not cause errors but will limit the chance of that document being retrieved by searches. - * - * All fields should be added before adding documents to the index. Adding fields after - * a document has been indexed will have no effect on already indexed documents. - * - * Fields can be boosted at build time. This allows terms within that field to have more - * importance when ranking search results. Use a field boost to specify that matches within - * one field are more important than other fields. - * - * @param {string} fieldName - The name of a field to index in all documents. - * @param {object} attributes - Optional attributes associated with this field. - * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. - * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. - * @throws {RangeError} fieldName cannot contain unsupported characters '/' - */ -lunr.Builder.prototype.field = function (fieldName, attributes) { - if (/\//.test(fieldName)) { - throw new RangeError ("Field '" + fieldName + "' contains illegal character '/'") - } - - this._fields[fieldName] = attributes || {} -} - -/** - * A parameter to tune the amount of field length normalisation that is applied when - * calculating relevance scores. A value of 0 will completely disable any normalisation - * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b - * will be clamped to the range 0 - 1. - * - * @param {number} number - The value to set for this tuning parameter. - */ -lunr.Builder.prototype.b = function (number) { - if (number < 0) { - this._b = 0 - } else if (number > 1) { - this._b = 1 - } else { - this._b = number - } -} - -/** - * A parameter that controls the speed at which a rise in term frequency results in term - * frequency saturation. The default value is 1.2. Setting this to a higher value will give - * slower saturation levels, a lower value will result in quicker saturation. - * - * @param {number} number - The value to set for this tuning parameter. - */ -lunr.Builder.prototype.k1 = function (number) { - this._k1 = number -} - -/** - * Adds a document to the index. - * - * Before adding fields to the index the index should have been fully setup, with the document - * ref and all fields to index already having been specified. - * - * The document must have a field name as specified by the ref (by default this is 'id') and - * it should have all fields defined for indexing, though null or undefined values will not - * cause errors. - * - * Entire documents can be boosted at build time. Applying a boost to a document indicates that - * this document should rank higher in search results than other documents. - * - * @param {object} doc - The document to add to the index. - * @param {object} attributes - Optional attributes associated with this document. - * @param {number} [attributes.boost=1] - Boost applied to all terms within this document. - */ -lunr.Builder.prototype.add = function (doc, attributes) { - var docRef = doc[this._ref], - fields = Object.keys(this._fields) - - this._documents[docRef] = attributes || {} - this.documentCount += 1 - - for (var i = 0; i < fields.length; i++) { - var fieldName = fields[i], - extractor = this._fields[fieldName].extractor, - field = extractor ? extractor(doc) : doc[fieldName], - tokens = this.tokenizer(field, { - fields: [fieldName] - }), - terms = this.pipeline.run(tokens), - fieldRef = new lunr.FieldRef (docRef, fieldName), - fieldTerms = Object.create(null) - - this.fieldTermFrequencies[fieldRef] = fieldTerms - this.fieldLengths[fieldRef] = 0 - - // store the length of this field for this document - this.fieldLengths[fieldRef] += terms.length - - // calculate term frequencies for this field - for (var j = 0; j < terms.length; j++) { - var term = terms[j] - - if (fieldTerms[term] == undefined) { - fieldTerms[term] = 0 - } - - fieldTerms[term] += 1 - - // add to inverted index - // create an initial posting if one doesn't exist - if (this.invertedIndex[term] == undefined) { - var posting = Object.create(null) - posting["_index"] = this.termIndex - this.termIndex += 1 - - for (var k = 0; k < fields.length; k++) { - posting[fields[k]] = Object.create(null) - } - - this.invertedIndex[term] = posting - } - - // add an entry for this term/fieldName/docRef to the invertedIndex - if (this.invertedIndex[term][fieldName][docRef] == undefined) { - this.invertedIndex[term][fieldName][docRef] = Object.create(null) - } - - // store all whitelisted metadata about this token in the - // inverted index - for (var l = 0; l < this.metadataWhitelist.length; l++) { - var metadataKey = this.metadataWhitelist[l], - metadata = term.metadata[metadataKey] - - if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { - this.invertedIndex[term][fieldName][docRef][metadataKey] = [] - } - - this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) - } - } - - } -} - -/** - * Calculates the average document length for this index - * - * @private - */ -lunr.Builder.prototype.calculateAverageFieldLengths = function () { - - var fieldRefs = Object.keys(this.fieldLengths), - numberOfFields = fieldRefs.length, - accumulator = {}, - documentsWithField = {} - - for (var i = 0; i < numberOfFields; i++) { - var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), - field = fieldRef.fieldName - - documentsWithField[field] || (documentsWithField[field] = 0) - documentsWithField[field] += 1 - - accumulator[field] || (accumulator[field] = 0) - accumulator[field] += this.fieldLengths[fieldRef] - } - - var fields = Object.keys(this._fields) - - for (var i = 0; i < fields.length; i++) { - var fieldName = fields[i] - accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName] - } - - this.averageFieldLength = accumulator -} - -/** - * Builds a vector space model of every document using lunr.Vector - * - * @private - */ -lunr.Builder.prototype.createFieldVectors = function () { - var fieldVectors = {}, - fieldRefs = Object.keys(this.fieldTermFrequencies), - fieldRefsLength = fieldRefs.length, - termIdfCache = Object.create(null) - - for (var i = 0; i < fieldRefsLength; i++) { - var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), - fieldName = fieldRef.fieldName, - fieldLength = this.fieldLengths[fieldRef], - fieldVector = new lunr.Vector, - termFrequencies = this.fieldTermFrequencies[fieldRef], - terms = Object.keys(termFrequencies), - termsLength = terms.length - - - var fieldBoost = this._fields[fieldName].boost || 1, - docBoost = this._documents[fieldRef.docRef].boost || 1 - - for (var j = 0; j < termsLength; j++) { - var term = terms[j], - tf = termFrequencies[term], - termIndex = this.invertedIndex[term]._index, - idf, score, scoreWithPrecision - - if (termIdfCache[term] === undefined) { - idf = lunr.idf(this.invertedIndex[term], this.documentCount) - termIdfCache[term] = idf - } else { - idf = termIdfCache[term] - } - - score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf) - score *= fieldBoost - score *= docBoost - scoreWithPrecision = Math.round(score * 1000) / 1000 - // Converts 1.23456789 to 1.234. - // Reducing the precision so that the vectors take up less - // space when serialised. Doing it now so that they behave - // the same before and after serialisation. Also, this is - // the fastest approach to reducing a number's precision in - // JavaScript. - - fieldVector.insert(termIndex, scoreWithPrecision) - } - - fieldVectors[fieldRef] = fieldVector - } - - this.fieldVectors = fieldVectors -} - -/** - * Creates a token set of all tokens in the index using lunr.TokenSet - * - * @private - */ -lunr.Builder.prototype.createTokenSet = function () { - this.tokenSet = lunr.TokenSet.fromArray( - Object.keys(this.invertedIndex).sort() - ) -} - -/** - * Builds the index, creating an instance of lunr.Index. - * - * This completes the indexing process and should only be called - * once all documents have been added to the index. - * - * @returns {lunr.Index} - */ -lunr.Builder.prototype.build = function () { - this.calculateAverageFieldLengths() - this.createFieldVectors() - this.createTokenSet() - - return new lunr.Index({ - invertedIndex: this.invertedIndex, - fieldVectors: this.fieldVectors, - tokenSet: this.tokenSet, - fields: Object.keys(this._fields), - pipeline: this.searchPipeline - }) -} - -/** - * Applies a plugin to the index builder. - * - * A plugin is a function that is called with the index builder as its context. - * Plugins can be used to customise or extend the behaviour of the index - * in some way. A plugin is just a function, that encapsulated the custom - * behaviour that should be applied when building the index. - * - * The plugin function will be called with the index builder as its argument, additional - * arguments can also be passed when calling use. The function will be called - * with the index builder as its context. - * - * @param {Function} plugin The plugin to apply. - */ -lunr.Builder.prototype.use = function (fn) { - var args = Array.prototype.slice.call(arguments, 1) - args.unshift(this) - fn.apply(this, args) -} -/** - * Contains and collects metadata about a matching document. - * A single instance of lunr.MatchData is returned as part of every - * lunr.Index~Result. - * - * @constructor - * @param {string} term - The term this match data is associated with - * @param {string} field - The field in which the term was found - * @param {object} metadata - The metadata recorded about this term in this field - * @property {object} metadata - A cloned collection of metadata associated with this document. - * @see {@link lunr.Index~Result} - */ -lunr.MatchData = function (term, field, metadata) { - var clonedMetadata = Object.create(null), - metadataKeys = Object.keys(metadata || {}) - - // Cloning the metadata to prevent the original - // being mutated during match data combination. - // Metadata is kept in an array within the inverted - // index so cloning the data can be done with - // Array#slice - for (var i = 0; i < metadataKeys.length; i++) { - var key = metadataKeys[i] - clonedMetadata[key] = metadata[key].slice() - } - - this.metadata = Object.create(null) - - if (term !== undefined) { - this.metadata[term] = Object.create(null) - this.metadata[term][field] = clonedMetadata - } -} - -/** - * An instance of lunr.MatchData will be created for every term that matches a - * document. However only one instance is required in a lunr.Index~Result. This - * method combines metadata from another instance of lunr.MatchData with this - * objects metadata. - * - * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. - * @see {@link lunr.Index~Result} - */ -lunr.MatchData.prototype.combine = function (otherMatchData) { - var terms = Object.keys(otherMatchData.metadata) - - for (var i = 0; i < terms.length; i++) { - var term = terms[i], - fields = Object.keys(otherMatchData.metadata[term]) - - if (this.metadata[term] == undefined) { - this.metadata[term] = Object.create(null) - } - - for (var j = 0; j < fields.length; j++) { - var field = fields[j], - keys = Object.keys(otherMatchData.metadata[term][field]) - - if (this.metadata[term][field] == undefined) { - this.metadata[term][field] = Object.create(null) - } - - for (var k = 0; k < keys.length; k++) { - var key = keys[k] - - if (this.metadata[term][field][key] == undefined) { - this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] - } else { - this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) - } - - } - } - } -} - -/** - * Add metadata for a term/field pair to this instance of match data. - * - * @param {string} term - The term this match data is associated with - * @param {string} field - The field in which the term was found - * @param {object} metadata - The metadata recorded about this term in this field - */ -lunr.MatchData.prototype.add = function (term, field, metadata) { - if (!(term in this.metadata)) { - this.metadata[term] = Object.create(null) - this.metadata[term][field] = metadata - return - } - - if (!(field in this.metadata[term])) { - this.metadata[term][field] = metadata - return - } - - var metadataKeys = Object.keys(metadata) - - for (var i = 0; i < metadataKeys.length; i++) { - var key = metadataKeys[i] - - if (key in this.metadata[term][field]) { - this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) - } else { - this.metadata[term][field][key] = metadata[key] - } - } -} -/** - * A lunr.Query provides a programmatic way of defining queries to be performed - * against a {@link lunr.Index}. - * - * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method - * so the query object is pre-initialized with the right index fields. - * - * @constructor - * @property {lunr.Query~Clause[]} clauses - An array of query clauses. - * @property {string[]} allFields - An array of all available fields in a lunr.Index. - */ -lunr.Query = function (allFields) { - this.clauses = [] - this.allFields = allFields -} - -/** - * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. - * - * This allows wildcards to be added to the beginning and end of a term without having to manually do any string - * concatenation. - * - * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. - * - * @constant - * @default - * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour - * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists - * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists - * @see lunr.Query~Clause - * @see lunr.Query#clause - * @see lunr.Query#term - * @example query term with trailing wildcard - * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) - * @example query term with leading and trailing wildcard - * query.term('foo', { - * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING - * }) - */ - -lunr.Query.wildcard = new String ("*") -lunr.Query.wildcard.NONE = 0 -lunr.Query.wildcard.LEADING = 1 -lunr.Query.wildcard.TRAILING = 2 - -/** - * Constants for indicating what kind of presence a term must have in matching documents. - * - * @constant - * @enum {number} - * @see lunr.Query~Clause - * @see lunr.Query#clause - * @see lunr.Query#term - * @example query term with required presence - * query.term('foo', { presence: lunr.Query.presence.REQUIRED }) - */ -lunr.Query.presence = { - /** - * Term's presence in a document is optional, this is the default value. - */ - OPTIONAL: 1, - - /** - * Term's presence in a document is required, documents that do not contain - * this term will not be returned. - */ - REQUIRED: 2, - - /** - * Term's presence in a document is prohibited, documents that do contain - * this term will not be returned. - */ - PROHIBITED: 3 -} - -/** - * A single clause in a {@link lunr.Query} contains a term and details on how to - * match that term against a {@link lunr.Index}. - * - * @typedef {Object} lunr.Query~Clause - * @property {string[]} fields - The fields in an index this clause should be matched against. - * @property {number} [boost=1] - Any boost that should be applied when matching this clause. - * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. - * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. - * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended. - * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents. - */ - -/** - * Adds a {@link lunr.Query~Clause} to this query. - * - * Unless the clause contains the fields to be matched all fields will be matched. In addition - * a default boost of 1 is applied to the clause. - * - * @param {lunr.Query~Clause} clause - The clause to add to this query. - * @see lunr.Query~Clause - * @returns {lunr.Query} - */ -lunr.Query.prototype.clause = function (clause) { - if (!('fields' in clause)) { - clause.fields = this.allFields - } - - if (!('boost' in clause)) { - clause.boost = 1 - } - - if (!('usePipeline' in clause)) { - clause.usePipeline = true - } - - if (!('wildcard' in clause)) { - clause.wildcard = lunr.Query.wildcard.NONE - } - - if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { - clause.term = "*" + clause.term - } - - if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { - clause.term = "" + clause.term + "*" - } - - if (!('presence' in clause)) { - clause.presence = lunr.Query.presence.OPTIONAL - } - - this.clauses.push(clause) - - return this -} - -/** - * A negated query is one in which every clause has a presence of - * prohibited. These queries require some special processing to return - * the expected results. - * - * @returns boolean - */ -lunr.Query.prototype.isNegated = function () { - for (var i = 0; i < this.clauses.length; i++) { - if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) { - return false - } - } - - return true -} - -/** - * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} - * to the list of clauses that make up this query. - * - * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion - * to a token or token-like string should be done before calling this method. - * - * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an - * array, each term in the array will share the same options. - * - * @param {object|object[]} term - The term(s) to add to the query. - * @param {object} [options] - Any additional properties to add to the query clause. - * @returns {lunr.Query} - * @see lunr.Query#clause - * @see lunr.Query~Clause - * @example adding a single term to a query - * query.term("foo") - * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard - * query.term("foo", { - * fields: ["title"], - * boost: 10, - * wildcard: lunr.Query.wildcard.TRAILING - * }) - * @example using lunr.tokenizer to convert a string to tokens before using them as terms - * query.term(lunr.tokenizer("foo bar")) - */ -lunr.Query.prototype.term = function (term, options) { - if (Array.isArray(term)) { - term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this) - return this - } - - var clause = options || {} - clause.term = term.toString() - - this.clause(clause) - - return this -} -lunr.QueryParseError = function (message, start, end) { - this.name = "QueryParseError" - this.message = message - this.start = start - this.end = end -} - -lunr.QueryParseError.prototype = new Error -lunr.QueryLexer = function (str) { - this.lexemes = [] - this.str = str - this.length = str.length - this.pos = 0 - this.start = 0 - this.escapeCharPositions = [] -} - -lunr.QueryLexer.prototype.run = function () { - var state = lunr.QueryLexer.lexText - - while (state) { - state = state(this) - } -} - -lunr.QueryLexer.prototype.sliceString = function () { - var subSlices = [], - sliceStart = this.start, - sliceEnd = this.pos - - for (var i = 0; i < this.escapeCharPositions.length; i++) { - sliceEnd = this.escapeCharPositions[i] - subSlices.push(this.str.slice(sliceStart, sliceEnd)) - sliceStart = sliceEnd + 1 - } - - subSlices.push(this.str.slice(sliceStart, this.pos)) - this.escapeCharPositions.length = 0 - - return subSlices.join('') -} - -lunr.QueryLexer.prototype.emit = function (type) { - this.lexemes.push({ - type: type, - str: this.sliceString(), - start: this.start, - end: this.pos - }) - - this.start = this.pos -} - -lunr.QueryLexer.prototype.escapeCharacter = function () { - this.escapeCharPositions.push(this.pos - 1) - this.pos += 1 -} - -lunr.QueryLexer.prototype.next = function () { - if (this.pos >= this.length) { - return lunr.QueryLexer.EOS - } - - var char = this.str.charAt(this.pos) - this.pos += 1 - return char -} - -lunr.QueryLexer.prototype.width = function () { - return this.pos - this.start -} - -lunr.QueryLexer.prototype.ignore = function () { - if (this.start == this.pos) { - this.pos += 1 - } - - this.start = this.pos -} - -lunr.QueryLexer.prototype.backup = function () { - this.pos -= 1 -} - -lunr.QueryLexer.prototype.acceptDigitRun = function () { - var char, charCode - - do { - char = this.next() - charCode = char.charCodeAt(0) - } while (charCode > 47 && charCode < 58) - - if (char != lunr.QueryLexer.EOS) { - this.backup() - } -} - -lunr.QueryLexer.prototype.more = function () { - return this.pos < this.length -} - -lunr.QueryLexer.EOS = 'EOS' -lunr.QueryLexer.FIELD = 'FIELD' -lunr.QueryLexer.TERM = 'TERM' -lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' -lunr.QueryLexer.BOOST = 'BOOST' -lunr.QueryLexer.PRESENCE = 'PRESENCE' - -lunr.QueryLexer.lexField = function (lexer) { - lexer.backup() - lexer.emit(lunr.QueryLexer.FIELD) - lexer.ignore() - return lunr.QueryLexer.lexText -} - -lunr.QueryLexer.lexTerm = function (lexer) { - if (lexer.width() > 1) { - lexer.backup() - lexer.emit(lunr.QueryLexer.TERM) - } - - lexer.ignore() - - if (lexer.more()) { - return lunr.QueryLexer.lexText - } -} - -lunr.QueryLexer.lexEditDistance = function (lexer) { - lexer.ignore() - lexer.acceptDigitRun() - lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) - return lunr.QueryLexer.lexText -} - -lunr.QueryLexer.lexBoost = function (lexer) { - lexer.ignore() - lexer.acceptDigitRun() - lexer.emit(lunr.QueryLexer.BOOST) - return lunr.QueryLexer.lexText -} - -lunr.QueryLexer.lexEOS = function (lexer) { - if (lexer.width() > 0) { - lexer.emit(lunr.QueryLexer.TERM) - } -} - -// This matches the separator used when tokenising fields -// within a document. These should match otherwise it is -// not possible to search for some tokens within a document. -// -// It is possible for the user to change the separator on the -// tokenizer so it _might_ clash with any other of the special -// characters already used within the search string, e.g. :. -// -// This means that it is possible to change the separator in -// such a way that makes some words unsearchable using a search -// string. -lunr.QueryLexer.termSeparator = lunr.tokenizer.separator - -lunr.QueryLexer.lexText = function (lexer) { - while (true) { - var char = lexer.next() - - if (char == lunr.QueryLexer.EOS) { - return lunr.QueryLexer.lexEOS - } - - // Escape character is '\' - if (char.charCodeAt(0) == 92) { - lexer.escapeCharacter() - continue - } - - if (char == ":") { - return lunr.QueryLexer.lexField - } - - if (char == "~") { - lexer.backup() - if (lexer.width() > 0) { - lexer.emit(lunr.QueryLexer.TERM) - } - return lunr.QueryLexer.lexEditDistance - } - - if (char == "^") { - lexer.backup() - if (lexer.width() > 0) { - lexer.emit(lunr.QueryLexer.TERM) - } - return lunr.QueryLexer.lexBoost - } - - // "+" indicates term presence is required - // checking for length to ensure that only - // leading "+" are considered - if (char == "+" && lexer.width() === 1) { - lexer.emit(lunr.QueryLexer.PRESENCE) - return lunr.QueryLexer.lexText - } - - // "-" indicates term presence is prohibited - // checking for length to ensure that only - // leading "-" are considered - if (char == "-" && lexer.width() === 1) { - lexer.emit(lunr.QueryLexer.PRESENCE) - return lunr.QueryLexer.lexText - } - - if (char.match(lunr.QueryLexer.termSeparator)) { - return lunr.QueryLexer.lexTerm - } - } -} - -lunr.QueryParser = function (str, query) { - this.lexer = new lunr.QueryLexer (str) - this.query = query - this.currentClause = {} - this.lexemeIdx = 0 -} - -lunr.QueryParser.prototype.parse = function () { - this.lexer.run() - this.lexemes = this.lexer.lexemes - - var state = lunr.QueryParser.parseClause - - while (state) { - state = state(this) - } - - return this.query -} - -lunr.QueryParser.prototype.peekLexeme = function () { - return this.lexemes[this.lexemeIdx] -} - -lunr.QueryParser.prototype.consumeLexeme = function () { - var lexeme = this.peekLexeme() - this.lexemeIdx += 1 - return lexeme -} - -lunr.QueryParser.prototype.nextClause = function () { - var completedClause = this.currentClause - this.query.clause(completedClause) - this.currentClause = {} -} - -lunr.QueryParser.parseClause = function (parser) { - var lexeme = parser.peekLexeme() - - if (lexeme == undefined) { - return - } - - switch (lexeme.type) { - case lunr.QueryLexer.PRESENCE: - return lunr.QueryParser.parsePresence - case lunr.QueryLexer.FIELD: - return lunr.QueryParser.parseField - case lunr.QueryLexer.TERM: - return lunr.QueryParser.parseTerm - default: - var errorMessage = "expected either a field or a term, found " + lexeme.type - - if (lexeme.str.length >= 1) { - errorMessage += " with value '" + lexeme.str + "'" - } - - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } -} - -lunr.QueryParser.parsePresence = function (parser) { - var lexeme = parser.consumeLexeme() - - if (lexeme == undefined) { - return - } - - switch (lexeme.str) { - case "-": - parser.currentClause.presence = lunr.Query.presence.PROHIBITED - break - case "+": - parser.currentClause.presence = lunr.Query.presence.REQUIRED - break - default: - var errorMessage = "unrecognised presence operator'" + lexeme.str + "'" - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - var nextLexeme = parser.peekLexeme() - - if (nextLexeme == undefined) { - var errorMessage = "expecting term or field, found nothing" - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - switch (nextLexeme.type) { - case lunr.QueryLexer.FIELD: - return lunr.QueryParser.parseField - case lunr.QueryLexer.TERM: - return lunr.QueryParser.parseTerm - default: - var errorMessage = "expecting term or field, found '" + nextLexeme.type + "'" - throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) - } -} - -lunr.QueryParser.parseField = function (parser) { - var lexeme = parser.consumeLexeme() - - if (lexeme == undefined) { - return - } - - if (parser.query.allFields.indexOf(lexeme.str) == -1) { - var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), - errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields - - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - parser.currentClause.fields = [lexeme.str] - - var nextLexeme = parser.peekLexeme() - - if (nextLexeme == undefined) { - var errorMessage = "expecting term, found nothing" - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - switch (nextLexeme.type) { - case lunr.QueryLexer.TERM: - return lunr.QueryParser.parseTerm - default: - var errorMessage = "expecting term, found '" + nextLexeme.type + "'" - throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) - } -} - -lunr.QueryParser.parseTerm = function (parser) { - var lexeme = parser.consumeLexeme() - - if (lexeme == undefined) { - return - } - - parser.currentClause.term = lexeme.str.toLowerCase() - - if (lexeme.str.indexOf("*") != -1) { - parser.currentClause.usePipeline = false - } - - var nextLexeme = parser.peekLexeme() - - if (nextLexeme == undefined) { - parser.nextClause() - return - } - - switch (nextLexeme.type) { - case lunr.QueryLexer.TERM: - parser.nextClause() - return lunr.QueryParser.parseTerm - case lunr.QueryLexer.FIELD: - parser.nextClause() - return lunr.QueryParser.parseField - case lunr.QueryLexer.EDIT_DISTANCE: - return lunr.QueryParser.parseEditDistance - case lunr.QueryLexer.BOOST: - return lunr.QueryParser.parseBoost - case lunr.QueryLexer.PRESENCE: - parser.nextClause() - return lunr.QueryParser.parsePresence - default: - var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" - throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) - } -} - -lunr.QueryParser.parseEditDistance = function (parser) { - var lexeme = parser.consumeLexeme() - - if (lexeme == undefined) { - return - } - - var editDistance = parseInt(lexeme.str, 10) - - if (isNaN(editDistance)) { - var errorMessage = "edit distance must be numeric" - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - parser.currentClause.editDistance = editDistance - - var nextLexeme = parser.peekLexeme() - - if (nextLexeme == undefined) { - parser.nextClause() - return - } - - switch (nextLexeme.type) { - case lunr.QueryLexer.TERM: - parser.nextClause() - return lunr.QueryParser.parseTerm - case lunr.QueryLexer.FIELD: - parser.nextClause() - return lunr.QueryParser.parseField - case lunr.QueryLexer.EDIT_DISTANCE: - return lunr.QueryParser.parseEditDistance - case lunr.QueryLexer.BOOST: - return lunr.QueryParser.parseBoost - case lunr.QueryLexer.PRESENCE: - parser.nextClause() - return lunr.QueryParser.parsePresence - default: - var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" - throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) - } -} - -lunr.QueryParser.parseBoost = function (parser) { - var lexeme = parser.consumeLexeme() - - if (lexeme == undefined) { - return - } - - var boost = parseInt(lexeme.str, 10) - - if (isNaN(boost)) { - var errorMessage = "boost must be numeric" - throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) - } - - parser.currentClause.boost = boost - - var nextLexeme = parser.peekLexeme() - - if (nextLexeme == undefined) { - parser.nextClause() - return - } - - switch (nextLexeme.type) { - case lunr.QueryLexer.TERM: - parser.nextClause() - return lunr.QueryParser.parseTerm - case lunr.QueryLexer.FIELD: - parser.nextClause() - return lunr.QueryParser.parseField - case lunr.QueryLexer.EDIT_DISTANCE: - return lunr.QueryParser.parseEditDistance - case lunr.QueryLexer.BOOST: - return lunr.QueryParser.parseBoost - case lunr.QueryLexer.PRESENCE: - parser.nextClause() - return lunr.QueryParser.parsePresence - default: - var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" - throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) - } -} - - /** - * export the module via AMD, CommonJS or as a browser global - * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js - */ - ;(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(factory) - } else if (typeof exports === 'object') { - /** - * Node. Does not work with strict CommonJS, but - * only CommonJS-like environments that support module.exports, - * like Node. - */ - module.exports = factory() - } else { - // Browser globals (root is window) - root.lunr = factory() - } - }(this, function () { - /** - * Just return a value to define the module export. - * This example returns an object, but the module - * can return a function as the exported value. - */ - return lunr - })) -})(); diff --git a/docs/site/search/main.js b/docs/site/search/main.js deleted file mode 100644 index a5e469d..0000000 --- a/docs/site/search/main.js +++ /dev/null @@ -1,109 +0,0 @@ -function getSearchTermFromLocation() { - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == 'q') { - return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20')); - } - } -} - -function joinUrl (base, path) { - if (path.substring(0, 1) === "/") { - // path starts with `/`. Thus it is absolute. - return path; - } - if (base.substring(base.length-1) === "/") { - // base ends with `/` - return base + path; - } - return base + "/" + path; -} - -function escapeHtml (value) { - return value.replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -} - -function formatResult (location, title, summary) { - return ''; -} - -function displayResults (results) { - var search_results = document.getElementById("mkdocs-search-results"); - while (search_results.firstChild) { - search_results.removeChild(search_results.firstChild); - } - if (results.length > 0){ - for (var i=0; i < results.length; i++){ - var result = results[i]; - var html = formatResult(result.location, result.title, result.summary); - search_results.insertAdjacentHTML('beforeend', html); - } - } else { - var noResultsText = search_results.getAttribute('data-no-results-text'); - if (!noResultsText) { - noResultsText = "No results found"; - } - search_results.insertAdjacentHTML('beforeend', '

' + noResultsText + '

'); - } -} - -function doSearch () { - var query = document.getElementById('mkdocs-search-query').value; - if (query.length > min_search_length) { - if (!window.Worker) { - displayResults(search(query)); - } else { - searchWorker.postMessage({query: query}); - } - } else { - // Clear results for short queries - displayResults([]); - } -} - -function initSearch () { - var search_input = document.getElementById('mkdocs-search-query'); - if (search_input) { - search_input.addEventListener("keyup", doSearch); - } - var term = getSearchTermFromLocation(); - if (term) { - search_input.value = term; - doSearch(); - } -} - -function onWorkerMessage (e) { - if (e.data.allowSearch) { - initSearch(); - } else if (e.data.results) { - var results = e.data.results; - displayResults(results); - } else if (e.data.config) { - min_search_length = e.data.config.min_search_length-1; - } -} - -if (!window.Worker) { - console.log('Web Worker API not supported'); - // load index in main thread - $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { - console.log('Loaded worker'); - init(); - window.postMessage = function (msg) { - onWorkerMessage({data: msg}); - }; - }).fail(function (jqxhr, settings, exception) { - console.error('Could not load worker.js'); - }); -} else { - // Wrap search in a web worker - var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); - searchWorker.postMessage({init: true}); - searchWorker.onmessage = onWorkerMessage; -} diff --git a/docs/site/search/search_index.json b/docs/site/search/search_index.json deleted file mode 100644 index 914c4bf..0000000 --- a/docs/site/search/search_index.json +++ /dev/null @@ -1 +0,0 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"GPopt | Star Welcome to GPopt 's website. GPopt does Bayesian optimization using Gaussian Process regression Installing 1st method : by using pip at the command line for the stable version pip install mlsauce Quickstart Bayesian Optimization with GPopt Bayesian Optimization with GPopt Part 2 (save and resume) Hyperparameters tuning with GPopt Documentation The documentation can be found (work in progress) here . Contributing Want to contribute to mlsauce 's development on Github, read this !","title":"Home"},{"location":"#gpopt-star","text":"Welcome to GPopt 's website. GPopt does Bayesian optimization using Gaussian Process regression","title":"GPopt | Star"},{"location":"#installing","text":"1st method : by using pip at the command line for the stable version pip install mlsauce","title":"Installing"},{"location":"#quickstart","text":"Bayesian Optimization with GPopt Bayesian Optimization with GPopt Part 2 (save and resume) Hyperparameters tuning with GPopt","title":"Quickstart"},{"location":"#documentation","text":"The documentation can be found (work in progress) here .","title":"Documentation"},{"location":"#contributing","text":"Want to contribute to mlsauce 's development on Github, read this !","title":"Contributing"},{"location":"CONTRIBUTING/","text":"GPopt 's Code of Conduct 1. Purpose A primary goal of this project is to be inclusive to the largest number of contributors, and most importantly with the most varied and diverse backgrounds possible . As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion, or lack of religion thereof. This code of conduct outlines our expectations for all those who participate to the project, as well as the consequences for unacceptable behavior. We invite all those who participate in, to help us create safe and positive experiences for everyone. 2. Open [Source/Culture/Tech] Citizenship A supplemental goal of this Code of Conduct is to encourage participants to recognize and strengthen the relationships between our actions and their effects on other participants. Communities mirror the societies in which they exist, and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. 3. Expected Behavior The following behaviors are expected and requested of all contributors: Attempt collaboration before conflict . Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this project. Exercise consideration and respect in your speech and actions. Refrain from demeaning, discriminatory, or harassing behavior and speech. Be mindful of your surroundings and of your fellow participants. 4. Unacceptable Behavior The following behaviors are considered harassment and are unacceptable: Violence, threats of violence or violent language directed against another person. Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. Posting or displaying sexually explicit or violent material. Posting or threatening to post other people's personally identifying information (\"doxing\"). Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. Inappropriate photography or recording. Unwelcome sexual attention. This includes, sexualized comments or jokes. Deliberate intimidation, stalking or following (online or in person). Advocating for, or encouraging, any of the above behavior. 5. Consequences of Unacceptable Behavior Unacceptable behavior from any contributor will not be tolerated. Anyone asked to stop unacceptable behavior is expected to comply immediately. If a contributor engages in unacceptable behavior, appropriate action will be taken, up to and including a temporary ban or permanent expulsion without warning. 6. Scope We expect all contributors to abide by this Code of Conduct in all venues, online and in-person. 7. Contact info thierry.moudiki AT gmail.com 8. License and attribution Portions of text derived from the Citizen Code of Conduct .","title":"Contributing"},{"location":"CONTRIBUTING/#gpopts-code-of-conduct","text":"","title":"GPopt's Code of Conduct"},{"location":"CONTRIBUTING/#1-purpose","text":"A primary goal of this project is to be inclusive to the largest number of contributors, and most importantly with the most varied and diverse backgrounds possible . As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion, or lack of religion thereof. This code of conduct outlines our expectations for all those who participate to the project, as well as the consequences for unacceptable behavior. We invite all those who participate in, to help us create safe and positive experiences for everyone.","title":"1. Purpose"},{"location":"CONTRIBUTING/#2-open-sourceculturetech-citizenship","text":"A supplemental goal of this Code of Conduct is to encourage participants to recognize and strengthen the relationships between our actions and their effects on other participants. Communities mirror the societies in which they exist, and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.","title":"2. Open [Source/Culture/Tech] Citizenship"},{"location":"CONTRIBUTING/#3-expected-behavior","text":"The following behaviors are expected and requested of all contributors: Attempt collaboration before conflict . Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this project. Exercise consideration and respect in your speech and actions. Refrain from demeaning, discriminatory, or harassing behavior and speech. Be mindful of your surroundings and of your fellow participants.","title":"3. Expected Behavior"},{"location":"CONTRIBUTING/#4-unacceptable-behavior","text":"The following behaviors are considered harassment and are unacceptable: Violence, threats of violence or violent language directed against another person. Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. Posting or displaying sexually explicit or violent material. Posting or threatening to post other people's personally identifying information (\"doxing\"). Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. Inappropriate photography or recording. Unwelcome sexual attention. This includes, sexualized comments or jokes. Deliberate intimidation, stalking or following (online or in person). Advocating for, or encouraging, any of the above behavior.","title":"4. Unacceptable Behavior"},{"location":"CONTRIBUTING/#5-consequences-of-unacceptable-behavior","text":"Unacceptable behavior from any contributor will not be tolerated. Anyone asked to stop unacceptable behavior is expected to comply immediately. If a contributor engages in unacceptable behavior, appropriate action will be taken, up to and including a temporary ban or permanent expulsion without warning.","title":"5. Consequences of Unacceptable Behavior"},{"location":"CONTRIBUTING/#6-scope","text":"We expect all contributors to abide by this Code of Conduct in all venues, online and in-person.","title":"6. Scope"},{"location":"CONTRIBUTING/#7-contact-info","text":"thierry.moudiki AT gmail.com","title":"7. Contact info"},{"location":"CONTRIBUTING/#8-license-and-attribution","text":"Portions of text derived from the Citizen Code of Conduct .","title":"8. License and attribution"},{"location":"LICENSE/","text":"The Clear BSD License Copyright (c) [2019] [Thierry Moudiki] All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","title":"License"},{"location":"documentation/gpopt/","text":"GPopt Bayesian optimization using Gaussian Process Regression [source] GPOpt GPopt.GPOpt.GPOpt.GPOpt( lower_bound, upper_bound, objective_func=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False, ) Class GPOpt. Arguments: lower_bound: a numpy array; lower bound for researched minimum upper_bound: a numpy array; upper bound for researched minimum objective_func: a function; the objective function to be minimized x_init: initial setting of points where objective_func is evaluated (optional) y_init: initial setting values at points where objective_func is evaluated (optional) n_init: an integer; number of points in the initial setting, when x_init and y_init are not provided n_choices: an integer; number of points for the calculation of expected improvement n_iter: an integer; number of iterations of the minimization algorithm alpha: a float; Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel) n_restarts_optimizer: an integer; The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood. seed: an integer; reproducibility seed save: a string; Specifies where to save the optimizer in its current state n_jobs: an integer; number of jobs for parallel computing on initial setting (can be -1) per_second: a boolean; experimental , default is False (leave to default for now) log_scale: a boolean; experimental , default is False (leave to default for now) see also Bayesian Optimization with GPopt and Hyperparameters tuning with GPopt [source] optimize GPOpt.optimize(verbose=1, n_more_iter=None, abs_tol=None, min_budget=50, func_args=None) Launch optimization loop. Arguments: verbose: an integer; verbose = 0: nothing is printed, verbose = 1: a progress bar is printed (longer than 0), verbose = 2: information about each iteration is printed (longer than 1) n_more_iter: an integer; additional number of iterations for the optimizer (which has been run once) abs_tol: a float; tolerance for convergence of the optimizer (early stopping based on expected improvement) min_budget: an integer (default is 50); minimum number of iterations before early stopping controlled by abs_tol func_args: a list; additional parameters for the objective function (if necessary) see also Bayesian Optimization with GPopt and Hyperparameters tuning with GPopt [source] load GPOpt.load(path) load data from stored shelve. Arguments path : a string; path to stored shelve. See also: Bayesian Optimization with GPopt Part 2 (save and resume) [source] close_shelve GPOpt.close_shelve() Close shelve. Arguments No argument. See also: Bayesian Optimization with GPopt Part 2 (save and resume)","title":"GPopt"},{"location":"documentation/gpopt/#gpopt","text":"Bayesian optimization using Gaussian Process Regression [source]","title":"GPopt"},{"location":"documentation/gpopt/#gpopt_1","text":"GPopt.GPOpt.GPOpt.GPOpt( lower_bound, upper_bound, objective_func=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False, ) Class GPOpt. Arguments: lower_bound: a numpy array; lower bound for researched minimum upper_bound: a numpy array; upper bound for researched minimum objective_func: a function; the objective function to be minimized x_init: initial setting of points where objective_func is evaluated (optional) y_init: initial setting values at points where objective_func is evaluated (optional) n_init: an integer; number of points in the initial setting, when x_init and y_init are not provided n_choices: an integer; number of points for the calculation of expected improvement n_iter: an integer; number of iterations of the minimization algorithm alpha: a float; Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel) n_restarts_optimizer: an integer; The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood. seed: an integer; reproducibility seed save: a string; Specifies where to save the optimizer in its current state n_jobs: an integer; number of jobs for parallel computing on initial setting (can be -1) per_second: a boolean; experimental , default is False (leave to default for now) log_scale: a boolean; experimental , default is False (leave to default for now) see also Bayesian Optimization with GPopt and Hyperparameters tuning with GPopt [source]","title":"GPOpt"},{"location":"documentation/gpopt/#optimize","text":"GPOpt.optimize(verbose=1, n_more_iter=None, abs_tol=None, min_budget=50, func_args=None) Launch optimization loop. Arguments: verbose: an integer; verbose = 0: nothing is printed, verbose = 1: a progress bar is printed (longer than 0), verbose = 2: information about each iteration is printed (longer than 1) n_more_iter: an integer; additional number of iterations for the optimizer (which has been run once) abs_tol: a float; tolerance for convergence of the optimizer (early stopping based on expected improvement) min_budget: an integer (default is 50); minimum number of iterations before early stopping controlled by abs_tol func_args: a list; additional parameters for the objective function (if necessary) see also Bayesian Optimization with GPopt and Hyperparameters tuning with GPopt [source]","title":"optimize"},{"location":"documentation/gpopt/#load","text":"GPOpt.load(path) load data from stored shelve. Arguments path : a string; path to stored shelve. See also: Bayesian Optimization with GPopt Part 2 (save and resume) [source]","title":"load"},{"location":"documentation/gpopt/#close_shelve","text":"GPOpt.close_shelve() Close shelve. Arguments No argument. See also: Bayesian Optimization with GPopt Part 2 (save and resume)","title":"close_shelve"}]} \ No newline at end of file diff --git a/docs/site/search/worker.js b/docs/site/search/worker.js deleted file mode 100644 index 8628dbc..0000000 --- a/docs/site/search/worker.js +++ /dev/null @@ -1,133 +0,0 @@ -var base_path = 'function' === typeof importScripts ? '.' : '/search/'; -var allowSearch = false; -var index; -var documents = {}; -var lang = ['en']; -var data; - -function getScript(script, callback) { - console.log('Loading script: ' + script); - $.getScript(base_path + script).done(function () { - callback(); - }).fail(function (jqxhr, settings, exception) { - console.log('Error: ' + exception); - }); -} - -function getScriptsInOrder(scripts, callback) { - if (scripts.length === 0) { - callback(); - return; - } - getScript(scripts[0], function() { - getScriptsInOrder(scripts.slice(1), callback); - }); -} - -function loadScripts(urls, callback) { - if( 'function' === typeof importScripts ) { - importScripts.apply(null, urls); - callback(); - } else { - getScriptsInOrder(urls, callback); - } -} - -function onJSONLoaded () { - data = JSON.parse(this.responseText); - var scriptsToLoad = ['lunr.js']; - if (data.config && data.config.lang && data.config.lang.length) { - lang = data.config.lang; - } - if (lang.length > 1 || lang[0] !== "en") { - scriptsToLoad.push('lunr.stemmer.support.js'); - if (lang.length > 1) { - scriptsToLoad.push('lunr.multi.js'); - } - if (lang.includes("ja") || lang.includes("jp")) { - scriptsToLoad.push('tinyseg.js'); - } - for (var i=0; i < lang.length; i++) { - if (lang[i] != 'en') { - scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); - } - } - } - loadScripts(scriptsToLoad, onScriptsLoaded); -} - -function onScriptsLoaded () { - console.log('All search scripts loaded, building Lunr index...'); - if (data.config && data.config.separator && data.config.separator.length) { - lunr.tokenizer.separator = new RegExp(data.config.separator); - } - - if (data.index) { - index = lunr.Index.load(data.index); - data.docs.forEach(function (doc) { - documents[doc.location] = doc; - }); - console.log('Lunr pre-built index loaded, search ready'); - } else { - index = lunr(function () { - if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { - this.use(lunr[lang[0]]); - } else if (lang.length > 1) { - this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility - } - this.field('title'); - this.field('text'); - this.ref('location'); - - for (var i=0; i < data.docs.length; i++) { - var doc = data.docs[i]; - this.add(doc); - documents[doc.location] = doc; - } - }); - console.log('Lunr index built, search ready'); - } - allowSearch = true; - postMessage({config: data.config}); - postMessage({allowSearch: allowSearch}); -} - -function init () { - var oReq = new XMLHttpRequest(); - oReq.addEventListener("load", onJSONLoaded); - var index_path = base_path + '/search_index.json'; - if( 'function' === typeof importScripts ){ - index_path = 'search_index.json'; - } - oReq.open("GET", index_path); - oReq.send(); -} - -function search (query) { - if (!allowSearch) { - console.error('Assets for search still loading'); - return; - } - - var resultDocuments = []; - var results = index.search(query); - for (var i=0; i < results.length; i++){ - var result = results[i]; - doc = documents[result.ref]; - doc.summary = doc.text.substring(0, 200); - resultDocuments.push(doc); - } - return resultDocuments; -} - -if( 'function' === typeof importScripts ) { - onmessage = function (e) { - if (e.data.init) { - init(); - } else if (e.data.query) { - postMessage({ results: search(e.data.query) }); - } else { - console.error("Worker - Unrecognized message: " + e); - } - }; -} diff --git a/docs/site/sitemap.xml b/docs/site/sitemap.xml deleted file mode 100644 index 0f8724e..0000000 --- a/docs/site/sitemap.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/site/sitemap.xml.gz b/docs/site/sitemap.xml.gz deleted file mode 100644 index e89e4e3..0000000 Binary files a/docs/site/sitemap.xml.gz and /dev/null differ diff --git a/docs/sources/CONTRIBUTING.md b/docs/sources/CONTRIBUTING.md deleted file mode 100644 index 1bbdb68..0000000 --- a/docs/sources/CONTRIBUTING.md +++ /dev/null @@ -1,59 +0,0 @@ -# `GPopt`'s Code of Conduct - -## 1. Purpose - -A primary goal of this project is to be __inclusive__ to the largest number of contributors, and most importantly __with the most varied and diverse backgrounds possible__. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion, or lack of religion thereof. - -This code of conduct outlines our expectations for all those who participate to the project, as well as the consequences for unacceptable behavior. - -We invite all those who participate in, to help us create safe and positive experiences for everyone. - -## 2. Open [Source/Culture/Tech] Citizenship - -A supplemental goal of this Code of Conduct is to encourage participants to recognize and strengthen the relationships between our actions and their effects on other participants. - -Communities mirror the societies in which they exist, and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. - -## 3. Expected Behavior - -The following behaviors are expected and requested of all contributors: - - * __Attempt collaboration before conflict__. - * Participate in an __authentic__ and active way. In doing so, you contribute to the health and longevity of this project. - * Exercise consideration and respect in your speech and actions. - * Refrain from demeaning, discriminatory, or harassing behavior and speech. - * Be mindful of your surroundings and of your fellow participants. - -## 4. Unacceptable Behavior - -The following behaviors are considered harassment and are unacceptable: - - * Violence, threats of violence or violent language directed against another person. - * Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. - * Posting or displaying sexually explicit or violent material. - * Posting or threatening to post other people's personally identifying information ("doxing"). - * Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. - * Inappropriate photography or recording. - * Unwelcome sexual attention. This includes, sexualized comments or jokes. - * Deliberate intimidation, stalking or following (online or in person). - * Advocating for, or encouraging, any of the above behavior. - -## 5. Consequences of Unacceptable Behavior - -Unacceptable behavior from any contributor will not be tolerated. - -Anyone asked to stop unacceptable behavior is expected to comply immediately. - -If a contributor engages in unacceptable behavior, appropriate action will be taken, up to and including a temporary ban or permanent expulsion without warning. - -## 6. Scope - -We expect all contributors to abide by this Code of Conduct in all venues, online and in-person. - -## 7. Contact info - -thierry.moudiki AT gmail.com - -## 8. License and attribution - -Portions of text derived from the [Citizen Code of Conduct](http://citizencodeofconduct.org/). diff --git a/docs/sources/LICENSE.md b/docs/sources/LICENSE.md deleted file mode 100644 index 5e88b1a..0000000 --- a/docs/sources/LICENSE.md +++ /dev/null @@ -1,32 +0,0 @@ -The Clear BSD License - -Copyright (c) [2019] [Thierry Moudiki] -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the disclaimer -below) provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY -THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/docs/sources/documentation/gpopt.md b/docs/sources/documentation/gpopt.md deleted file mode 100644 index 345b398..0000000 --- a/docs/sources/documentation/gpopt.md +++ /dev/null @@ -1,164 +0,0 @@ -# GPopt - -_Bayesian optimization using Gaussian Process Regression_ - -[[source]](https://github.com/Techtonique/GPopt/blob/main/GPopt/GPOpt/GPOpt.py#L22) - -### GPOpt - - -```python -GPopt.GPOpt.GPOpt.GPOpt( - lower_bound, - upper_bound, - objective_func=None, - x_init=None, - y_init=None, - n_init=10, - n_choices=25000, - n_iter=190, - alpha=1e-06, - n_restarts_optimizer=25, - seed=123, - save=None, - n_jobs=1, - per_second=False, - log_scale=False, -) -``` - - -Class GPOpt. - -__Arguments:__ - -lower_bound: a numpy array; - lower bound for researched minimum - -upper_bound: a numpy array; - upper bound for researched minimum - -objective_func: a function; - the objective function to be minimized - -x_init: - initial setting of points where `objective_func` is evaluated (optional) - -y_init: - initial setting values at points where `objective_func` is evaluated (optional) - -n_init: an integer; - number of points in the initial setting, when `x_init` and `y_init` are not provided - -n_choices: an integer; - number of points for the calculation of expected improvement - -n_iter: an integer; - number of iterations of the minimization algorithm - -alpha: a float; - Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel) - -n_restarts_optimizer: an integer; - The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood. - -seed: an integer; - reproducibility seed - -save: a string; - Specifies where to save the optimizer in its current state - -n_jobs: an integer; - number of jobs for parallel computing on initial setting (can be -1) - -per_second: a boolean; - __experimental__, default is False (leave to default for now) - -log_scale: a boolean; - __experimental__, default is False (leave to default for now) - -see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) - and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) - - ----- - -[[source]](https://github.com/Techtonique/GPopt/blob/main/GPopt/GPOpt/GPOpt.py#L337) - -### optimize - - -```python -GPOpt.optimize(verbose=1, n_more_iter=None, abs_tol=None, min_budget=50, func_args=None) -``` - - -Launch optimization loop. - -__Arguments:__ - -verbose: an integer; - verbose = 0: nothing is printed, - verbose = 1: a progress bar is printed (longer than 0), - verbose = 2: information about each iteration is printed (longer than 1) - -n_more_iter: an integer; - additional number of iterations for the optimizer (which has been run once) - -abs_tol: a float; - tolerance for convergence of the optimizer (early stopping based on expected improvement) - -min_budget: an integer (default is 50); - minimum number of iterations before early stopping controlled by `abs_tol` - -func_args: a list; - additional parameters for the objective function (if necessary) - -see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) -and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) - - ----- - -[[source]](https://github.com/Techtonique/GPopt/blob/main/GPopt/GPOpt/GPOpt.py#L219) - -### load - - -```python -GPOpt.load(path) -``` - - -load data from stored shelve. - -__Arguments__ - -path : a string; path to stored shelve. - -See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) - - ----- - -[[source]](https://github.com/Techtonique/GPopt/blob/main/GPopt/GPOpt/GPOpt.py#L241) - -### close_shelve - - -```python -GPOpt.close_shelve() -``` - - -Close shelve. - -__Arguments__ - -No argument. - -See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) - - ----- - diff --git a/docs/sources/index.md b/docs/sources/index.md deleted file mode 100644 index 82857ff..0000000 --- a/docs/sources/index.md +++ /dev/null @@ -1,33 +0,0 @@ - -# GPopt | Star - -![PyPI](https://img.shields.io/pypi/v/gpopt) [![PyPI - License](https://img.shields.io/pypi/l/gpopt)](./LICENSE.md) [![Downloads](https://pepy.tech/badge/gpopt)](https://pepy.tech/project/gpopt) [![Last Commit](https://img.shields.io/github/last-commit/Techtonique/gpopt)](https://github.com/Techtonique/gpopt) - -Welcome to __GPopt__'s website. - -__GPopt__ does Bayesian optimization using Gaussian Process regression - -## Installing - -- __1st method__: by using `pip` at the command line for the stable version - -```bash -pip install mlsauce -``` - -## Quickstart - -- [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) -- [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) -- [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) - -## Documentation - -The documentation can be found (work in progress) [here](documentation/gpopt.md). - - -## Contributing - -Want to contribute to __mlsauce__'s development on Github, [read this](CONTRIBUTING.md)! - - \ No newline at end of file diff --git a/docs/static/syntax-highlighting.css b/docs/static/syntax-highlighting.css new file mode 100644 index 0000000..6f74276 --- /dev/null +++ b/docs/static/syntax-highlighting.css @@ -0,0 +1,80 @@ +/* monokai color scheme, see pdoc/template/README.md */ +pre { line-height: 125%; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 20px; } +.pdoc-code .hll { background-color: #49483e } +.pdoc-code { background: #272822; color: #f8f8f2 } +.pdoc-code .c { color: #75715e } /* Comment */ +.pdoc-code .err { color: #960050; background-color: #1e0010 } /* Error */ +.pdoc-code .esc { color: #f8f8f2 } /* Escape */ +.pdoc-code .g { color: #f8f8f2 } /* Generic */ +.pdoc-code .k { color: #66d9ef } /* Keyword */ +.pdoc-code .l { color: #ae81ff } /* Literal */ +.pdoc-code .n { color: #f8f8f2 } /* Name */ +.pdoc-code .o { color: #f92672 } /* Operator */ +.pdoc-code .x { color: #f8f8f2 } /* Other */ +.pdoc-code .p { color: #f8f8f2 } /* Punctuation */ +.pdoc-code .ch { color: #75715e } /* Comment.Hashbang */ +.pdoc-code .cm { color: #75715e } /* Comment.Multiline */ +.pdoc-code .cp { color: #75715e } /* Comment.Preproc */ +.pdoc-code .cpf { color: #75715e } /* Comment.PreprocFile */ +.pdoc-code .c1 { color: #75715e } /* Comment.Single */ +.pdoc-code .cs { color: #75715e } /* Comment.Special */ +.pdoc-code .gd { color: #f92672 } /* Generic.Deleted */ +.pdoc-code .ge { color: #f8f8f2; font-style: italic } /* Generic.Emph */ +.pdoc-code .gr { color: #f8f8f2 } /* Generic.Error */ +.pdoc-code .gh { color: #f8f8f2 } /* Generic.Heading */ +.pdoc-code .gi { color: #a6e22e } /* Generic.Inserted */ +.pdoc-code .go { color: #66d9ef } /* Generic.Output */ +.pdoc-code .gp { color: #f92672; font-weight: bold } /* Generic.Prompt */ +.pdoc-code .gs { color: #f8f8f2; font-weight: bold } /* Generic.Strong */ +.pdoc-code .gu { color: #75715e } /* Generic.Subheading */ +.pdoc-code .gt { color: #f8f8f2 } /* Generic.Traceback */ +.pdoc-code .kc { color: #66d9ef } /* Keyword.Constant */ +.pdoc-code .kd { color: #66d9ef } /* Keyword.Declaration */ +.pdoc-code .kn { color: #f92672 } /* Keyword.Namespace */ +.pdoc-code .kp { color: #66d9ef } /* Keyword.Pseudo */ +.pdoc-code .kr { color: #66d9ef } /* Keyword.Reserved */ +.pdoc-code .kt { color: #66d9ef } /* Keyword.Type */ +.pdoc-code .ld { color: #e6db74 } /* Literal.Date */ +.pdoc-code .m { color: #ae81ff } /* Literal.Number */ +.pdoc-code .s { color: #e6db74 } /* Literal.String */ +.pdoc-code .na { color: #a6e22e } /* Name.Attribute */ +.pdoc-code .nb { color: #f8f8f2 } /* Name.Builtin */ +.pdoc-code .nc { color: #a6e22e } /* Name.Class */ +.pdoc-code .no { color: #66d9ef } /* Name.Constant */ +.pdoc-code .nd { color: #a6e22e } /* Name.Decorator */ +.pdoc-code .ni { color: #f8f8f2 } /* Name.Entity */ +.pdoc-code .ne { color: #a6e22e } /* Name.Exception */ +.pdoc-code .nf { color: #a6e22e } /* Name.Function */ +.pdoc-code .nl { color: #f8f8f2 } /* Name.Label */ +.pdoc-code .nn { color: #f8f8f2 } /* Name.Namespace */ +.pdoc-code .nx { color: #a6e22e } /* Name.Other */ +.pdoc-code .py { color: #f8f8f2 } /* Name.Property */ +.pdoc-code .nt { color: #f92672 } /* Name.Tag */ +.pdoc-code .nv { color: #f8f8f2 } /* Name.Variable */ +.pdoc-code .ow { color: #f92672 } /* Operator.Word */ +.pdoc-code .w { color: #f8f8f2 } /* Text.Whitespace */ +.pdoc-code .mb { color: #ae81ff } /* Literal.Number.Bin */ +.pdoc-code .mf { color: #ae81ff } /* Literal.Number.Float */ +.pdoc-code .mh { color: #ae81ff } /* Literal.Number.Hex */ +.pdoc-code .mi { color: #ae81ff } /* Literal.Number.Integer */ +.pdoc-code .mo { color: #ae81ff } /* Literal.Number.Oct */ +.pdoc-code .sa { color: #e6db74 } /* Literal.String.Affix */ +.pdoc-code .sb { color: #e6db74 } /* Literal.String.Backtick */ +.pdoc-code .sc { color: #e6db74 } /* Literal.String.Char */ +.pdoc-code .dl { color: #e6db74 } /* Literal.String.Delimiter */ +.pdoc-code .sd { color: #e6db74 } /* Literal.String.Doc */ +.pdoc-code .s2 { color: #e6db74 } /* Literal.String.Double */ +.pdoc-code .se { color: #ae81ff } /* Literal.String.Escape */ +.pdoc-code .sh { color: #e6db74 } /* Literal.String.Heredoc */ +.pdoc-code .si { color: #e6db74 } /* Literal.String.Interpol */ +.pdoc-code .sx { color: #e6db74 } /* Literal.String.Other */ +.pdoc-code .sr { color: #e6db74 } /* Literal.String.Regex */ +.pdoc-code .s1 { color: #e6db74 } /* Literal.String.Single */ +.pdoc-code .ss { color: #e6db74 } /* Literal.String.Symbol */ +.pdoc-code .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ +.pdoc-code .fm { color: #a6e22e } /* Name.Function.Magic */ +.pdoc-code .vc { color: #f8f8f2 } /* Name.Variable.Class */ +.pdoc-code .vg { color: #f8f8f2 } /* Name.Variable.Global */ +.pdoc-code .vi { color: #f8f8f2 } /* Name.Variable.Instance */ +.pdoc-code .vm { color: #f8f8f2 } /* Name.Variable.Magic */ \ No newline at end of file diff --git a/docs/static/theme.css b/docs/static/theme.css new file mode 100644 index 0000000..6c7f72d --- /dev/null +++ b/docs/static/theme.css @@ -0,0 +1,20 @@ +:root { + --pdoc-background: #212529; +} + +.pdoc { + --text: #f7f7f7; + --muted: #9d9d9d; + --link: #58a6ff; + --link-hover: #3989ff; + --code: #333; + --active: #555; + + --accent: #343434; + --accent2: #555; + + --nav-hover: rgba(0, 0, 0, 0.1); + --name: #77C1FF; + --def: #0cdd0c; + --annotation: #00c037; +} \ No newline at end of file diff --git a/docs/t-logo.png b/docs/t-logo.png new file mode 100644 index 0000000..14342d0 Binary files /dev/null and b/docs/t-logo.png differ diff --git a/docs/t-logo2.png b/docs/t-logo2.png new file mode 100644 index 0000000..b60c56b Binary files /dev/null and b/docs/t-logo2.png differ diff --git a/docs/templates/CONTRIBUTING.md b/docs/templates/CONTRIBUTING.md deleted file mode 100644 index 1bbdb68..0000000 --- a/docs/templates/CONTRIBUTING.md +++ /dev/null @@ -1,59 +0,0 @@ -# `GPopt`'s Code of Conduct - -## 1. Purpose - -A primary goal of this project is to be __inclusive__ to the largest number of contributors, and most importantly __with the most varied and diverse backgrounds possible__. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion, or lack of religion thereof. - -This code of conduct outlines our expectations for all those who participate to the project, as well as the consequences for unacceptable behavior. - -We invite all those who participate in, to help us create safe and positive experiences for everyone. - -## 2. Open [Source/Culture/Tech] Citizenship - -A supplemental goal of this Code of Conduct is to encourage participants to recognize and strengthen the relationships between our actions and their effects on other participants. - -Communities mirror the societies in which they exist, and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. - -## 3. Expected Behavior - -The following behaviors are expected and requested of all contributors: - - * __Attempt collaboration before conflict__. - * Participate in an __authentic__ and active way. In doing so, you contribute to the health and longevity of this project. - * Exercise consideration and respect in your speech and actions. - * Refrain from demeaning, discriminatory, or harassing behavior and speech. - * Be mindful of your surroundings and of your fellow participants. - -## 4. Unacceptable Behavior - -The following behaviors are considered harassment and are unacceptable: - - * Violence, threats of violence or violent language directed against another person. - * Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. - * Posting or displaying sexually explicit or violent material. - * Posting or threatening to post other people's personally identifying information ("doxing"). - * Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. - * Inappropriate photography or recording. - * Unwelcome sexual attention. This includes, sexualized comments or jokes. - * Deliberate intimidation, stalking or following (online or in person). - * Advocating for, or encouraging, any of the above behavior. - -## 5. Consequences of Unacceptable Behavior - -Unacceptable behavior from any contributor will not be tolerated. - -Anyone asked to stop unacceptable behavior is expected to comply immediately. - -If a contributor engages in unacceptable behavior, appropriate action will be taken, up to and including a temporary ban or permanent expulsion without warning. - -## 6. Scope - -We expect all contributors to abide by this Code of Conduct in all venues, online and in-person. - -## 7. Contact info - -thierry.moudiki AT gmail.com - -## 8. License and attribution - -Portions of text derived from the [Citizen Code of Conduct](http://citizencodeofconduct.org/). diff --git a/docs/templates/LICENSE.md b/docs/templates/LICENSE.md deleted file mode 100644 index 5e88b1a..0000000 --- a/docs/templates/LICENSE.md +++ /dev/null @@ -1,32 +0,0 @@ -The Clear BSD License - -Copyright (c) [2019] [Thierry Moudiki] -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted (subject to the limitations in the disclaimer -below) provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY -THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/docs/templates/documentation/gpopt.md b/docs/templates/documentation/gpopt.md deleted file mode 100644 index e93e901..0000000 --- a/docs/templates/documentation/gpopt.md +++ /dev/null @@ -1,5 +0,0 @@ -# GPopt - -_Bayesian optimization using Gaussian Process Regression_ - -{{autogenerated}} \ No newline at end of file diff --git a/docs/templates/index.md b/docs/templates/index.md deleted file mode 100644 index 82857ff..0000000 --- a/docs/templates/index.md +++ /dev/null @@ -1,33 +0,0 @@ - -# GPopt | Star - -![PyPI](https://img.shields.io/pypi/v/gpopt) [![PyPI - License](https://img.shields.io/pypi/l/gpopt)](./LICENSE.md) [![Downloads](https://pepy.tech/badge/gpopt)](https://pepy.tech/project/gpopt) [![Last Commit](https://img.shields.io/github/last-commit/Techtonique/gpopt)](https://github.com/Techtonique/gpopt) - -Welcome to __GPopt__'s website. - -__GPopt__ does Bayesian optimization using Gaussian Process regression - -## Installing - -- __1st method__: by using `pip` at the command line for the stable version - -```bash -pip install mlsauce -``` - -## Quickstart - -- [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) -- [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) -- [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) - -## Documentation - -The documentation can be found (work in progress) [here](documentation/gpopt.md). - - -## Contributing - -Want to contribute to __mlsauce__'s development on Github, [read this](CONTRIBUTING.md)! - - \ No newline at end of file diff --git a/examples/branin_hart.py b/examples/branin_hart.py index 922760a..3eeb782 100644 --- a/examples/branin_hart.py +++ b/examples/branin_hart.py @@ -93,13 +93,13 @@ def hart6(xx): upper_bound = np.array([10, 15]), n_init=10, n_iter=10) gp_opt3.optimize(verbose=1) -plt.plot(np.diff(gp_opt3.max_ei)) +#plt.plot(np.diff(gp_opt3.max_ei)) print(gp_opt3.y_min) gp_opt3.optimize(verbose=1, n_more_iter=10) print(gp_opt3.y_min) -plt.plot(np.diff(gp_opt3.max_ei)) +#plt.plot(np.diff(gp_opt3.max_ei)) gp_opt3.optimize(verbose=1, n_more_iter=50) -plt.plot(np.diff(gp_opt3.max_ei)) +#plt.plot(np.diff(gp_opt3.max_ei)) print(gp_opt3.y_min) print("\n") diff --git a/examples/lazy_hart6D.py b/examples/lazy_hart6D.py new file mode 100644 index 0000000..e2b2fad --- /dev/null +++ b/examples/lazy_hart6D.py @@ -0,0 +1,107 @@ +import os +import GPopt as gp +from time import time +import numpy as np +import matplotlib.pyplot as plt +from os import chdir +from scipy.optimize import minimize + +print(f"\n ----- Running: {os.path.basename(__file__)}... ----- \n") + +print(f"\n Hartmann 6D function:") + +# [0, 1]^6 +def hart6(xx): + + alpha = np.array([1.0, 1.2, 3.0, 3.2]) + + A = np.array([10, 3, 17, 3.5, 1.7, 8, + 0.05, 10, 17, 0.1, 8, 14, + 3, 3.5, 1.7, 10, 17, 8, + 17, 8, 0.05, 10, 0.1, 14]).reshape(4, 6) + + P = 1e-4 * np.array([1312, 1696, 5569, 124, 8283, 5886, + 2329, 4135, 8307, 3736, 1004, 9991, + 2348, 1451, 3522, 2883, 3047, 6650, + 4047, 8828, 8732, 5743, 1091, 381]).reshape(4, 6) + + xxmat = np.tile(xx,4).reshape(4, 6) + + inner = np.sum(A*(xxmat-P)**2, axis = 1) + outer = np.sum(alpha * np.exp(-inner)) + + return(-outer) + +# "True" minimum +print("\n") +res = minimize(hart6, x0=[0, 0, 0, 0, 0, 0], method='Nelder-Mead', tol=1e-6) +print("0 - hart6 minimize ----------") +print(res.x) +print(hart6(res.x)) + + +print("---------- \n") +print("2 - Hartmann 6D") +# hart6 +gp_opt1 = gp.GPOpt(objective_func=hart6, + lower_bound = np.repeat(0, 6), + upper_bound = np.repeat(1, 6), + n_init=10, n_iter=90) + + +print("\n 2 - 1 type_exec = 'independent' sequential") +gp_opt1.lazyoptimize(method = "mc", verbose=2, abs_tol=1e-4, + type_exec = "independent", + estimators = ["LinearRegression", + "RidgeCV", + "LassoCV", + "ElasticNetCV", + "KNeighborsRegressor", + "BaggingRegressor", + "ExtraTreesRegressor", + "RandomForestRegressor", + ] + ) +print(gp_opt1.best_surrogate, gp_opt1.x_min, gp_opt1.y_min) +print("\n") + +print("\n 2 - 1 type_exec = 'independent' parallel") +gp_opt3 = gp.GPOpt(objective_func=hart6, + lower_bound = np.repeat(0, 6), + upper_bound = np.repeat(1, 6), + n_init=10, n_iter=190, + n_jobs=-1) + +print("\n 2 - 1 type_exec = 'independent'") +start = time() +gp_opt3.lazyoptimize(method = "mc", + verbose=0, abs_tol=1e-2, + type_exec = "independent", + estimators = ["LinearRegression", + "Ridge" + "ElasticNet", + "Lasso", + "BaggingRegressor", + "ExtraTreesRegressor", + ] + ) +print(gp_opt3.best_surrogate, gp_opt3.x_min, gp_opt3.y_min) +print("Elapsed (total): ", time() - start) +print("\n") + + +print("\n 2 - 2 type_exec = 'queue'") + +gp_opt2 = gp.GPOpt(objective_func=hart6, + lower_bound = np.repeat(0, 6), + upper_bound = np.repeat(1, 6), + n_init=10, n_iter=90) + +gp_opt2.lazyoptimize(method = "mc", verbose=2, abs_tol=1e-4, + type_exec = "queue", + estimators = [ "BaggingRegressor", + "ExtraTreesRegressor", + ] + ) +print(gp_opt2.x_min, gp_opt2.y_min) +print("\n") \ No newline at end of file diff --git a/examples/lazybranin.py b/examples/lazybranin.py new file mode 100644 index 0000000..aa03783 --- /dev/null +++ b/examples/lazybranin.py @@ -0,0 +1,56 @@ +import os +import GPopt as gp +import numpy as np +from os import chdir +from scipy.optimize import minimize + +print(f"\n ----- Running: {os.path.basename(__file__)}... ----- \n") + +# branin +def branin(x): + x1 = x[0] + x2 = x[1] + term1 = (x2 - (5.1*x1**2)/(4*np.pi**2) + (5*x1)/np.pi - 6)**2 + term2 = 10*(1-1/(8*np.pi))*np.cos(x1) + return (term1 + term2 + 10) + + +# "True" minimum +print("\n") +res = minimize(branin, x0=[0, 0], method='Nelder-Mead', tol=1e-6) +print("0 - branin minimize ----------") +print(res.x) +print(branin(res.x)) + + +X_init = np.asarray([[2.5000, 2.5000], +[10.0, 3.7500], +[-1.2500, 6.2500], +[5.6250, 5.6250], +[8.1250, 8.1250], +[9.3750, 1.8750], +[-3.1250, 4.3750], +[2.8125, 4.6875], +[5.3125, 7.1875], +[10, 0.9375]]) +Y_init = np.asarray([branin(X_init[i,:]) for i in range(10)]) + +print("\n") +print("X_init ---------- \n") +print(X_init) +print("\n") +print("Y_init ---------- \n") +print(Y_init) +print("\n") + +gp_opt1 = gp.GPOpt(x_init = X_init, + y_init = Y_init, + lower_bound = np.array([-5, 0]), + upper_bound = np.array([10, 15]), + objective_func=branin, + n_choices=25000, + n_init=10, + n_iter=190, + seed=4327) + +gp_opt1.lazyoptimize(method = "mc", verbose=2, abs_tol=1e-4) diff --git a/gpopt-docs/GPopt/GPOpt.html b/gpopt-docs/GPopt/GPOpt.html index 35b29ff..0d7cbc6 100644 --- a/gpopt-docs/GPopt/GPOpt.html +++ b/gpopt-docs/GPopt/GPOpt.html @@ -38,6 +38,9 @@

API Documentation

  • objective_func
  • +
  • + params_names +
  • lower_bound
  • @@ -167,646 +170,663 @@

    -
     21class GPOpt:
    - 22    """Class GPOpt.
    - 23
    - 24    # Arguments:
    - 25
    - 26        lower_bound: a numpy array;
    - 27            lower bound for researched minimum
    - 28
    - 29        upper_bound: a numpy array;
    - 30            upper bound for researched minimum
    - 31
    - 32        objective_func: a function;
    - 33            the objective function to be minimized
    - 34
    - 35        gp_obj: a GaussianProcessRegressor object;
    - 36            An ML model for estimating the uncertainty around the objective function        
    - 37
    - 38        x_init:
    - 39            initial setting of points where `objective_func` is evaluated (optional)
    - 40
    - 41        y_init:
    - 42            initial setting values at points where `objective_func` is evaluated (optional)
    - 43
    - 44        n_init: an integer;
    - 45            number of points in the initial setting, when `x_init` and `y_init` are not provided
    - 46
    - 47        n_choices: an integer;
    - 48            number of points for the calculation of expected improvement
    - 49
    - 50        n_iter: an integer;
    - 51            number of iterations of the minimization algorithm
    - 52
    - 53        alpha: a float;
    - 54            Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)
    - 55
    - 56        n_restarts_optimizer: an integer;
    - 57            The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood.
    - 58
    - 59        seed: an integer;
    - 60            reproducibility seed
    - 61
    - 62        save: a string;
    - 63            Specifies where to save the optimizer in its current state
    - 64
    - 65        n_jobs: an integer;
    - 66            number of jobs for parallel computing on initial setting (can be -1)
    - 67
    - 68        per_second: a boolean;
    - 69            __experimental__, default is False (leave to default for now)
    - 70
    - 71        log_scale: a boolean;
    - 72            __experimental__, default is False (leave to default for now)
    - 73
    - 74    see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    - 75        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    - 76
    - 77    """
    - 78
    - 79    def __init__(
    - 80        self,        
    - 81        lower_bound,
    - 82        upper_bound,
    - 83        objective_func=None,
    - 84        gp_obj=None,
    - 85        x_init=None,
    - 86        y_init=None,
    - 87        n_init=10,
    - 88        n_choices=25000,
    - 89        n_iter=190,
    - 90        alpha=1e-6,
    - 91        n_restarts_optimizer=25,
    - 92        seed=123,
    - 93        save=None,
    - 94        n_jobs=1,
    - 95        per_second=False,  # /!\ very experimental
    - 96        log_scale=False,  # /!\ experimental
    - 97    ):
    - 98
    - 99        n_dims = len(lower_bound)
    -100
    -101        assert n_dims == len(
    -102            upper_bound
    -103        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    -104
    -105        self.objective_func = objective_func
    -106        self.lower_bound = lower_bound
    -107        self.upper_bound = upper_bound
    -108        self.y_init = y_init
    -109        self.log_scale = log_scale
    -110        self.n_dims = n_dims
    -111        self.n_init = n_init
    -112        self.n_choices = n_choices
    -113        self.n_iter = n_iter
    -114        self.alpha = alpha
    -115        self.n_restarts_optimizer = n_restarts_optimizer
    -116        self.seed = seed
    -117        self.save = save
    -118        self.per_second = per_second
    -119        self.x_min = None
    -120        self.y_min = None
    -121        self.y_mean = None
    -122        self.y_std = None
    -123        self.ei = np.array([])
    -124        self.max_ei = []
    -125        if gp_obj is None:
    -126            self.gp_obj = GaussianProcessRegressor(
    -127                kernel=Matern(nu=2.5),
    -128                alpha=self.alpha,
    -129                normalize_y=True,
    -130                n_restarts_optimizer=self.n_restarts_optimizer,
    -131                random_state=self.seed,
    -132            )
    -133        else:
    -134            self.gp_obj = gp_obj
    -135
    -136        # Sobol seqs for initial design and choices
    -137        sobol_seq_init = np.transpose(
    -138            generate_sobol2(
    -139                n_dims=self.n_dims,
    -140                n_points=self.n_init,
    -141                skip=2,
    -142            )
    -143        )
    -144        sobol_seq_choices = np.transpose(
    -145            generate_sobol2(
    -146                n_dims=self.n_dims,
    -147                n_points=self.n_choices,
    -148                skip=self.n_init + 2,
    -149            )
    -150        )
    -151
    -152        # Sobol seqs for initial design and choices with bounds
    -153        if self.log_scale == False:
    -154
    -155            bounds_range = upper_bound - lower_bound
    -156            self.x_init = (
    -157                bounds_range * sobol_seq_init + lower_bound
    -158                if x_init is None
    -159                else x_init
    -160            )
    -161            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    -162
    -163        else:  # (!) experimental
    -164
    -165            assert (
    -166                lower_bound > 0
    -167            ).all(), "all elements of `lower_bound` must be > 0"
    -168            assert (
    -169                upper_bound > 0
    -170            ).all(), "all elements of `upper_bound` must be > 0"
    -171
    -172            log_lower_bound = np.log(lower_bound)
    -173            log_upper_bound = np.log(upper_bound)
    -174            log_bounds_range = log_upper_bound - log_lower_bound
    -175            self.x_init = (
    -176                np.minimum(
    -177                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    -178                    1.7976931348623157e308,
    -179                )
    -180                if x_init is None
    -181                else x_init
    -182            )
    -183            self.x_choices = np.minimum(
    -184                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    -185                1.7976931348623157e308,
    -186            )
    -187
    -188        # shelve for saving (not for loading)
    -189        if self.save is not None:
    -190            self.sh = shelve.open(filename=save, flag="c", writeback=True)
    -191
    -192        if self.per_second:
    -193            self.timings = []
    -194            self.rf_obj = RandomForestRegressor(
    -195                n_estimators=250, random_state=self.seed
    -196            )
    +            
     22class GPOpt:
    + 23    """Class GPOpt.
    + 24
    + 25    # Arguments:
    + 26
    + 27        lower_bound: a numpy array;
    + 28            lower bound for researched minimum
    + 29
    + 30        upper_bound: a numpy array;
    + 31            upper bound for researched minimum
    + 32
    + 33        objective_func: a function;
    + 34            the objective function to be minimized
    + 35        
    + 36        params_names: a list;
    + 37            names of the parameters of the objective function (optional)
    + 38
    + 39        gp_obj: a GaussianProcessRegressor object;
    + 40            An ML model for estimating the uncertainty around the objective function        
    + 41
    + 42        x_init:
    + 43            initial setting of points where `objective_func` is evaluated (optional)
    + 44
    + 45        y_init:
    + 46            initial setting values at points where `objective_func` is evaluated (optional)
    + 47
    + 48        n_init: an integer;
    + 49            number of points in the initial setting, when `x_init` and `y_init` are not provided
    + 50
    + 51        n_choices: an integer;
    + 52            number of points for the calculation of expected improvement
    + 53
    + 54        n_iter: an integer;
    + 55            number of iterations of the minimization algorithm
    + 56
    + 57        alpha: a float;
    + 58            Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)
    + 59
    + 60        n_restarts_optimizer: an integer;
    + 61            The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood.
    + 62
    + 63        seed: an integer;
    + 64            reproducibility seed
    + 65
    + 66        save: a string;
    + 67            Specifies where to save the optimizer in its current state
    + 68
    + 69        n_jobs: an integer;
    + 70            number of jobs for parallel computing on initial setting (can be -1)
    + 71
    + 72        per_second: a boolean;
    + 73            __experimental__, default is False (leave to default for now)
    + 74
    + 75        log_scale: a boolean;
    + 76            __experimental__, default is False (leave to default for now)
    + 77
    + 78    see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    + 79        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    + 80
    + 81    """
    + 82
    + 83    def __init__(
    + 84        self,        
    + 85        lower_bound,
    + 86        upper_bound,
    + 87        objective_func=None,
    + 88        params_names=None,
    + 89        gp_obj=None,
    + 90        x_init=None,
    + 91        y_init=None,
    + 92        n_init=10,
    + 93        n_choices=25000,
    + 94        n_iter=190,
    + 95        alpha=1e-6,
    + 96        n_restarts_optimizer=25,
    + 97        seed=123,
    + 98        save=None,
    + 99        n_jobs=1,
    +100        per_second=False,  # /!\ very experimental
    +101        log_scale=False,  # /!\ experimental
    +102    ):
    +103
    +104        n_dims = len(lower_bound)
    +105
    +106        assert n_dims == len(
    +107            upper_bound
    +108        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    +109
    +110        self.objective_func = objective_func
    +111        self.params_names = params_names
    +112        self.lower_bound = lower_bound
    +113        self.upper_bound = upper_bound
    +114        self.y_init = y_init
    +115        self.log_scale = log_scale
    +116        self.n_dims = n_dims
    +117        self.n_init = n_init
    +118        self.n_choices = n_choices
    +119        self.n_iter = n_iter
    +120        self.alpha = alpha
    +121        self.n_restarts_optimizer = n_restarts_optimizer
    +122        self.seed = seed
    +123        self.save = save
    +124        self.per_second = per_second
    +125        self.x_min = None
    +126        self.y_min = None
    +127        self.y_mean = None
    +128        self.y_std = None
    +129        self.ei = np.array([])
    +130        self.max_ei = []
    +131        if gp_obj is None:
    +132            self.gp_obj = GaussianProcessRegressor(
    +133                kernel=Matern(nu=2.5),
    +134                alpha=self.alpha,
    +135                normalize_y=True,
    +136                n_restarts_optimizer=self.n_restarts_optimizer,
    +137                random_state=self.seed,
    +138            )
    +139        else:
    +140            self.gp_obj = gp_obj
    +141
    +142        # Sobol seqs for initial design and choices
    +143        sobol_seq_init = np.transpose(
    +144            generate_sobol2(
    +145                n_dims=self.n_dims,
    +146                n_points=self.n_init,
    +147                skip=2,
    +148            )
    +149        )
    +150        sobol_seq_choices = np.transpose(
    +151            generate_sobol2(
    +152                n_dims=self.n_dims,
    +153                n_points=self.n_choices,
    +154                skip=self.n_init + 2,
    +155            )
    +156        )
    +157
    +158        # Sobol seqs for initial design and choices with bounds
    +159        if self.log_scale == False:
    +160
    +161            bounds_range = upper_bound - lower_bound
    +162            self.x_init = (
    +163                bounds_range * sobol_seq_init + lower_bound
    +164                if x_init is None
    +165                else x_init
    +166            )
    +167            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    +168
    +169        else:  # (!) experimental
    +170
    +171            assert (
    +172                lower_bound > 0
    +173            ).all(), "all elements of `lower_bound` must be > 0"
    +174            assert (
    +175                upper_bound > 0
    +176            ).all(), "all elements of `upper_bound` must be > 0"
    +177
    +178            log_lower_bound = np.log(lower_bound)
    +179            log_upper_bound = np.log(upper_bound)
    +180            log_bounds_range = log_upper_bound - log_lower_bound
    +181            self.x_init = (
    +182                np.minimum(
    +183                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    +184                    1.7976931348623157e308,
    +185                )
    +186                if x_init is None
    +187                else x_init
    +188            )
    +189            self.x_choices = np.minimum(
    +190                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    +191                1.7976931348623157e308,
    +192            )
    +193
    +194        # shelve for saving (not for loading)
    +195        if self.save is not None:
    +196            self.sh = shelve.open(filename=save, flag="c", writeback=True)
     197
    -198        self.n_jobs = n_jobs
    -199
    -200    # from sklearn.base
    -201    def get_params(self):
    -202        """Get object attributes.
    +198        if self.per_second:
    +199            self.timings = []
    +200            self.rf_obj = RandomForestRegressor(
    +201                n_estimators=250, random_state=self.seed
    +202            )
     203
    -204        Returns
    -205        -------
    -206        params : mapping of string to any
    -207            Parameter names mapped to their values.
    -208        """
    -209        out = dict()
    -210        param_names = dir(self)
    -211        for key in param_names:
    -212            if key.startswith("_") is False:
    -213                out[key] = getattr(self, key, None)
    -214
    -215        return out
    -216
    -217    # for parallel case on initial design
    -218    def eval_objective(self, arg):
    -219        try:
    -220            return self.objective_func(self.x_init[arg, :])
    -221        except:
    -222            return 1e06
    -223
    -224    # load data from stored shelve
    -225    def load(self, path):
    -226        """load data from stored shelve.
    -227
    -228        # Arguments
    +204        self.n_jobs = n_jobs
    +205
    +206    # from sklearn.base
    +207    def get_params(self):
    +208        """Get object attributes.
    +209
    +210        Returns
    +211        -------
    +212        params : mapping of string to any
    +213            Parameter names mapped to their values.
    +214        """
    +215        out = dict()
    +216        param_names = dir(self)
    +217        for key in param_names:
    +218            if key.startswith("_") is False:
    +219                out[key] = getattr(self, key, None)
    +220
    +221        return out
    +222
    +223    # for parallel case on initial design
    +224    def eval_objective(self, arg):
    +225        try:
    +226            return self.objective_func(self.x_init[arg, :])
    +227        except:
    +228            return 1e06
     229
    -230        path : a string; path to stored shelve.
    -231
    -232        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -233        """
    -234
    -235        self.sh = shelve.open(filename=path)
    -236        for key, value in self.sh.items():
    -237            setattr(self, key, value)
    -238
    -239    # update shelve in optimization loop
    -240    def update_shelve(self):
    -241        for key, value in self.get_params().items():
    -242            if (callable(value) is False) & (key != "sh"):
    -243                self.sh[key] = value
    -244        self.sh.sync()
    -245
    -246    # closing shelve (can't be modified after)
    -247    def close_shelve(self):
    -248        """Close shelve.
    -249
    -250        # Arguments
    +230    # load data from stored shelve
    +231    def load(self, path):
    +232        """load data from stored shelve.
    +233
    +234        # Arguments
    +235
    +236        path : a string; path to stored shelve.
    +237
    +238        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +239        """
    +240
    +241        self.sh = shelve.open(filename=path)
    +242        for key, value in self.sh.items():
    +243            setattr(self, key, value)
    +244
    +245    # update shelve in optimization loop
    +246    def update_shelve(self):
    +247        for key, value in self.get_params().items():
    +248            if (callable(value) is False) & (key != "sh"):
    +249                self.sh[key] = value
    +250        self.sh.sync()
     251
    -252        No argument.
    -253
    -254        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -255        """
    -256
    -257        self.sh.close()
    -258
    -259    # fit predict
    -260    def gp_fit_predict(self, X_train, y_train, X_test):
    -261
    -262        if len(X_train.shape) == 1:
    -263            X_train = X_train.reshape((-1, 1))
    -264            X_test = X_test.reshape((-1, 1))
    -265
    -266        # Get mean and standard deviation
    -267        return self.gp_obj.fit(X_train, y_train).predict(
    -268            X_test, return_std=True
    -269        )
    -270
    -271    # fit predict timings
    -272    def timings_fit_predict(self, X_train, y_train, X_test):
    -273
    -274        if len(X_train.shape) == 1:
    -275            X_train = X_train.reshape((-1, 1))
    -276            X_test = X_test.reshape((-1, 1))
    -277
    -278        # Get mean preds for timings
    -279        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    -280
    -281    # find next parameter by using expected improvement (ei)
    -282    def next_parameter_by_ei(self, seed, i):
    +252    # closing shelve (can't be modified after)
    +253    def close_shelve(self):
    +254        """Close shelve.
    +255
    +256        # Arguments
    +257
    +258        No argument.
    +259
    +260        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +261        """
    +262
    +263        self.sh.close()
    +264
    +265    # fit predict
    +266    def gp_fit_predict(self, X_train, y_train, X_test):
    +267
    +268        if len(X_train.shape) == 1:
    +269            X_train = X_train.reshape((-1, 1))
    +270            X_test = X_test.reshape((-1, 1))
    +271
    +272        # Get mean and standard deviation
    +273        return self.gp_obj.fit(X_train, y_train).predict(
    +274            X_test, return_std=True
    +275        )
    +276
    +277    # fit predict timings
    +278    def timings_fit_predict(self, X_train, y_train, X_test):
    +279
    +280        if len(X_train.shape) == 1:
    +281            X_train = X_train.reshape((-1, 1))
    +282            X_test = X_test.reshape((-1, 1))
     283
    -284        gamma_hat = (self.y_min - self.y_mean) / self.y_std
    -285
    -286        self.ei = -self.y_std * (
    -287            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    -288        )
    +284        # Get mean preds for timings
    +285        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    +286
    +287    # find next parameter by using expected improvement (ei)
    +288    def next_parameter_by_ei(self, seed, i):
     289
    -290        # find max index -----
    +290        gamma_hat = (self.y_min - self.y_mean) / self.y_std
     291
    -292        if self.per_second is False:
    -293
    -294            # find index for max. ei
    -295            max_index = self.ei.argmin()
    -296
    -297        else:  # self.per_second is True
    -298
    -299            # predict timings on self.x_choices
    -300            # train on X = self.parameters and y = self.timings
    -301            # (must have same shape[0])
    -302            timing_preds = self.timings_fit_predict(
    -303                X_train=np.asarray(self.parameters),
    -304                y_train=np.asarray(self.timings),
    -305                X_test=self.x_choices,
    -306            )
    -307
    -308            # find index for max. ei (and min. timings)
    -309            max_index = (-self.ei / timing_preds).argmax()
    -310
    -311        self.max_ei.append(np.abs(self.ei[max_index]))
    -312
    -313        # Select next choice
    -314        next_param = self.x_choices[max_index, :]
    -315
    -316        if next_param in np.asarray(self.parameters):
    -317
    -318            if self.log_scale == False:
    -319
    -320                np.random.seed(self.seed * i + 1000)
    -321                next_param = (
    -322                    self.upper_bound - self.lower_bound
    -323                ) * np.random.rand(self.n_dims) + self.lower_bound
    -324
    -325            else:  # /!\ very... experimental
    -326
    -327                np.random.seed(self.seed)
    -328                log_upper_bound = np.log(self.upper_bound)
    -329                log_lower_bound = np.log(self.lower_bound)
    -330                log_bounds_range = log_upper_bound - log_lower_bound
    -331
    -332                next_param = np.minimum(
    -333                    np.exp(
    -334                        log_bounds_range * np.random.rand(self.n_dims)
    -335                        + log_lower_bound
    -336                    ),
    -337                    1.7976931348623157e308,
    -338                )
    -339
    -340        return next_param
    -341
    -342    # optimize the objective
    -343    def optimize(
    -344        self,
    -345        verbose=1,
    -346        n_more_iter=None,
    -347        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    -348        min_budget=50,  # minimum budget for early stopping
    -349        func_args=None,
    -350    ):
    -351        """Launch optimization loop.
    -352
    -353        # Arguments:
    -354
    -355            verbose: an integer;
    -356                verbose = 0: nothing is printed,
    -357                verbose = 1: a progress bar is printed (longer than 0),
    -358                verbose = 2: information about each iteration is printed (longer than 1)
    -359
    -360            n_more_iter: an integer;
    -361                additional number of iterations for the optimizer (which has been run once)
    -362
    -363            abs_tol: a float;
    -364                tolerance for convergence of the optimizer (early stopping based on expected improvement)
    +292        self.ei = -self.y_std * (
    +293            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    +294        )
    +295
    +296        # find max index -----
    +297
    +298        if self.per_second is False:
    +299
    +300            # find index for max. ei
    +301            max_index = self.ei.argmin()
    +302
    +303        else:  # self.per_second is True
    +304
    +305            # predict timings on self.x_choices
    +306            # train on X = self.parameters and y = self.timings
    +307            # (must have same shape[0])
    +308            timing_preds = self.timings_fit_predict(
    +309                X_train=np.asarray(self.parameters),
    +310                y_train=np.asarray(self.timings),
    +311                X_test=self.x_choices,
    +312            )
    +313
    +314            # find index for max. ei (and min. timings)
    +315            max_index = (-self.ei / timing_preds).argmax()
    +316
    +317        self.max_ei.append(np.abs(self.ei[max_index]))
    +318
    +319        # Select next choice
    +320        next_param = self.x_choices[max_index, :]
    +321
    +322        if next_param in np.asarray(self.parameters):
    +323
    +324            if self.log_scale == False:
    +325
    +326                np.random.seed(self.seed * i + 1000)
    +327                next_param = (
    +328                    self.upper_bound - self.lower_bound
    +329                ) * np.random.rand(self.n_dims) + self.lower_bound
    +330
    +331            else:  # /!\ very... experimental
    +332
    +333                np.random.seed(self.seed)
    +334                log_upper_bound = np.log(self.upper_bound)
    +335                log_lower_bound = np.log(self.lower_bound)
    +336                log_bounds_range = log_upper_bound - log_lower_bound
    +337
    +338                next_param = np.minimum(
    +339                    np.exp(
    +340                        log_bounds_range * np.random.rand(self.n_dims)
    +341                        + log_lower_bound
    +342                    ),
    +343                    1.7976931348623157e308,
    +344                )
    +345
    +346        return next_param
    +347
    +348    # optimize the objective
    +349    def optimize(
    +350        self,
    +351        verbose=1,
    +352        n_more_iter=None,
    +353        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    +354        min_budget=50,  # minimum budget for early stopping
    +355        func_args=None,
    +356    ):
    +357        """Launch optimization loop.
    +358
    +359        # Arguments:
    +360
    +361            verbose: an integer;
    +362                verbose = 0: nothing is printed,
    +363                verbose = 1: a progress bar is printed (longer than 0),
    +364                verbose = 2: information about each iteration is printed (longer than 1)
     365
    -366            min_budget: an integer (default is 50);
    -367                minimum number of iterations before early stopping controlled by `abs_tol`
    +366            n_more_iter: an integer;
    +367                additional number of iterations for the optimizer (which has been run once)
     368
    -369            func_args: a list;
    -370                additional parameters for the objective function (if necessary)
    +369            abs_tol: a float;
    +370                tolerance for convergence of the optimizer (early stopping based on expected improvement)
     371
    -372        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    -373        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +372            min_budget: an integer (default is 50);
    +373                minimum number of iterations before early stopping controlled by `abs_tol`
     374
    -375        """
    -376
    -377        # verbose = 0: nothing is printed
    -378        # verbose = 1: a progress bar is printed (longer than 0)
    -379        # verbose = 2: information about each iteration is printed (longer than 1)
    -380        if func_args is None:
    -381            func_args = []
    +375            func_args: a list;
    +376                additional parameters for the objective function (if necessary)
    +377
    +378        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    +379        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +380
    +381        """
     382
    -383        if (
    -384            n_more_iter is None
    -385        ):  # initial optimization, before more iters are requested
    -386
    -387            n_iter = self.n_iter
    -388            # stopping iter for early stopping (default is total budget)
    -389            iter_stop = n_iter  # potentially # got to check this
    -390
    -391            # initial design  ----------
    +383        # verbose = 0: nothing is printed
    +384        # verbose = 1: a progress bar is printed (longer than 0)
    +385        # verbose = 2: information about each iteration is printed (longer than 1)
    +386        if func_args is None:
    +387            func_args = []
    +388
    +389        if (
    +390            n_more_iter is None
    +391        ):  # initial optimization, before more iters are requested
     392
    -393            if (verbose == 1) | (verbose == 2):
    -394                print(f"\n Creating initial design... \n")
    -395
    -396            if verbose == 1:
    -397                progbar = Progbar(target=self.n_init)
    +393            n_iter = self.n_iter
    +394            # stopping iter for early stopping (default is total budget)
    +395            iter_stop = n_iter  # potentially # got to check this
    +396
    +397            # initial design  ----------
     398
    -399            self.parameters = self.x_init.tolist()
    -400            self.scores = []
    +399            if (verbose == 1) | (verbose == 2):
    +400                print(f"\n Creating initial design... \n")
     401
    -402            if self.save is not None:
    -403                self.update_shelve()
    +402            if verbose == 1:
    +403                progbar = Progbar(target=self.n_init)
     404
    -405            if self.y_init is None:  # calculate scores on initial design
    -406
    -407                assert (
    -408                    self.objective_func is not None
    -409                ), "self.y_init is None: must have 'objective_func' not None"
    +405            self.parameters = self.x_init.tolist()
    +406            self.scores = []
    +407
    +408            if self.save is not None:
    +409                self.update_shelve()
     410
    -411                if self.n_jobs == 1:
    +411            if self.y_init is None:  # calculate scores on initial design
     412
    -413                    for i in range(self.n_init):
    -414
    -415                        x_next = self.x_init[i, :]
    +413                assert (
    +414                    self.objective_func is not None
    +415                ), "self.y_init is None: must have 'objective_func' not None"
     416
    -417                        try:
    +417                if self.n_jobs == 1:
     418
    -419                            if self.per_second is True:
    +419                    for i in range(self.n_init):
     420
    -421                                start = time()
    -422                                score = self.objective_func(x_next, *func_args)
    -423                                if (np.isfinite(score) == False) or (
    -424                                    np.isnan(score) == True
    -425                                ):
    -426                                    continue
    -427                                self.timings.append(np.log(time() - start))
    -428
    -429                            else:  # self.per_second is False
    -430
    -431                                score = self.objective_func(x_next, *func_args)
    -432                                if (np.isfinite(score) == False) or (
    -433                                    np.isnan(score) == True
    -434                                ):
    -435                                    continue
    +421                        x_next = self.x_init[i, :]
    +422
    +423                        try:
    +424
    +425                            if self.per_second is True:
    +426
    +427                                start = time()
    +428                                score = self.objective_func(x_next, *func_args)
    +429                                if (np.isfinite(score) == False) or (
    +430                                    np.isnan(score) == True
    +431                                ):
    +432                                    continue
    +433                                self.timings.append(np.log(time() - start))
    +434
    +435                            else:  # self.per_second is False
     436
    -437                            self.scores.append(score)
    -438
    -439                            if self.save is not None:
    -440                                self.update_shelve()
    -441
    -442                        except:
    -443
    -444                            continue
    -445
    -446                        if verbose == 1:
    -447                            progbar.update(i)  # update progress bar
    -448
    -449                        if verbose == 2:
    -450                            print(f"point: {x_next}; score: {score}")
    -451                    # end loop # calculate scores on initial design
    -452
    -453                    if verbose == 1:
    -454                        progbar.update(self.n_init)
    -455
    -456                else:  # self.n_jobs != 1
    -457
    -458                    assert (
    -459                        self.per_second is False
    -460                    ), "timings not calculated here"
    +437                                score = self.objective_func(x_next, *func_args)
    +438                                if (np.isfinite(score) == False) or (
    +439                                    np.isnan(score) == True
    +440                                ):
    +441                                    continue
    +442
    +443                            self.scores.append(score)
    +444
    +445                            if self.save is not None:
    +446                                self.update_shelve()
    +447
    +448                        except:
    +449
    +450                            continue
    +451
    +452                        if verbose == 1:
    +453                            progbar.update(i)  # update progress bar
    +454
    +455                        if verbose == 2:
    +456                            print(f"point: {x_next}; score: {score}")
    +457                    # end loop # calculate scores on initial design
    +458
    +459                    if verbose == 1:
    +460                        progbar.update(self.n_init)
     461
    -462                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    -463                        delayed(self.objective_func)(self.x_init[i, :])
    -464                        for i in range(self.n_init)
    -465                    )
    -466
    -467                    self.scores = scores
    -468
    -469                    if self.save is not None:
    -470                        self.update_shelve()
    -471
    -472            else:  # if self.y_init is None:
    -473
    -474                assert self.x_init.shape[0] == len(
    -475                    self.y_init
    -476                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +462                else:  # self.n_jobs != 1
    +463
    +464                    assert (
    +465                        self.per_second is False
    +466                    ), "timings not calculated here"
    +467
    +468                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    +469                        delayed(self.objective_func)(self.x_init[i, :])
    +470                        for i in range(self.n_init)
    +471                    )
    +472
    +473                    self.scores = scores
    +474
    +475                    if self.save is not None:
    +476                        self.update_shelve()
     477
    -478                self.scores = pickle.loads(
    -479                    pickle.dumps(self.y_init.tolist(), -1)
    -480                )
    -481
    -482            # current best score on initial design
    -483            min_index = (np.asarray(self.scores)).argmin()
    -484            self.y_min = self.scores[min_index]
    -485            self.x_min = self.x_init[min_index, :]
    -486
    -487            # current gp mean and std on initial design
    -488            y_mean, y_std = self.gp_fit_predict(
    -489                np.asarray(self.parameters),
    -490                np.asarray(self.scores),
    -491                self.x_choices,
    -492            )
    -493            self.y_mean = y_mean
    -494            self.y_std = np.maximum(2.220446049250313e-16, y_std)
    -495
    -496            # saving after initial design computation
    -497            if self.save is not None:
    -498                self.update_shelve()
    -499
    -500        else:  # if n_more_iter is not None
    +478            else:  # if self.y_init is None:
    +479
    +480                assert self.x_init.shape[0] == len(
    +481                    self.y_init
    +482                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +483
    +484                self.scores = pickle.loads(
    +485                    pickle.dumps(self.y_init.tolist(), -1)
    +486                )
    +487
    +488            # current best score on initial design
    +489            min_index = (np.asarray(self.scores)).argmin()
    +490            self.y_min = self.scores[min_index]
    +491            self.x_min = self.x_init[min_index, :]
    +492
    +493            # current gp mean and std on initial design
    +494            y_mean, y_std = self.gp_fit_predict(
    +495                np.asarray(self.parameters),
    +496                np.asarray(self.scores),
    +497                self.x_choices,
    +498            )
    +499            self.y_mean = y_mean
    +500            self.y_std = np.maximum(2.220446049250313e-16, y_std)
     501
    -502            assert self.n_iter > 5, "you must have n_iter > 5"
    -503            n_iter = n_more_iter
    -504            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +502            # saving after initial design computation
    +503            if self.save is not None:
    +504                self.update_shelve()
     505
    -506        if (verbose == 1) | (verbose == 2):
    -507            print(f"\n ...Done. \n")
    -508            try:
    -509                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    -510            except:
    -511                pass
    -512
    -513        # end init design ----------
    -514
    -515        # if n_more_iter is None: # initial optimization, before more iters are requested
    -516
    -517        if (verbose == 1) | (verbose == 2):
    -518            print(f"\n Optimization loop... \n")
    -519
    -520        # early stopping?
    -521        if abs_tol is not None:
    -522            assert (
    -523                min_budget > 20
    -524            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +506        else:  # if n_more_iter is not None
    +507
    +508            assert self.n_iter > 5, "you must have n_iter > 5"
    +509            n_iter = n_more_iter
    +510            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +511
    +512        if (verbose == 1) | (verbose == 2):
    +513            print(f"\n ...Done. \n")
    +514            try:
    +515                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    +516            except:
    +517                pass
    +518
    +519        # end init design ----------
    +520
    +521        # if n_more_iter is None: # initial optimization, before more iters are requested
    +522
    +523        if (verbose == 1) | (verbose == 2):
    +524            print(f"\n Optimization loop... \n")
     525
    -526        if verbose == 1:
    -527            progbar = Progbar(target=n_iter)
    -528
    -529        # main loop ----------
    -530
    -531        for i in range(n_iter):
    -532
    -533            # find next set of parameters (vector), maximizing ei
    -534            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
    -535
    -536            try:
    -537
    -538                if self.per_second is True:
    -539
    -540                    start = time()
    +526        # early stopping?
    +527        if abs_tol is not None:
    +528            assert (
    +529                min_budget > 20
    +530            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +531
    +532        if verbose == 1:
    +533            progbar = Progbar(target=n_iter)
    +534
    +535        # main loop ----------
    +536
    +537        for i in range(n_iter):
    +538
    +539            # find next set of parameters (vector), maximizing ei
    +540            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
     541
    -542                    if self.objective_func is not None:
    +542            try:
     543
    -544                        score_next_param = self.objective_func(
    -545                            next_param, *func_args
    -546                        )
    +544                if self.per_second is True:
    +545
    +546                    start = time()
     547
    -548                        if (np.isfinite(score_next_param) == False) or (
    -549                            np.isnan(score_next_param) == True
    -550                        ):
    -551                            continue
    -552
    -553                    else:
    -554
    -555                        assert (self.x_init is not None) and (
    -556                            self.y_init is not None
    -557                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +548                    if self.objective_func is not None:
    +549
    +550                        score_next_param = self.objective_func(
    +551                            next_param, *func_args
    +552                        )
    +553
    +554                        if (np.isfinite(score_next_param) == False) or (
    +555                            np.isnan(score_next_param) == True
    +556                        ):
    +557                            continue
     558
    -559                        print(f"\n next param: {next_param} \n")
    -560                        score_next_param = float(
    -561                            input("get new score: \n")
    -562                        )  # or an API response
    -563
    -564                        if (np.isfinite(score_next_param) == False) or (
    -565                            np.isnan(score_next_param) == True
    -566                        ):
    -567                            continue
    -568
    -569                    self.timings.append(np.log(time() - start))
    -570
    -571                else:  # self.per_second is False:
    -572
    -573                    if self.objective_func is not None:
    +559                    else:
    +560
    +561                        assert (self.x_init is not None) and (
    +562                            self.y_init is not None
    +563                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +564
    +565                        print(f"\n next param: {next_param} \n")
    +566                        score_next_param = float(
    +567                            input("get new score: \n")
    +568                        )  # or an API response
    +569
    +570                        if (np.isfinite(score_next_param) == False) or (
    +571                            np.isnan(score_next_param) == True
    +572                        ):
    +573                            continue
     574
    -575                        score_next_param = self.objective_func(
    -576                            next_param, *func_args
    -577                        )
    +575                    self.timings.append(np.log(time() - start))
    +576
    +577                else:  # self.per_second is False:
     578
    -579                        if (np.isfinite(score_next_param) == False) or (
    -580                            np.isnan(score_next_param) == True
    -581                        ):
    -582                            continue
    -583
    -584                    else:
    -585
    -586                        assert (self.x_init is not None) and (
    -587                            self.y_init is not None
    -588                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +579                    if self.objective_func is not None:
    +580
    +581                        score_next_param = self.objective_func(
    +582                            next_param, *func_args
    +583                        )
    +584
    +585                        if (np.isfinite(score_next_param) == False) or (
    +586                            np.isnan(score_next_param) == True
    +587                        ):
    +588                            continue
     589
    -590                        print(f"\n next param: {next_param} \n")
    -591                        score_next_param = float(
    -592                            input("get new score: \n")
    -593                        )  # or an API response
    -594
    -595                        if (np.isfinite(score_next_param) == False) or (
    -596                            np.isnan(score_next_param) == True
    -597                        ):
    -598                            continue
    -599
    -600            except:
    -601
    -602                continue
    -603
    -604            self.parameters.append(next_param.tolist())
    +590                    else:
    +591
    +592                        assert (self.x_init is not None) and (
    +593                            self.y_init is not None
    +594                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +595
    +596                        print(f"\n next param: {next_param} \n")
    +597                        score_next_param = float(
    +598                            input("get new score: \n")
    +599                        )  # or an API response
    +600
    +601                        if (np.isfinite(score_next_param) == False) or (
    +602                            np.isnan(score_next_param) == True
    +603                        ):
    +604                            continue
     605
    -606            self.scores.append(score_next_param)
    +606            except:
     607
    -608            if self.save is not None:
    -609                self.update_shelve()
    -610
    -611            if verbose == 2:
    -612                print(f"iteration {i + 1} -----")
    -613                print(f"current minimum:  {self.x_min}")
    -614                print(f"current minimum score:  {self.y_min}")
    -615                print(f"next parameter: {next_param}")
    -616                print(f"score for next parameter: {score_next_param} \n")
    -617
    -618            if score_next_param < self.y_min:
    -619                self.x_min = next_param
    -620                self.y_min = score_next_param
    -621                if self.save is not None:
    -622                    self.update_shelve()
    +608                continue
    +609
    +610            self.parameters.append(next_param.tolist())
    +611
    +612            self.scores.append(score_next_param)
    +613
    +614            if self.save is not None:
    +615                self.update_shelve()
    +616
    +617            if verbose == 2:
    +618                print(f"iteration {i + 1} -----")
    +619                print(f"current minimum:  {self.x_min}")
    +620                print(f"current minimum score:  {self.y_min}")
    +621                print(f"next parameter: {next_param}")
    +622                print(f"score for next parameter: {score_next_param} \n")
     623
    -624            self.y_mean, self.y_std = self.gp_fit_predict(
    -625                np.asarray(self.parameters),
    -626                np.asarray(self.scores),
    -627                self.x_choices,
    -628            )
    +624            if score_next_param < self.y_min:
    +625                self.x_min = next_param
    +626                self.y_min = score_next_param
    +627                if self.save is not None:
    +628                    self.update_shelve()
     629
    -630            if self.save is not None:
    -631                self.update_shelve()
    -632
    -633            if verbose == 1:
    -634                progbar.update(i + 1)  # update progress bar
    +630            self.y_mean, self.y_std = self.gp_fit_predict(
    +631                np.asarray(self.parameters),
    +632                np.asarray(self.scores),
    +633                self.x_choices,
    +634            )
     635
    -636            # early stopping
    -637
    -638            if abs_tol is not None:
    -639
    -640                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    -641                if len(self.max_ei) > min_budget:
    -642
    -643                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
    -644
    -645                    if diff_max_ei[-1] <= abs_tol:
    -646
    -647                        iter_stop = len(self.max_ei)  # index i starts at 0
    +636            if self.save is not None:
    +637                self.update_shelve()
    +638
    +639            if verbose == 1:
    +640                progbar.update(i + 1)  # update progress bar
    +641
    +642            # early stopping
    +643
    +644            if abs_tol is not None:
    +645
    +646                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    +647                if len(self.max_ei) > min_budget:
     648
    -649                        break
    +649                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
     650
    -651        # end main loop ----------
    +651                    if diff_max_ei[-1] <= abs_tol:
     652
    -653        if (verbose == 1) & (i < (n_iter - 1)):
    -654            progbar.update(n_iter)
    -655
    -656        self.n_iter = iter_stop
    -657        if self.save is not None:
    -658            self.update_shelve()
    -659
    -660        return (self.x_min, self.y_min)
    +653                        iter_stop = len(self.max_ei)  # index i starts at 0
    +654
    +655                        break
    +656
    +657        # end main loop ----------
    +658
    +659        if (verbose == 1) & (i < (n_iter - 1)):
    +660            progbar.update(n_iter)
    +661
    +662        self.n_iter = iter_stop
    +663        if self.save is not None:
    +664            self.update_shelve()
    +665        
    +666        DescribeResult = namedtuple(
    +667                "DescribeResult", ("best_params", "best_score")
    +668            )
    +669
    +670        if self.params_names is None:
    +671
    +672            return DescribeResult(self.x_min, self.y_min)
    +673
    +674        else:
    +675
    +676            return DescribeResult(
    +677                dict(zip(self.params_names, self.x_min)), self.y_min
    +678            )
     
    @@ -823,6 +843,9 @@

    Arguments:

    objective_func: a function; the objective function to be minimized +params_names: a list; + names of the parameters of the objective function (optional) + gp_obj: a GaussianProcessRegressor object; An ML model for estimating the uncertainty around the objective function @@ -872,132 +895,134 @@

    Arguments:

    - GPOpt( lower_bound, upper_bound, objective_func=None, gp_obj=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False) + GPOpt( lower_bound, upper_bound, objective_func=None, params_names=None, gp_obj=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False)
    -
     79    def __init__(
    - 80        self,        
    - 81        lower_bound,
    - 82        upper_bound,
    - 83        objective_func=None,
    - 84        gp_obj=None,
    - 85        x_init=None,
    - 86        y_init=None,
    - 87        n_init=10,
    - 88        n_choices=25000,
    - 89        n_iter=190,
    - 90        alpha=1e-6,
    - 91        n_restarts_optimizer=25,
    - 92        seed=123,
    - 93        save=None,
    - 94        n_jobs=1,
    - 95        per_second=False,  # /!\ very experimental
    - 96        log_scale=False,  # /!\ experimental
    - 97    ):
    - 98
    - 99        n_dims = len(lower_bound)
    -100
    -101        assert n_dims == len(
    -102            upper_bound
    -103        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    -104
    -105        self.objective_func = objective_func
    -106        self.lower_bound = lower_bound
    -107        self.upper_bound = upper_bound
    -108        self.y_init = y_init
    -109        self.log_scale = log_scale
    -110        self.n_dims = n_dims
    -111        self.n_init = n_init
    -112        self.n_choices = n_choices
    -113        self.n_iter = n_iter
    -114        self.alpha = alpha
    -115        self.n_restarts_optimizer = n_restarts_optimizer
    -116        self.seed = seed
    -117        self.save = save
    -118        self.per_second = per_second
    -119        self.x_min = None
    -120        self.y_min = None
    -121        self.y_mean = None
    -122        self.y_std = None
    -123        self.ei = np.array([])
    -124        self.max_ei = []
    -125        if gp_obj is None:
    -126            self.gp_obj = GaussianProcessRegressor(
    -127                kernel=Matern(nu=2.5),
    -128                alpha=self.alpha,
    -129                normalize_y=True,
    -130                n_restarts_optimizer=self.n_restarts_optimizer,
    -131                random_state=self.seed,
    -132            )
    -133        else:
    -134            self.gp_obj = gp_obj
    -135
    -136        # Sobol seqs for initial design and choices
    -137        sobol_seq_init = np.transpose(
    -138            generate_sobol2(
    -139                n_dims=self.n_dims,
    -140                n_points=self.n_init,
    -141                skip=2,
    -142            )
    -143        )
    -144        sobol_seq_choices = np.transpose(
    -145            generate_sobol2(
    -146                n_dims=self.n_dims,
    -147                n_points=self.n_choices,
    -148                skip=self.n_init + 2,
    -149            )
    -150        )
    -151
    -152        # Sobol seqs for initial design and choices with bounds
    -153        if self.log_scale == False:
    -154
    -155            bounds_range = upper_bound - lower_bound
    -156            self.x_init = (
    -157                bounds_range * sobol_seq_init + lower_bound
    -158                if x_init is None
    -159                else x_init
    -160            )
    -161            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    -162
    -163        else:  # (!) experimental
    -164
    -165            assert (
    -166                lower_bound > 0
    -167            ).all(), "all elements of `lower_bound` must be > 0"
    -168            assert (
    -169                upper_bound > 0
    -170            ).all(), "all elements of `upper_bound` must be > 0"
    -171
    -172            log_lower_bound = np.log(lower_bound)
    -173            log_upper_bound = np.log(upper_bound)
    -174            log_bounds_range = log_upper_bound - log_lower_bound
    -175            self.x_init = (
    -176                np.minimum(
    -177                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    -178                    1.7976931348623157e308,
    -179                )
    -180                if x_init is None
    -181                else x_init
    -182            )
    -183            self.x_choices = np.minimum(
    -184                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    -185                1.7976931348623157e308,
    -186            )
    -187
    -188        # shelve for saving (not for loading)
    -189        if self.save is not None:
    -190            self.sh = shelve.open(filename=save, flag="c", writeback=True)
    -191
    -192        if self.per_second:
    -193            self.timings = []
    -194            self.rf_obj = RandomForestRegressor(
    -195                n_estimators=250, random_state=self.seed
    -196            )
    +            
     83    def __init__(
    + 84        self,        
    + 85        lower_bound,
    + 86        upper_bound,
    + 87        objective_func=None,
    + 88        params_names=None,
    + 89        gp_obj=None,
    + 90        x_init=None,
    + 91        y_init=None,
    + 92        n_init=10,
    + 93        n_choices=25000,
    + 94        n_iter=190,
    + 95        alpha=1e-6,
    + 96        n_restarts_optimizer=25,
    + 97        seed=123,
    + 98        save=None,
    + 99        n_jobs=1,
    +100        per_second=False,  # /!\ very experimental
    +101        log_scale=False,  # /!\ experimental
    +102    ):
    +103
    +104        n_dims = len(lower_bound)
    +105
    +106        assert n_dims == len(
    +107            upper_bound
    +108        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    +109
    +110        self.objective_func = objective_func
    +111        self.params_names = params_names
    +112        self.lower_bound = lower_bound
    +113        self.upper_bound = upper_bound
    +114        self.y_init = y_init
    +115        self.log_scale = log_scale
    +116        self.n_dims = n_dims
    +117        self.n_init = n_init
    +118        self.n_choices = n_choices
    +119        self.n_iter = n_iter
    +120        self.alpha = alpha
    +121        self.n_restarts_optimizer = n_restarts_optimizer
    +122        self.seed = seed
    +123        self.save = save
    +124        self.per_second = per_second
    +125        self.x_min = None
    +126        self.y_min = None
    +127        self.y_mean = None
    +128        self.y_std = None
    +129        self.ei = np.array([])
    +130        self.max_ei = []
    +131        if gp_obj is None:
    +132            self.gp_obj = GaussianProcessRegressor(
    +133                kernel=Matern(nu=2.5),
    +134                alpha=self.alpha,
    +135                normalize_y=True,
    +136                n_restarts_optimizer=self.n_restarts_optimizer,
    +137                random_state=self.seed,
    +138            )
    +139        else:
    +140            self.gp_obj = gp_obj
    +141
    +142        # Sobol seqs for initial design and choices
    +143        sobol_seq_init = np.transpose(
    +144            generate_sobol2(
    +145                n_dims=self.n_dims,
    +146                n_points=self.n_init,
    +147                skip=2,
    +148            )
    +149        )
    +150        sobol_seq_choices = np.transpose(
    +151            generate_sobol2(
    +152                n_dims=self.n_dims,
    +153                n_points=self.n_choices,
    +154                skip=self.n_init + 2,
    +155            )
    +156        )
    +157
    +158        # Sobol seqs for initial design and choices with bounds
    +159        if self.log_scale == False:
    +160
    +161            bounds_range = upper_bound - lower_bound
    +162            self.x_init = (
    +163                bounds_range * sobol_seq_init + lower_bound
    +164                if x_init is None
    +165                else x_init
    +166            )
    +167            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    +168
    +169        else:  # (!) experimental
    +170
    +171            assert (
    +172                lower_bound > 0
    +173            ).all(), "all elements of `lower_bound` must be > 0"
    +174            assert (
    +175                upper_bound > 0
    +176            ).all(), "all elements of `upper_bound` must be > 0"
    +177
    +178            log_lower_bound = np.log(lower_bound)
    +179            log_upper_bound = np.log(upper_bound)
    +180            log_bounds_range = log_upper_bound - log_lower_bound
    +181            self.x_init = (
    +182                np.minimum(
    +183                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    +184                    1.7976931348623157e308,
    +185                )
    +186                if x_init is None
    +187                else x_init
    +188            )
    +189            self.x_choices = np.minimum(
    +190                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    +191                1.7976931348623157e308,
    +192            )
    +193
    +194        # shelve for saving (not for loading)
    +195        if self.save is not None:
    +196            self.sh = shelve.open(filename=save, flag="c", writeback=True)
     197
    -198        self.n_jobs = n_jobs
    +198        if self.per_second:
    +199            self.timings = []
    +200            self.rf_obj = RandomForestRegressor(
    +201                n_estimators=250, random_state=self.seed
    +202            )
    +203
    +204        self.n_jobs = n_jobs
     
    @@ -1014,6 +1039,17 @@

    Arguments:

    +
    +
    +
    + params_names + + +
    + + + +
    @@ -1246,21 +1282,21 @@

    Arguments:

    -
    201    def get_params(self):
    -202        """Get object attributes.
    -203
    -204        Returns
    -205        -------
    -206        params : mapping of string to any
    -207            Parameter names mapped to their values.
    -208        """
    -209        out = dict()
    -210        param_names = dir(self)
    -211        for key in param_names:
    -212            if key.startswith("_") is False:
    -213                out[key] = getattr(self, key, None)
    -214
    -215        return out
    +            
    207    def get_params(self):
    +208        """Get object attributes.
    +209
    +210        Returns
    +211        -------
    +212        params : mapping of string to any
    +213            Parameter names mapped to their values.
    +214        """
    +215        out = dict()
    +216        param_names = dir(self)
    +217        for key in param_names:
    +218            if key.startswith("_") is False:
    +219                out[key] = getattr(self, key, None)
    +220
    +221        return out
     
    @@ -1285,11 +1321,11 @@

    Returns

    -
    218    def eval_objective(self, arg):
    -219        try:
    -220            return self.objective_func(self.x_init[arg, :])
    -221        except:
    -222            return 1e06
    +            
    224    def eval_objective(self, arg):
    +225        try:
    +226            return self.objective_func(self.x_init[arg, :])
    +227        except:
    +228            return 1e06
     
    @@ -1307,19 +1343,19 @@

    Returns

    -
    225    def load(self, path):
    -226        """load data from stored shelve.
    -227
    -228        # Arguments
    -229
    -230        path : a string; path to stored shelve.
    -231
    -232        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -233        """
    -234
    -235        self.sh = shelve.open(filename=path)
    -236        for key, value in self.sh.items():
    -237            setattr(self, key, value)
    +            
    231    def load(self, path):
    +232        """load data from stored shelve.
    +233
    +234        # Arguments
    +235
    +236        path : a string; path to stored shelve.
    +237
    +238        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +239        """
    +240
    +241        self.sh = shelve.open(filename=path)
    +242        for key, value in self.sh.items():
    +243            setattr(self, key, value)
     
    @@ -1345,11 +1381,11 @@

    Arguments

    -
    240    def update_shelve(self):
    -241        for key, value in self.get_params().items():
    -242            if (callable(value) is False) & (key != "sh"):
    -243                self.sh[key] = value
    -244        self.sh.sync()
    +            
    246    def update_shelve(self):
    +247        for key, value in self.get_params().items():
    +248            if (callable(value) is False) & (key != "sh"):
    +249                self.sh[key] = value
    +250        self.sh.sync()
     
    @@ -1367,17 +1403,17 @@

    Arguments

    -
    247    def close_shelve(self):
    -248        """Close shelve.
    -249
    -250        # Arguments
    -251
    -252        No argument.
    -253
    -254        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -255        """
    -256
    -257        self.sh.close()
    +            
    253    def close_shelve(self):
    +254        """Close shelve.
    +255
    +256        # Arguments
    +257
    +258        No argument.
    +259
    +260        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +261        """
    +262
    +263        self.sh.close()
     
    @@ -1403,16 +1439,16 @@

    Arguments

    -
    260    def gp_fit_predict(self, X_train, y_train, X_test):
    -261
    -262        if len(X_train.shape) == 1:
    -263            X_train = X_train.reshape((-1, 1))
    -264            X_test = X_test.reshape((-1, 1))
    -265
    -266        # Get mean and standard deviation
    -267        return self.gp_obj.fit(X_train, y_train).predict(
    -268            X_test, return_std=True
    -269        )
    +            
    266    def gp_fit_predict(self, X_train, y_train, X_test):
    +267
    +268        if len(X_train.shape) == 1:
    +269            X_train = X_train.reshape((-1, 1))
    +270            X_test = X_test.reshape((-1, 1))
    +271
    +272        # Get mean and standard deviation
    +273        return self.gp_obj.fit(X_train, y_train).predict(
    +274            X_test, return_std=True
    +275        )
     
    @@ -1430,14 +1466,14 @@

    Arguments

    -
    272    def timings_fit_predict(self, X_train, y_train, X_test):
    -273
    -274        if len(X_train.shape) == 1:
    -275            X_train = X_train.reshape((-1, 1))
    -276            X_test = X_test.reshape((-1, 1))
    -277
    -278        # Get mean preds for timings
    -279        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    +            
    278    def timings_fit_predict(self, X_train, y_train, X_test):
    +279
    +280        if len(X_train.shape) == 1:
    +281            X_train = X_train.reshape((-1, 1))
    +282            X_test = X_test.reshape((-1, 1))
    +283
    +284        # Get mean preds for timings
    +285        return self.rf_obj.fit(X_train, y_train).predict(X_test)
     
    @@ -1455,65 +1491,65 @@

    Arguments

    -
    282    def next_parameter_by_ei(self, seed, i):
    -283
    -284        gamma_hat = (self.y_min - self.y_mean) / self.y_std
    -285
    -286        self.ei = -self.y_std * (
    -287            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    -288        )
    +            
    288    def next_parameter_by_ei(self, seed, i):
     289
    -290        # find max index -----
    +290        gamma_hat = (self.y_min - self.y_mean) / self.y_std
     291
    -292        if self.per_second is False:
    -293
    -294            # find index for max. ei
    -295            max_index = self.ei.argmin()
    -296
    -297        else:  # self.per_second is True
    -298
    -299            # predict timings on self.x_choices
    -300            # train on X = self.parameters and y = self.timings
    -301            # (must have same shape[0])
    -302            timing_preds = self.timings_fit_predict(
    -303                X_train=np.asarray(self.parameters),
    -304                y_train=np.asarray(self.timings),
    -305                X_test=self.x_choices,
    -306            )
    -307
    -308            # find index for max. ei (and min. timings)
    -309            max_index = (-self.ei / timing_preds).argmax()
    -310
    -311        self.max_ei.append(np.abs(self.ei[max_index]))
    -312
    -313        # Select next choice
    -314        next_param = self.x_choices[max_index, :]
    -315
    -316        if next_param in np.asarray(self.parameters):
    -317
    -318            if self.log_scale == False:
    -319
    -320                np.random.seed(self.seed * i + 1000)
    -321                next_param = (
    -322                    self.upper_bound - self.lower_bound
    -323                ) * np.random.rand(self.n_dims) + self.lower_bound
    -324
    -325            else:  # /!\ very... experimental
    -326
    -327                np.random.seed(self.seed)
    -328                log_upper_bound = np.log(self.upper_bound)
    -329                log_lower_bound = np.log(self.lower_bound)
    -330                log_bounds_range = log_upper_bound - log_lower_bound
    -331
    -332                next_param = np.minimum(
    -333                    np.exp(
    -334                        log_bounds_range * np.random.rand(self.n_dims)
    -335                        + log_lower_bound
    -336                    ),
    -337                    1.7976931348623157e308,
    -338                )
    -339
    -340        return next_param
    +292        self.ei = -self.y_std * (
    +293            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    +294        )
    +295
    +296        # find max index -----
    +297
    +298        if self.per_second is False:
    +299
    +300            # find index for max. ei
    +301            max_index = self.ei.argmin()
    +302
    +303        else:  # self.per_second is True
    +304
    +305            # predict timings on self.x_choices
    +306            # train on X = self.parameters and y = self.timings
    +307            # (must have same shape[0])
    +308            timing_preds = self.timings_fit_predict(
    +309                X_train=np.asarray(self.parameters),
    +310                y_train=np.asarray(self.timings),
    +311                X_test=self.x_choices,
    +312            )
    +313
    +314            # find index for max. ei (and min. timings)
    +315            max_index = (-self.ei / timing_preds).argmax()
    +316
    +317        self.max_ei.append(np.abs(self.ei[max_index]))
    +318
    +319        # Select next choice
    +320        next_param = self.x_choices[max_index, :]
    +321
    +322        if next_param in np.asarray(self.parameters):
    +323
    +324            if self.log_scale == False:
    +325
    +326                np.random.seed(self.seed * i + 1000)
    +327                next_param = (
    +328                    self.upper_bound - self.lower_bound
    +329                ) * np.random.rand(self.n_dims) + self.lower_bound
    +330
    +331            else:  # /!\ very... experimental
    +332
    +333                np.random.seed(self.seed)
    +334                log_upper_bound = np.log(self.upper_bound)
    +335                log_lower_bound = np.log(self.lower_bound)
    +336                log_bounds_range = log_upper_bound - log_lower_bound
    +337
    +338                next_param = np.minimum(
    +339                    np.exp(
    +340                        log_bounds_range * np.random.rand(self.n_dims)
    +341                        + log_lower_bound
    +342                    ),
    +343                    1.7976931348623157e308,
    +344                )
    +345
    +346        return next_param
     
    @@ -1531,324 +1567,336 @@

    Arguments

    -
    343    def optimize(
    -344        self,
    -345        verbose=1,
    -346        n_more_iter=None,
    -347        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    -348        min_budget=50,  # minimum budget for early stopping
    -349        func_args=None,
    -350    ):
    -351        """Launch optimization loop.
    -352
    -353        # Arguments:
    -354
    -355            verbose: an integer;
    -356                verbose = 0: nothing is printed,
    -357                verbose = 1: a progress bar is printed (longer than 0),
    -358                verbose = 2: information about each iteration is printed (longer than 1)
    -359
    -360            n_more_iter: an integer;
    -361                additional number of iterations for the optimizer (which has been run once)
    -362
    -363            abs_tol: a float;
    -364                tolerance for convergence of the optimizer (early stopping based on expected improvement)
    +            
    349    def optimize(
    +350        self,
    +351        verbose=1,
    +352        n_more_iter=None,
    +353        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    +354        min_budget=50,  # minimum budget for early stopping
    +355        func_args=None,
    +356    ):
    +357        """Launch optimization loop.
    +358
    +359        # Arguments:
    +360
    +361            verbose: an integer;
    +362                verbose = 0: nothing is printed,
    +363                verbose = 1: a progress bar is printed (longer than 0),
    +364                verbose = 2: information about each iteration is printed (longer than 1)
     365
    -366            min_budget: an integer (default is 50);
    -367                minimum number of iterations before early stopping controlled by `abs_tol`
    +366            n_more_iter: an integer;
    +367                additional number of iterations for the optimizer (which has been run once)
     368
    -369            func_args: a list;
    -370                additional parameters for the objective function (if necessary)
    +369            abs_tol: a float;
    +370                tolerance for convergence of the optimizer (early stopping based on expected improvement)
     371
    -372        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    -373        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +372            min_budget: an integer (default is 50);
    +373                minimum number of iterations before early stopping controlled by `abs_tol`
     374
    -375        """
    -376
    -377        # verbose = 0: nothing is printed
    -378        # verbose = 1: a progress bar is printed (longer than 0)
    -379        # verbose = 2: information about each iteration is printed (longer than 1)
    -380        if func_args is None:
    -381            func_args = []
    +375            func_args: a list;
    +376                additional parameters for the objective function (if necessary)
    +377
    +378        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    +379        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +380
    +381        """
     382
    -383        if (
    -384            n_more_iter is None
    -385        ):  # initial optimization, before more iters are requested
    -386
    -387            n_iter = self.n_iter
    -388            # stopping iter for early stopping (default is total budget)
    -389            iter_stop = n_iter  # potentially # got to check this
    -390
    -391            # initial design  ----------
    +383        # verbose = 0: nothing is printed
    +384        # verbose = 1: a progress bar is printed (longer than 0)
    +385        # verbose = 2: information about each iteration is printed (longer than 1)
    +386        if func_args is None:
    +387            func_args = []
    +388
    +389        if (
    +390            n_more_iter is None
    +391        ):  # initial optimization, before more iters are requested
     392
    -393            if (verbose == 1) | (verbose == 2):
    -394                print(f"\n Creating initial design... \n")
    -395
    -396            if verbose == 1:
    -397                progbar = Progbar(target=self.n_init)
    +393            n_iter = self.n_iter
    +394            # stopping iter for early stopping (default is total budget)
    +395            iter_stop = n_iter  # potentially # got to check this
    +396
    +397            # initial design  ----------
     398
    -399            self.parameters = self.x_init.tolist()
    -400            self.scores = []
    +399            if (verbose == 1) | (verbose == 2):
    +400                print(f"\n Creating initial design... \n")
     401
    -402            if self.save is not None:
    -403                self.update_shelve()
    +402            if verbose == 1:
    +403                progbar = Progbar(target=self.n_init)
     404
    -405            if self.y_init is None:  # calculate scores on initial design
    -406
    -407                assert (
    -408                    self.objective_func is not None
    -409                ), "self.y_init is None: must have 'objective_func' not None"
    +405            self.parameters = self.x_init.tolist()
    +406            self.scores = []
    +407
    +408            if self.save is not None:
    +409                self.update_shelve()
     410
    -411                if self.n_jobs == 1:
    +411            if self.y_init is None:  # calculate scores on initial design
     412
    -413                    for i in range(self.n_init):
    -414
    -415                        x_next = self.x_init[i, :]
    +413                assert (
    +414                    self.objective_func is not None
    +415                ), "self.y_init is None: must have 'objective_func' not None"
     416
    -417                        try:
    +417                if self.n_jobs == 1:
     418
    -419                            if self.per_second is True:
    +419                    for i in range(self.n_init):
     420
    -421                                start = time()
    -422                                score = self.objective_func(x_next, *func_args)
    -423                                if (np.isfinite(score) == False) or (
    -424                                    np.isnan(score) == True
    -425                                ):
    -426                                    continue
    -427                                self.timings.append(np.log(time() - start))
    -428
    -429                            else:  # self.per_second is False
    -430
    -431                                score = self.objective_func(x_next, *func_args)
    -432                                if (np.isfinite(score) == False) or (
    -433                                    np.isnan(score) == True
    -434                                ):
    -435                                    continue
    +421                        x_next = self.x_init[i, :]
    +422
    +423                        try:
    +424
    +425                            if self.per_second is True:
    +426
    +427                                start = time()
    +428                                score = self.objective_func(x_next, *func_args)
    +429                                if (np.isfinite(score) == False) or (
    +430                                    np.isnan(score) == True
    +431                                ):
    +432                                    continue
    +433                                self.timings.append(np.log(time() - start))
    +434
    +435                            else:  # self.per_second is False
     436
    -437                            self.scores.append(score)
    -438
    -439                            if self.save is not None:
    -440                                self.update_shelve()
    -441
    -442                        except:
    -443
    -444                            continue
    -445
    -446                        if verbose == 1:
    -447                            progbar.update(i)  # update progress bar
    -448
    -449                        if verbose == 2:
    -450                            print(f"point: {x_next}; score: {score}")
    -451                    # end loop # calculate scores on initial design
    -452
    -453                    if verbose == 1:
    -454                        progbar.update(self.n_init)
    -455
    -456                else:  # self.n_jobs != 1
    -457
    -458                    assert (
    -459                        self.per_second is False
    -460                    ), "timings not calculated here"
    +437                                score = self.objective_func(x_next, *func_args)
    +438                                if (np.isfinite(score) == False) or (
    +439                                    np.isnan(score) == True
    +440                                ):
    +441                                    continue
    +442
    +443                            self.scores.append(score)
    +444
    +445                            if self.save is not None:
    +446                                self.update_shelve()
    +447
    +448                        except:
    +449
    +450                            continue
    +451
    +452                        if verbose == 1:
    +453                            progbar.update(i)  # update progress bar
    +454
    +455                        if verbose == 2:
    +456                            print(f"point: {x_next}; score: {score}")
    +457                    # end loop # calculate scores on initial design
    +458
    +459                    if verbose == 1:
    +460                        progbar.update(self.n_init)
     461
    -462                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    -463                        delayed(self.objective_func)(self.x_init[i, :])
    -464                        for i in range(self.n_init)
    -465                    )
    -466
    -467                    self.scores = scores
    -468
    -469                    if self.save is not None:
    -470                        self.update_shelve()
    -471
    -472            else:  # if self.y_init is None:
    -473
    -474                assert self.x_init.shape[0] == len(
    -475                    self.y_init
    -476                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +462                else:  # self.n_jobs != 1
    +463
    +464                    assert (
    +465                        self.per_second is False
    +466                    ), "timings not calculated here"
    +467
    +468                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    +469                        delayed(self.objective_func)(self.x_init[i, :])
    +470                        for i in range(self.n_init)
    +471                    )
    +472
    +473                    self.scores = scores
    +474
    +475                    if self.save is not None:
    +476                        self.update_shelve()
     477
    -478                self.scores = pickle.loads(
    -479                    pickle.dumps(self.y_init.tolist(), -1)
    -480                )
    -481
    -482            # current best score on initial design
    -483            min_index = (np.asarray(self.scores)).argmin()
    -484            self.y_min = self.scores[min_index]
    -485            self.x_min = self.x_init[min_index, :]
    -486
    -487            # current gp mean and std on initial design
    -488            y_mean, y_std = self.gp_fit_predict(
    -489                np.asarray(self.parameters),
    -490                np.asarray(self.scores),
    -491                self.x_choices,
    -492            )
    -493            self.y_mean = y_mean
    -494            self.y_std = np.maximum(2.220446049250313e-16, y_std)
    -495
    -496            # saving after initial design computation
    -497            if self.save is not None:
    -498                self.update_shelve()
    -499
    -500        else:  # if n_more_iter is not None
    +478            else:  # if self.y_init is None:
    +479
    +480                assert self.x_init.shape[0] == len(
    +481                    self.y_init
    +482                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +483
    +484                self.scores = pickle.loads(
    +485                    pickle.dumps(self.y_init.tolist(), -1)
    +486                )
    +487
    +488            # current best score on initial design
    +489            min_index = (np.asarray(self.scores)).argmin()
    +490            self.y_min = self.scores[min_index]
    +491            self.x_min = self.x_init[min_index, :]
    +492
    +493            # current gp mean and std on initial design
    +494            y_mean, y_std = self.gp_fit_predict(
    +495                np.asarray(self.parameters),
    +496                np.asarray(self.scores),
    +497                self.x_choices,
    +498            )
    +499            self.y_mean = y_mean
    +500            self.y_std = np.maximum(2.220446049250313e-16, y_std)
     501
    -502            assert self.n_iter > 5, "you must have n_iter > 5"
    -503            n_iter = n_more_iter
    -504            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +502            # saving after initial design computation
    +503            if self.save is not None:
    +504                self.update_shelve()
     505
    -506        if (verbose == 1) | (verbose == 2):
    -507            print(f"\n ...Done. \n")
    -508            try:
    -509                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    -510            except:
    -511                pass
    -512
    -513        # end init design ----------
    -514
    -515        # if n_more_iter is None: # initial optimization, before more iters are requested
    -516
    -517        if (verbose == 1) | (verbose == 2):
    -518            print(f"\n Optimization loop... \n")
    -519
    -520        # early stopping?
    -521        if abs_tol is not None:
    -522            assert (
    -523                min_budget > 20
    -524            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +506        else:  # if n_more_iter is not None
    +507
    +508            assert self.n_iter > 5, "you must have n_iter > 5"
    +509            n_iter = n_more_iter
    +510            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +511
    +512        if (verbose == 1) | (verbose == 2):
    +513            print(f"\n ...Done. \n")
    +514            try:
    +515                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    +516            except:
    +517                pass
    +518
    +519        # end init design ----------
    +520
    +521        # if n_more_iter is None: # initial optimization, before more iters are requested
    +522
    +523        if (verbose == 1) | (verbose == 2):
    +524            print(f"\n Optimization loop... \n")
     525
    -526        if verbose == 1:
    -527            progbar = Progbar(target=n_iter)
    -528
    -529        # main loop ----------
    -530
    -531        for i in range(n_iter):
    -532
    -533            # find next set of parameters (vector), maximizing ei
    -534            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
    -535
    -536            try:
    -537
    -538                if self.per_second is True:
    -539
    -540                    start = time()
    +526        # early stopping?
    +527        if abs_tol is not None:
    +528            assert (
    +529                min_budget > 20
    +530            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +531
    +532        if verbose == 1:
    +533            progbar = Progbar(target=n_iter)
    +534
    +535        # main loop ----------
    +536
    +537        for i in range(n_iter):
    +538
    +539            # find next set of parameters (vector), maximizing ei
    +540            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
     541
    -542                    if self.objective_func is not None:
    +542            try:
     543
    -544                        score_next_param = self.objective_func(
    -545                            next_param, *func_args
    -546                        )
    +544                if self.per_second is True:
    +545
    +546                    start = time()
     547
    -548                        if (np.isfinite(score_next_param) == False) or (
    -549                            np.isnan(score_next_param) == True
    -550                        ):
    -551                            continue
    -552
    -553                    else:
    -554
    -555                        assert (self.x_init is not None) and (
    -556                            self.y_init is not None
    -557                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +548                    if self.objective_func is not None:
    +549
    +550                        score_next_param = self.objective_func(
    +551                            next_param, *func_args
    +552                        )
    +553
    +554                        if (np.isfinite(score_next_param) == False) or (
    +555                            np.isnan(score_next_param) == True
    +556                        ):
    +557                            continue
     558
    -559                        print(f"\n next param: {next_param} \n")
    -560                        score_next_param = float(
    -561                            input("get new score: \n")
    -562                        )  # or an API response
    -563
    -564                        if (np.isfinite(score_next_param) == False) or (
    -565                            np.isnan(score_next_param) == True
    -566                        ):
    -567                            continue
    -568
    -569                    self.timings.append(np.log(time() - start))
    -570
    -571                else:  # self.per_second is False:
    -572
    -573                    if self.objective_func is not None:
    +559                    else:
    +560
    +561                        assert (self.x_init is not None) and (
    +562                            self.y_init is not None
    +563                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +564
    +565                        print(f"\n next param: {next_param} \n")
    +566                        score_next_param = float(
    +567                            input("get new score: \n")
    +568                        )  # or an API response
    +569
    +570                        if (np.isfinite(score_next_param) == False) or (
    +571                            np.isnan(score_next_param) == True
    +572                        ):
    +573                            continue
     574
    -575                        score_next_param = self.objective_func(
    -576                            next_param, *func_args
    -577                        )
    +575                    self.timings.append(np.log(time() - start))
    +576
    +577                else:  # self.per_second is False:
     578
    -579                        if (np.isfinite(score_next_param) == False) or (
    -580                            np.isnan(score_next_param) == True
    -581                        ):
    -582                            continue
    -583
    -584                    else:
    -585
    -586                        assert (self.x_init is not None) and (
    -587                            self.y_init is not None
    -588                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +579                    if self.objective_func is not None:
    +580
    +581                        score_next_param = self.objective_func(
    +582                            next_param, *func_args
    +583                        )
    +584
    +585                        if (np.isfinite(score_next_param) == False) or (
    +586                            np.isnan(score_next_param) == True
    +587                        ):
    +588                            continue
     589
    -590                        print(f"\n next param: {next_param} \n")
    -591                        score_next_param = float(
    -592                            input("get new score: \n")
    -593                        )  # or an API response
    -594
    -595                        if (np.isfinite(score_next_param) == False) or (
    -596                            np.isnan(score_next_param) == True
    -597                        ):
    -598                            continue
    -599
    -600            except:
    -601
    -602                continue
    -603
    -604            self.parameters.append(next_param.tolist())
    +590                    else:
    +591
    +592                        assert (self.x_init is not None) and (
    +593                            self.y_init is not None
    +594                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +595
    +596                        print(f"\n next param: {next_param} \n")
    +597                        score_next_param = float(
    +598                            input("get new score: \n")
    +599                        )  # or an API response
    +600
    +601                        if (np.isfinite(score_next_param) == False) or (
    +602                            np.isnan(score_next_param) == True
    +603                        ):
    +604                            continue
     605
    -606            self.scores.append(score_next_param)
    +606            except:
     607
    -608            if self.save is not None:
    -609                self.update_shelve()
    -610
    -611            if verbose == 2:
    -612                print(f"iteration {i + 1} -----")
    -613                print(f"current minimum:  {self.x_min}")
    -614                print(f"current minimum score:  {self.y_min}")
    -615                print(f"next parameter: {next_param}")
    -616                print(f"score for next parameter: {score_next_param} \n")
    -617
    -618            if score_next_param < self.y_min:
    -619                self.x_min = next_param
    -620                self.y_min = score_next_param
    -621                if self.save is not None:
    -622                    self.update_shelve()
    +608                continue
    +609
    +610            self.parameters.append(next_param.tolist())
    +611
    +612            self.scores.append(score_next_param)
    +613
    +614            if self.save is not None:
    +615                self.update_shelve()
    +616
    +617            if verbose == 2:
    +618                print(f"iteration {i + 1} -----")
    +619                print(f"current minimum:  {self.x_min}")
    +620                print(f"current minimum score:  {self.y_min}")
    +621                print(f"next parameter: {next_param}")
    +622                print(f"score for next parameter: {score_next_param} \n")
     623
    -624            self.y_mean, self.y_std = self.gp_fit_predict(
    -625                np.asarray(self.parameters),
    -626                np.asarray(self.scores),
    -627                self.x_choices,
    -628            )
    +624            if score_next_param < self.y_min:
    +625                self.x_min = next_param
    +626                self.y_min = score_next_param
    +627                if self.save is not None:
    +628                    self.update_shelve()
     629
    -630            if self.save is not None:
    -631                self.update_shelve()
    -632
    -633            if verbose == 1:
    -634                progbar.update(i + 1)  # update progress bar
    +630            self.y_mean, self.y_std = self.gp_fit_predict(
    +631                np.asarray(self.parameters),
    +632                np.asarray(self.scores),
    +633                self.x_choices,
    +634            )
     635
    -636            # early stopping
    -637
    -638            if abs_tol is not None:
    -639
    -640                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    -641                if len(self.max_ei) > min_budget:
    -642
    -643                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
    -644
    -645                    if diff_max_ei[-1] <= abs_tol:
    -646
    -647                        iter_stop = len(self.max_ei)  # index i starts at 0
    +636            if self.save is not None:
    +637                self.update_shelve()
    +638
    +639            if verbose == 1:
    +640                progbar.update(i + 1)  # update progress bar
    +641
    +642            # early stopping
    +643
    +644            if abs_tol is not None:
    +645
    +646                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    +647                if len(self.max_ei) > min_budget:
     648
    -649                        break
    +649                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
     650
    -651        # end main loop ----------
    +651                    if diff_max_ei[-1] <= abs_tol:
     652
    -653        if (verbose == 1) & (i < (n_iter - 1)):
    -654            progbar.update(n_iter)
    -655
    -656        self.n_iter = iter_stop
    -657        if self.save is not None:
    -658            self.update_shelve()
    -659
    -660        return (self.x_min, self.y_min)
    +653                        iter_stop = len(self.max_ei)  # index i starts at 0
    +654
    +655                        break
    +656
    +657        # end main loop ----------
    +658
    +659        if (verbose == 1) & (i < (n_iter - 1)):
    +660            progbar.update(n_iter)
    +661
    +662        self.n_iter = iter_stop
    +663        if self.save is not None:
    +664            self.update_shelve()
    +665        
    +666        DescribeResult = namedtuple(
    +667                "DescribeResult", ("best_params", "best_score")
    +668            )
    +669
    +670        if self.params_names is None:
    +671
    +672            return DescribeResult(self.x_min, self.y_min)
    +673
    +674        else:
    +675
    +676            return DescribeResult(
    +677                dict(zip(self.params_names, self.x_min)), self.y_min
    +678            )
     
    diff --git a/gpopt-docs/GPopt/GPOpt/GPOpt.html b/gpopt-docs/GPopt/GPOpt/GPOpt.html index 4a56053..52f5959 100644 --- a/gpopt-docs/GPopt/GPOpt/GPOpt.html +++ b/gpopt-docs/GPopt/GPOpt/GPOpt.html @@ -39,6 +39,9 @@

    API Documentation

  • objective_func
  • +
  • + params_names +
  • lower_bound
  • @@ -161,656 +164,674 @@

    7import numpy as np 8import pickle 9import shelve - 10from sklearn.gaussian_process import GaussianProcessRegressor - 11from sklearn.ensemble import RandomForestRegressor - 12from sklearn.gaussian_process.kernels import Matern - 13import scipy.stats as st - 14from joblib import Parallel, delayed - 15from time import time - 16from ..utils import generate_sobol2 - 17from ..utils import Progbar - 18 + 10from collections import namedtuple + 11from sklearn.gaussian_process import GaussianProcessRegressor + 12from sklearn.ensemble import RandomForestRegressor + 13from sklearn.gaussian_process.kernels import Matern + 14import scipy.stats as st + 15from joblib import Parallel, delayed + 16from time import time + 17from ..utils import generate_sobol2 + 18from ..utils import Progbar 19 - 20class GPOpt: - 21 """Class GPOpt. - 22 - 23 # Arguments: - 24 - 25 lower_bound: a numpy array; - 26 lower bound for researched minimum - 27 - 28 upper_bound: a numpy array; - 29 upper bound for researched minimum - 30 - 31 objective_func: a function; - 32 the objective function to be minimized - 33 - 34 gp_obj: a GaussianProcessRegressor object; - 35 An ML model for estimating the uncertainty around the objective function - 36 - 37 x_init: - 38 initial setting of points where `objective_func` is evaluated (optional) - 39 - 40 y_init: - 41 initial setting values at points where `objective_func` is evaluated (optional) - 42 - 43 n_init: an integer; - 44 number of points in the initial setting, when `x_init` and `y_init` are not provided - 45 - 46 n_choices: an integer; - 47 number of points for the calculation of expected improvement - 48 - 49 n_iter: an integer; - 50 number of iterations of the minimization algorithm - 51 - 52 alpha: a float; - 53 Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel) - 54 - 55 n_restarts_optimizer: an integer; - 56 The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood. - 57 - 58 seed: an integer; - 59 reproducibility seed - 60 - 61 save: a string; - 62 Specifies where to save the optimizer in its current state - 63 - 64 n_jobs: an integer; - 65 number of jobs for parallel computing on initial setting (can be -1) - 66 - 67 per_second: a boolean; - 68 __experimental__, default is False (leave to default for now) - 69 - 70 log_scale: a boolean; - 71 __experimental__, default is False (leave to default for now) - 72 - 73 see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) - 74 and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) - 75 - 76 """ - 77 - 78 def __init__( - 79 self, - 80 lower_bound, - 81 upper_bound, - 82 objective_func=None, - 83 gp_obj=None, - 84 x_init=None, - 85 y_init=None, - 86 n_init=10, - 87 n_choices=25000, - 88 n_iter=190, - 89 alpha=1e-6, - 90 n_restarts_optimizer=25, - 91 seed=123, - 92 save=None, - 93 n_jobs=1, - 94 per_second=False, # /!\ very experimental - 95 log_scale=False, # /!\ experimental - 96 ): - 97 - 98 n_dims = len(lower_bound) - 99 -100 assert n_dims == len( -101 upper_bound -102 ), "'upper_bound' and 'lower_bound' must have the same dimensions" -103 -104 self.objective_func = objective_func -105 self.lower_bound = lower_bound -106 self.upper_bound = upper_bound -107 self.y_init = y_init -108 self.log_scale = log_scale -109 self.n_dims = n_dims -110 self.n_init = n_init -111 self.n_choices = n_choices -112 self.n_iter = n_iter -113 self.alpha = alpha -114 self.n_restarts_optimizer = n_restarts_optimizer -115 self.seed = seed -116 self.save = save -117 self.per_second = per_second -118 self.x_min = None -119 self.y_min = None -120 self.y_mean = None -121 self.y_std = None -122 self.ei = np.array([]) -123 self.max_ei = [] -124 if gp_obj is None: -125 self.gp_obj = GaussianProcessRegressor( -126 kernel=Matern(nu=2.5), -127 alpha=self.alpha, -128 normalize_y=True, -129 n_restarts_optimizer=self.n_restarts_optimizer, -130 random_state=self.seed, -131 ) -132 else: -133 self.gp_obj = gp_obj -134 -135 # Sobol seqs for initial design and choices -136 sobol_seq_init = np.transpose( -137 generate_sobol2( -138 n_dims=self.n_dims, -139 n_points=self.n_init, -140 skip=2, -141 ) -142 ) -143 sobol_seq_choices = np.transpose( -144 generate_sobol2( -145 n_dims=self.n_dims, -146 n_points=self.n_choices, -147 skip=self.n_init + 2, -148 ) -149 ) -150 -151 # Sobol seqs for initial design and choices with bounds -152 if self.log_scale == False: -153 -154 bounds_range = upper_bound - lower_bound -155 self.x_init = ( -156 bounds_range * sobol_seq_init + lower_bound -157 if x_init is None -158 else x_init -159 ) -160 self.x_choices = bounds_range * sobol_seq_choices + lower_bound -161 -162 else: # (!) experimental -163 -164 assert ( -165 lower_bound > 0 -166 ).all(), "all elements of `lower_bound` must be > 0" -167 assert ( -168 upper_bound > 0 -169 ).all(), "all elements of `upper_bound` must be > 0" -170 -171 log_lower_bound = np.log(lower_bound) -172 log_upper_bound = np.log(upper_bound) -173 log_bounds_range = log_upper_bound - log_lower_bound -174 self.x_init = ( -175 np.minimum( -176 np.exp(log_bounds_range * sobol_seq_init + log_lower_bound), -177 1.7976931348623157e308, -178 ) -179 if x_init is None -180 else x_init -181 ) -182 self.x_choices = np.minimum( -183 np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound), -184 1.7976931348623157e308, -185 ) -186 -187 # shelve for saving (not for loading) -188 if self.save is not None: -189 self.sh = shelve.open(filename=save, flag="c", writeback=True) -190 -191 if self.per_second: -192 self.timings = [] -193 self.rf_obj = RandomForestRegressor( -194 n_estimators=250, random_state=self.seed -195 ) + 20 + 21class GPOpt: + 22 """Class GPOpt. + 23 + 24 # Arguments: + 25 + 26 lower_bound: a numpy array; + 27 lower bound for researched minimum + 28 + 29 upper_bound: a numpy array; + 30 upper bound for researched minimum + 31 + 32 objective_func: a function; + 33 the objective function to be minimized + 34 + 35 params_names: a list; + 36 names of the parameters of the objective function (optional) + 37 + 38 gp_obj: a GaussianProcessRegressor object; + 39 An ML model for estimating the uncertainty around the objective function + 40 + 41 x_init: + 42 initial setting of points where `objective_func` is evaluated (optional) + 43 + 44 y_init: + 45 initial setting values at points where `objective_func` is evaluated (optional) + 46 + 47 n_init: an integer; + 48 number of points in the initial setting, when `x_init` and `y_init` are not provided + 49 + 50 n_choices: an integer; + 51 number of points for the calculation of expected improvement + 52 + 53 n_iter: an integer; + 54 number of iterations of the minimization algorithm + 55 + 56 alpha: a float; + 57 Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel) + 58 + 59 n_restarts_optimizer: an integer; + 60 The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood. + 61 + 62 seed: an integer; + 63 reproducibility seed + 64 + 65 save: a string; + 66 Specifies where to save the optimizer in its current state + 67 + 68 n_jobs: an integer; + 69 number of jobs for parallel computing on initial setting (can be -1) + 70 + 71 per_second: a boolean; + 72 __experimental__, default is False (leave to default for now) + 73 + 74 log_scale: a boolean; + 75 __experimental__, default is False (leave to default for now) + 76 + 77 see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) + 78 and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) + 79 + 80 """ + 81 + 82 def __init__( + 83 self, + 84 lower_bound, + 85 upper_bound, + 86 objective_func=None, + 87 params_names=None, + 88 gp_obj=None, + 89 x_init=None, + 90 y_init=None, + 91 n_init=10, + 92 n_choices=25000, + 93 n_iter=190, + 94 alpha=1e-6, + 95 n_restarts_optimizer=25, + 96 seed=123, + 97 save=None, + 98 n_jobs=1, + 99 per_second=False, # /!\ very experimental +100 log_scale=False, # /!\ experimental +101 ): +102 +103 n_dims = len(lower_bound) +104 +105 assert n_dims == len( +106 upper_bound +107 ), "'upper_bound' and 'lower_bound' must have the same dimensions" +108 +109 self.objective_func = objective_func +110 self.params_names = params_names +111 self.lower_bound = lower_bound +112 self.upper_bound = upper_bound +113 self.y_init = y_init +114 self.log_scale = log_scale +115 self.n_dims = n_dims +116 self.n_init = n_init +117 self.n_choices = n_choices +118 self.n_iter = n_iter +119 self.alpha = alpha +120 self.n_restarts_optimizer = n_restarts_optimizer +121 self.seed = seed +122 self.save = save +123 self.per_second = per_second +124 self.x_min = None +125 self.y_min = None +126 self.y_mean = None +127 self.y_std = None +128 self.ei = np.array([]) +129 self.max_ei = [] +130 if gp_obj is None: +131 self.gp_obj = GaussianProcessRegressor( +132 kernel=Matern(nu=2.5), +133 alpha=self.alpha, +134 normalize_y=True, +135 n_restarts_optimizer=self.n_restarts_optimizer, +136 random_state=self.seed, +137 ) +138 else: +139 self.gp_obj = gp_obj +140 +141 # Sobol seqs for initial design and choices +142 sobol_seq_init = np.transpose( +143 generate_sobol2( +144 n_dims=self.n_dims, +145 n_points=self.n_init, +146 skip=2, +147 ) +148 ) +149 sobol_seq_choices = np.transpose( +150 generate_sobol2( +151 n_dims=self.n_dims, +152 n_points=self.n_choices, +153 skip=self.n_init + 2, +154 ) +155 ) +156 +157 # Sobol seqs for initial design and choices with bounds +158 if self.log_scale == False: +159 +160 bounds_range = upper_bound - lower_bound +161 self.x_init = ( +162 bounds_range * sobol_seq_init + lower_bound +163 if x_init is None +164 else x_init +165 ) +166 self.x_choices = bounds_range * sobol_seq_choices + lower_bound +167 +168 else: # (!) experimental +169 +170 assert ( +171 lower_bound > 0 +172 ).all(), "all elements of `lower_bound` must be > 0" +173 assert ( +174 upper_bound > 0 +175 ).all(), "all elements of `upper_bound` must be > 0" +176 +177 log_lower_bound = np.log(lower_bound) +178 log_upper_bound = np.log(upper_bound) +179 log_bounds_range = log_upper_bound - log_lower_bound +180 self.x_init = ( +181 np.minimum( +182 np.exp(log_bounds_range * sobol_seq_init + log_lower_bound), +183 1.7976931348623157e308, +184 ) +185 if x_init is None +186 else x_init +187 ) +188 self.x_choices = np.minimum( +189 np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound), +190 1.7976931348623157e308, +191 ) +192 +193 # shelve for saving (not for loading) +194 if self.save is not None: +195 self.sh = shelve.open(filename=save, flag="c", writeback=True) 196 -197 self.n_jobs = n_jobs -198 -199 # from sklearn.base -200 def get_params(self): -201 """Get object attributes. +197 if self.per_second: +198 self.timings = [] +199 self.rf_obj = RandomForestRegressor( +200 n_estimators=250, random_state=self.seed +201 ) 202 -203 Returns -204 ------- -205 params : mapping of string to any -206 Parameter names mapped to their values. -207 """ -208 out = dict() -209 param_names = dir(self) -210 for key in param_names: -211 if key.startswith("_") is False: -212 out[key] = getattr(self, key, None) -213 -214 return out -215 -216 # for parallel case on initial design -217 def eval_objective(self, arg): -218 try: -219 return self.objective_func(self.x_init[arg, :]) -220 except: -221 return 1e06 -222 -223 # load data from stored shelve -224 def load(self, path): -225 """load data from stored shelve. -226 -227 # Arguments +203 self.n_jobs = n_jobs +204 +205 # from sklearn.base +206 def get_params(self): +207 """Get object attributes. +208 +209 Returns +210 ------- +211 params : mapping of string to any +212 Parameter names mapped to their values. +213 """ +214 out = dict() +215 param_names = dir(self) +216 for key in param_names: +217 if key.startswith("_") is False: +218 out[key] = getattr(self, key, None) +219 +220 return out +221 +222 # for parallel case on initial design +223 def eval_objective(self, arg): +224 try: +225 return self.objective_func(self.x_init[arg, :]) +226 except: +227 return 1e06 228 -229 path : a string; path to stored shelve. -230 -231 See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) -232 """ -233 -234 self.sh = shelve.open(filename=path) -235 for key, value in self.sh.items(): -236 setattr(self, key, value) -237 -238 # update shelve in optimization loop -239 def update_shelve(self): -240 for key, value in self.get_params().items(): -241 if (callable(value) is False) & (key != "sh"): -242 self.sh[key] = value -243 self.sh.sync() -244 -245 # closing shelve (can't be modified after) -246 def close_shelve(self): -247 """Close shelve. -248 -249 # Arguments +229 # load data from stored shelve +230 def load(self, path): +231 """load data from stored shelve. +232 +233 # Arguments +234 +235 path : a string; path to stored shelve. +236 +237 See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) +238 """ +239 +240 self.sh = shelve.open(filename=path) +241 for key, value in self.sh.items(): +242 setattr(self, key, value) +243 +244 # update shelve in optimization loop +245 def update_shelve(self): +246 for key, value in self.get_params().items(): +247 if (callable(value) is False) & (key != "sh"): +248 self.sh[key] = value +249 self.sh.sync() 250 -251 No argument. -252 -253 See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) -254 """ -255 -256 self.sh.close() -257 -258 # fit predict -259 def gp_fit_predict(self, X_train, y_train, X_test): -260 -261 if len(X_train.shape) == 1: -262 X_train = X_train.reshape((-1, 1)) -263 X_test = X_test.reshape((-1, 1)) -264 -265 # Get mean and standard deviation -266 return self.gp_obj.fit(X_train, y_train).predict( -267 X_test, return_std=True -268 ) -269 -270 # fit predict timings -271 def timings_fit_predict(self, X_train, y_train, X_test): -272 -273 if len(X_train.shape) == 1: -274 X_train = X_train.reshape((-1, 1)) -275 X_test = X_test.reshape((-1, 1)) -276 -277 # Get mean preds for timings -278 return self.rf_obj.fit(X_train, y_train).predict(X_test) -279 -280 # find next parameter by using expected improvement (ei) -281 def next_parameter_by_ei(self, seed, i): +251 # closing shelve (can't be modified after) +252 def close_shelve(self): +253 """Close shelve. +254 +255 # Arguments +256 +257 No argument. +258 +259 See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt) +260 """ +261 +262 self.sh.close() +263 +264 # fit predict +265 def gp_fit_predict(self, X_train, y_train, X_test): +266 +267 if len(X_train.shape) == 1: +268 X_train = X_train.reshape((-1, 1)) +269 X_test = X_test.reshape((-1, 1)) +270 +271 # Get mean and standard deviation +272 return self.gp_obj.fit(X_train, y_train).predict( +273 X_test, return_std=True +274 ) +275 +276 # fit predict timings +277 def timings_fit_predict(self, X_train, y_train, X_test): +278 +279 if len(X_train.shape) == 1: +280 X_train = X_train.reshape((-1, 1)) +281 X_test = X_test.reshape((-1, 1)) 282 -283 gamma_hat = (self.y_min - self.y_mean) / self.y_std -284 -285 self.ei = -self.y_std * ( -286 gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat) -287 ) +283 # Get mean preds for timings +284 return self.rf_obj.fit(X_train, y_train).predict(X_test) +285 +286 # find next parameter by using expected improvement (ei) +287 def next_parameter_by_ei(self, seed, i): 288 -289 # find max index ----- +289 gamma_hat = (self.y_min - self.y_mean) / self.y_std 290 -291 if self.per_second is False: -292 -293 # find index for max. ei -294 max_index = self.ei.argmin() -295 -296 else: # self.per_second is True -297 -298 # predict timings on self.x_choices -299 # train on X = self.parameters and y = self.timings -300 # (must have same shape[0]) -301 timing_preds = self.timings_fit_predict( -302 X_train=np.asarray(self.parameters), -303 y_train=np.asarray(self.timings), -304 X_test=self.x_choices, -305 ) -306 -307 # find index for max. ei (and min. timings) -308 max_index = (-self.ei / timing_preds).argmax() -309 -310 self.max_ei.append(np.abs(self.ei[max_index])) -311 -312 # Select next choice -313 next_param = self.x_choices[max_index, :] -314 -315 if next_param in np.asarray(self.parameters): -316 -317 if self.log_scale == False: -318 -319 np.random.seed(self.seed * i + 1000) -320 next_param = ( -321 self.upper_bound - self.lower_bound -322 ) * np.random.rand(self.n_dims) + self.lower_bound -323 -324 else: # /!\ very... experimental -325 -326 np.random.seed(self.seed) -327 log_upper_bound = np.log(self.upper_bound) -328 log_lower_bound = np.log(self.lower_bound) -329 log_bounds_range = log_upper_bound - log_lower_bound -330 -331 next_param = np.minimum( -332 np.exp( -333 log_bounds_range * np.random.rand(self.n_dims) -334 + log_lower_bound -335 ), -336 1.7976931348623157e308, -337 ) -338 -339 return next_param -340 -341 # optimize the objective -342 def optimize( -343 self, -344 verbose=1, -345 n_more_iter=None, -346 abs_tol=None, # suggested 1e-4, for n_iter = 200 -347 min_budget=50, # minimum budget for early stopping -348 func_args=None, -349 ): -350 """Launch optimization loop. -351 -352 # Arguments: -353 -354 verbose: an integer; -355 verbose = 0: nothing is printed, -356 verbose = 1: a progress bar is printed (longer than 0), -357 verbose = 2: information about each iteration is printed (longer than 1) -358 -359 n_more_iter: an integer; -360 additional number of iterations for the optimizer (which has been run once) -361 -362 abs_tol: a float; -363 tolerance for convergence of the optimizer (early stopping based on expected improvement) +291 self.ei = -self.y_std * ( +292 gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat) +293 ) +294 +295 # find max index ----- +296 +297 if self.per_second is False: +298 +299 # find index for max. ei +300 max_index = self.ei.argmin() +301 +302 else: # self.per_second is True +303 +304 # predict timings on self.x_choices +305 # train on X = self.parameters and y = self.timings +306 # (must have same shape[0]) +307 timing_preds = self.timings_fit_predict( +308 X_train=np.asarray(self.parameters), +309 y_train=np.asarray(self.timings), +310 X_test=self.x_choices, +311 ) +312 +313 # find index for max. ei (and min. timings) +314 max_index = (-self.ei / timing_preds).argmax() +315 +316 self.max_ei.append(np.abs(self.ei[max_index])) +317 +318 # Select next choice +319 next_param = self.x_choices[max_index, :] +320 +321 if next_param in np.asarray(self.parameters): +322 +323 if self.log_scale == False: +324 +325 np.random.seed(self.seed * i + 1000) +326 next_param = ( +327 self.upper_bound - self.lower_bound +328 ) * np.random.rand(self.n_dims) + self.lower_bound +329 +330 else: # /!\ very... experimental +331 +332 np.random.seed(self.seed) +333 log_upper_bound = np.log(self.upper_bound) +334 log_lower_bound = np.log(self.lower_bound) +335 log_bounds_range = log_upper_bound - log_lower_bound +336 +337 next_param = np.minimum( +338 np.exp( +339 log_bounds_range * np.random.rand(self.n_dims) +340 + log_lower_bound +341 ), +342 1.7976931348623157e308, +343 ) +344 +345 return next_param +346 +347 # optimize the objective +348 def optimize( +349 self, +350 verbose=1, +351 n_more_iter=None, +352 abs_tol=None, # suggested 1e-4, for n_iter = 200 +353 min_budget=50, # minimum budget for early stopping +354 func_args=None, +355 ): +356 """Launch optimization loop. +357 +358 # Arguments: +359 +360 verbose: an integer; +361 verbose = 0: nothing is printed, +362 verbose = 1: a progress bar is printed (longer than 0), +363 verbose = 2: information about each iteration is printed (longer than 1) 364 -365 min_budget: an integer (default is 50); -366 minimum number of iterations before early stopping controlled by `abs_tol` +365 n_more_iter: an integer; +366 additional number of iterations for the optimizer (which has been run once) 367 -368 func_args: a list; -369 additional parameters for the objective function (if necessary) +368 abs_tol: a float; +369 tolerance for convergence of the optimizer (early stopping based on expected improvement) 370 -371 see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) -372 and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) +371 min_budget: an integer (default is 50); +372 minimum number of iterations before early stopping controlled by `abs_tol` 373 -374 """ -375 -376 # verbose = 0: nothing is printed -377 # verbose = 1: a progress bar is printed (longer than 0) -378 # verbose = 2: information about each iteration is printed (longer than 1) -379 if func_args is None: -380 func_args = [] +374 func_args: a list; +375 additional parameters for the objective function (if necessary) +376 +377 see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt) +378 and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt) +379 +380 """ 381 -382 if ( -383 n_more_iter is None -384 ): # initial optimization, before more iters are requested -385 -386 n_iter = self.n_iter -387 # stopping iter for early stopping (default is total budget) -388 iter_stop = n_iter # potentially # got to check this -389 -390 # initial design ---------- +382 # verbose = 0: nothing is printed +383 # verbose = 1: a progress bar is printed (longer than 0) +384 # verbose = 2: information about each iteration is printed (longer than 1) +385 if func_args is None: +386 func_args = [] +387 +388 if ( +389 n_more_iter is None +390 ): # initial optimization, before more iters are requested 391 -392 if (verbose == 1) | (verbose == 2): -393 print(f"\n Creating initial design... \n") -394 -395 if verbose == 1: -396 progbar = Progbar(target=self.n_init) +392 n_iter = self.n_iter +393 # stopping iter for early stopping (default is total budget) +394 iter_stop = n_iter # potentially # got to check this +395 +396 # initial design ---------- 397 -398 self.parameters = self.x_init.tolist() -399 self.scores = [] +398 if (verbose == 1) | (verbose == 2): +399 print(f"\n Creating initial design... \n") 400 -401 if self.save is not None: -402 self.update_shelve() +401 if verbose == 1: +402 progbar = Progbar(target=self.n_init) 403 -404 if self.y_init is None: # calculate scores on initial design -405 -406 assert ( -407 self.objective_func is not None -408 ), "self.y_init is None: must have 'objective_func' not None" +404 self.parameters = self.x_init.tolist() +405 self.scores = [] +406 +407 if self.save is not None: +408 self.update_shelve() 409 -410 if self.n_jobs == 1: +410 if self.y_init is None: # calculate scores on initial design 411 -412 for i in range(self.n_init): -413 -414 x_next = self.x_init[i, :] +412 assert ( +413 self.objective_func is not None +414 ), "self.y_init is None: must have 'objective_func' not None" 415 -416 try: +416 if self.n_jobs == 1: 417 -418 if self.per_second is True: +418 for i in range(self.n_init): 419 -420 start = time() -421 score = self.objective_func(x_next, *func_args) -422 if (np.isfinite(score) == False) or ( -423 np.isnan(score) == True -424 ): -425 continue -426 self.timings.append(np.log(time() - start)) -427 -428 else: # self.per_second is False -429 -430 score = self.objective_func(x_next, *func_args) -431 if (np.isfinite(score) == False) or ( -432 np.isnan(score) == True -433 ): -434 continue +420 x_next = self.x_init[i, :] +421 +422 try: +423 +424 if self.per_second is True: +425 +426 start = time() +427 score = self.objective_func(x_next, *func_args) +428 if (np.isfinite(score) == False) or ( +429 np.isnan(score) == True +430 ): +431 continue +432 self.timings.append(np.log(time() - start)) +433 +434 else: # self.per_second is False 435 -436 self.scores.append(score) -437 -438 if self.save is not None: -439 self.update_shelve() -440 -441 except: -442 -443 continue -444 -445 if verbose == 1: -446 progbar.update(i) # update progress bar -447 -448 if verbose == 2: -449 print(f"point: {x_next}; score: {score}") -450 # end loop # calculate scores on initial design -451 -452 if verbose == 1: -453 progbar.update(self.n_init) -454 -455 else: # self.n_jobs != 1 -456 -457 assert ( -458 self.per_second is False -459 ), "timings not calculated here" +436 score = self.objective_func(x_next, *func_args) +437 if (np.isfinite(score) == False) or ( +438 np.isnan(score) == True +439 ): +440 continue +441 +442 self.scores.append(score) +443 +444 if self.save is not None: +445 self.update_shelve() +446 +447 except: +448 +449 continue +450 +451 if verbose == 1: +452 progbar.update(i) # update progress bar +453 +454 if verbose == 2: +455 print(f"point: {x_next}; score: {score}") +456 # end loop # calculate scores on initial design +457 +458 if verbose == 1: +459 progbar.update(self.n_init) 460 -461 scores = Parallel(n_jobs=self.n_jobs, prefer="threads")( -462 delayed(self.objective_func)(self.x_init[i, :]) -463 for i in range(self.n_init) -464 ) -465 -466 self.scores = scores -467 -468 if self.save is not None: -469 self.update_shelve() -470 -471 else: # if self.y_init is None: -472 -473 assert self.x_init.shape[0] == len( -474 self.y_init -475 ), "must have: self.x_init.shape[0] == len(self.y_init)" +461 else: # self.n_jobs != 1 +462 +463 assert ( +464 self.per_second is False +465 ), "timings not calculated here" +466 +467 scores = Parallel(n_jobs=self.n_jobs, prefer="threads")( +468 delayed(self.objective_func)(self.x_init[i, :]) +469 for i in range(self.n_init) +470 ) +471 +472 self.scores = scores +473 +474 if self.save is not None: +475 self.update_shelve() 476 -477 self.scores = pickle.loads( -478 pickle.dumps(self.y_init.tolist(), -1) -479 ) -480 -481 # current best score on initial design -482 min_index = (np.asarray(self.scores)).argmin() -483 self.y_min = self.scores[min_index] -484 self.x_min = self.x_init[min_index, :] -485 -486 # current gp mean and std on initial design -487 y_mean, y_std = self.gp_fit_predict( -488 np.asarray(self.parameters), -489 np.asarray(self.scores), -490 self.x_choices, -491 ) -492 self.y_mean = y_mean -493 self.y_std = np.maximum(2.220446049250313e-16, y_std) -494 -495 # saving after initial design computation -496 if self.save is not None: -497 self.update_shelve() -498 -499 else: # if n_more_iter is not None +477 else: # if self.y_init is None: +478 +479 assert self.x_init.shape[0] == len( +480 self.y_init +481 ), "must have: self.x_init.shape[0] == len(self.y_init)" +482 +483 self.scores = pickle.loads( +484 pickle.dumps(self.y_init.tolist(), -1) +485 ) +486 +487 # current best score on initial design +488 min_index = (np.asarray(self.scores)).argmin() +489 self.y_min = self.scores[min_index] +490 self.x_min = self.x_init[min_index, :] +491 +492 # current gp mean and std on initial design +493 y_mean, y_std = self.gp_fit_predict( +494 np.asarray(self.parameters), +495 np.asarray(self.scores), +496 self.x_choices, +497 ) +498 self.y_mean = y_mean +499 self.y_std = np.maximum(2.220446049250313e-16, y_std) 500 -501 assert self.n_iter > 5, "you must have n_iter > 5" -502 n_iter = n_more_iter -503 iter_stop = len(self.max_ei) + n_more_iter # potentially +501 # saving after initial design computation +502 if self.save is not None: +503 self.update_shelve() 504 -505 if (verbose == 1) | (verbose == 2): -506 print(f"\n ...Done. \n") -507 try: -508 print(np.hstack((self.x_init, self.y_init.reshape(-1, 1)))) -509 except: -510 pass -511 -512 # end init design ---------- -513 -514 # if n_more_iter is None: # initial optimization, before more iters are requested -515 -516 if (verbose == 1) | (verbose == 2): -517 print(f"\n Optimization loop... \n") -518 -519 # early stopping? -520 if abs_tol is not None: -521 assert ( -522 min_budget > 20 -523 ), "With 'abs_tol' provided, you must have 'min_budget' > 20" +505 else: # if n_more_iter is not None +506 +507 assert self.n_iter > 5, "you must have n_iter > 5" +508 n_iter = n_more_iter +509 iter_stop = len(self.max_ei) + n_more_iter # potentially +510 +511 if (verbose == 1) | (verbose == 2): +512 print(f"\n ...Done. \n") +513 try: +514 print(np.hstack((self.x_init, self.y_init.reshape(-1, 1)))) +515 except: +516 pass +517 +518 # end init design ---------- +519 +520 # if n_more_iter is None: # initial optimization, before more iters are requested +521 +522 if (verbose == 1) | (verbose == 2): +523 print(f"\n Optimization loop... \n") 524 -525 if verbose == 1: -526 progbar = Progbar(target=n_iter) -527 -528 # main loop ---------- -529 -530 for i in range(n_iter): -531 -532 # find next set of parameters (vector), maximizing ei -533 next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i) -534 -535 try: -536 -537 if self.per_second is True: -538 -539 start = time() +525 # early stopping? +526 if abs_tol is not None: +527 assert ( +528 min_budget > 20 +529 ), "With 'abs_tol' provided, you must have 'min_budget' > 20" +530 +531 if verbose == 1: +532 progbar = Progbar(target=n_iter) +533 +534 # main loop ---------- +535 +536 for i in range(n_iter): +537 +538 # find next set of parameters (vector), maximizing ei +539 next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i) 540 -541 if self.objective_func is not None: +541 try: 542 -543 score_next_param = self.objective_func( -544 next_param, *func_args -545 ) +543 if self.per_second is True: +544 +545 start = time() 546 -547 if (np.isfinite(score_next_param) == False) or ( -548 np.isnan(score_next_param) == True -549 ): -550 continue -551 -552 else: -553 -554 assert (self.x_init is not None) and ( -555 self.y_init is not None -556 ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)" +547 if self.objective_func is not None: +548 +549 score_next_param = self.objective_func( +550 next_param, *func_args +551 ) +552 +553 if (np.isfinite(score_next_param) == False) or ( +554 np.isnan(score_next_param) == True +555 ): +556 continue 557 -558 print(f"\n next param: {next_param} \n") -559 score_next_param = float( -560 input("get new score: \n") -561 ) # or an API response -562 -563 if (np.isfinite(score_next_param) == False) or ( -564 np.isnan(score_next_param) == True -565 ): -566 continue -567 -568 self.timings.append(np.log(time() - start)) -569 -570 else: # self.per_second is False: -571 -572 if self.objective_func is not None: +558 else: +559 +560 assert (self.x_init is not None) and ( +561 self.y_init is not None +562 ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)" +563 +564 print(f"\n next param: {next_param} \n") +565 score_next_param = float( +566 input("get new score: \n") +567 ) # or an API response +568 +569 if (np.isfinite(score_next_param) == False) or ( +570 np.isnan(score_next_param) == True +571 ): +572 continue 573 -574 score_next_param = self.objective_func( -575 next_param, *func_args -576 ) +574 self.timings.append(np.log(time() - start)) +575 +576 else: # self.per_second is False: 577 -578 if (np.isfinite(score_next_param) == False) or ( -579 np.isnan(score_next_param) == True -580 ): -581 continue -582 -583 else: -584 -585 assert (self.x_init is not None) and ( -586 self.y_init is not None -587 ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)" +578 if self.objective_func is not None: +579 +580 score_next_param = self.objective_func( +581 next_param, *func_args +582 ) +583 +584 if (np.isfinite(score_next_param) == False) or ( +585 np.isnan(score_next_param) == True +586 ): +587 continue 588 -589 print(f"\n next param: {next_param} \n") -590 score_next_param = float( -591 input("get new score: \n") -592 ) # or an API response -593 -594 if (np.isfinite(score_next_param) == False) or ( -595 np.isnan(score_next_param) == True -596 ): -597 continue -598 -599 except: -600 -601 continue -602 -603 self.parameters.append(next_param.tolist()) +589 else: +590 +591 assert (self.x_init is not None) and ( +592 self.y_init is not None +593 ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)" +594 +595 print(f"\n next param: {next_param} \n") +596 score_next_param = float( +597 input("get new score: \n") +598 ) # or an API response +599 +600 if (np.isfinite(score_next_param) == False) or ( +601 np.isnan(score_next_param) == True +602 ): +603 continue 604 -605 self.scores.append(score_next_param) +605 except: 606 -607 if self.save is not None: -608 self.update_shelve() -609 -610 if verbose == 2: -611 print(f"iteration {i + 1} -----") -612 print(f"current minimum: {self.x_min}") -613 print(f"current minimum score: {self.y_min}") -614 print(f"next parameter: {next_param}") -615 print(f"score for next parameter: {score_next_param} \n") -616 -617 if score_next_param < self.y_min: -618 self.x_min = next_param -619 self.y_min = score_next_param -620 if self.save is not None: -621 self.update_shelve() +607 continue +608 +609 self.parameters.append(next_param.tolist()) +610 +611 self.scores.append(score_next_param) +612 +613 if self.save is not None: +614 self.update_shelve() +615 +616 if verbose == 2: +617 print(f"iteration {i + 1} -----") +618 print(f"current minimum: {self.x_min}") +619 print(f"current minimum score: {self.y_min}") +620 print(f"next parameter: {next_param}") +621 print(f"score for next parameter: {score_next_param} \n") 622 -623 self.y_mean, self.y_std = self.gp_fit_predict( -624 np.asarray(self.parameters), -625 np.asarray(self.scores), -626 self.x_choices, -627 ) +623 if score_next_param < self.y_min: +624 self.x_min = next_param +625 self.y_min = score_next_param +626 if self.save is not None: +627 self.update_shelve() 628 -629 if self.save is not None: -630 self.update_shelve() -631 -632 if verbose == 1: -633 progbar.update(i + 1) # update progress bar +629 self.y_mean, self.y_std = self.gp_fit_predict( +630 np.asarray(self.parameters), +631 np.asarray(self.scores), +632 self.x_choices, +633 ) 634 -635 # early stopping -636 -637 if abs_tol is not None: -638 -639 # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct): -640 if len(self.max_ei) > min_budget: -641 -642 diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei))) -643 -644 if diff_max_ei[-1] <= abs_tol: -645 -646 iter_stop = len(self.max_ei) # index i starts at 0 +635 if self.save is not None: +636 self.update_shelve() +637 +638 if verbose == 1: +639 progbar.update(i + 1) # update progress bar +640 +641 # early stopping +642 +643 if abs_tol is not None: +644 +645 # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct): +646 if len(self.max_ei) > min_budget: 647 -648 break +648 diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei))) 649 -650 # end main loop ---------- +650 if diff_max_ei[-1] <= abs_tol: 651 -652 if (verbose == 1) & (i < (n_iter - 1)): -653 progbar.update(n_iter) -654 -655 self.n_iter = iter_stop -656 if self.save is not None: -657 self.update_shelve() -658 -659 return (self.x_min, self.y_min) +652 iter_stop = len(self.max_ei) # index i starts at 0 +653 +654 break +655 +656 # end main loop ---------- +657 +658 if (verbose == 1) & (i < (n_iter - 1)): +659 progbar.update(n_iter) +660 +661 self.n_iter = iter_stop +662 if self.save is not None: +663 self.update_shelve() +664 +665 DescribeResult = namedtuple( +666 "DescribeResult", ("best_params", "best_score") +667 ) +668 +669 if self.params_names is None: +670 +671 return DescribeResult(self.x_min, self.y_min) +672 +673 else: +674 +675 return DescribeResult( +676 dict(zip(self.params_names, self.x_min)), self.y_min +677 )

    @@ -826,646 +847,663 @@

    -
     21class GPOpt:
    - 22    """Class GPOpt.
    - 23
    - 24    # Arguments:
    - 25
    - 26        lower_bound: a numpy array;
    - 27            lower bound for researched minimum
    - 28
    - 29        upper_bound: a numpy array;
    - 30            upper bound for researched minimum
    - 31
    - 32        objective_func: a function;
    - 33            the objective function to be minimized
    - 34
    - 35        gp_obj: a GaussianProcessRegressor object;
    - 36            An ML model for estimating the uncertainty around the objective function        
    - 37
    - 38        x_init:
    - 39            initial setting of points where `objective_func` is evaluated (optional)
    - 40
    - 41        y_init:
    - 42            initial setting values at points where `objective_func` is evaluated (optional)
    - 43
    - 44        n_init: an integer;
    - 45            number of points in the initial setting, when `x_init` and `y_init` are not provided
    - 46
    - 47        n_choices: an integer;
    - 48            number of points for the calculation of expected improvement
    - 49
    - 50        n_iter: an integer;
    - 51            number of iterations of the minimization algorithm
    - 52
    - 53        alpha: a float;
    - 54            Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)
    - 55
    - 56        n_restarts_optimizer: an integer;
    - 57            The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood.
    - 58
    - 59        seed: an integer;
    - 60            reproducibility seed
    - 61
    - 62        save: a string;
    - 63            Specifies where to save the optimizer in its current state
    - 64
    - 65        n_jobs: an integer;
    - 66            number of jobs for parallel computing on initial setting (can be -1)
    - 67
    - 68        per_second: a boolean;
    - 69            __experimental__, default is False (leave to default for now)
    - 70
    - 71        log_scale: a boolean;
    - 72            __experimental__, default is False (leave to default for now)
    - 73
    - 74    see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    - 75        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    - 76
    - 77    """
    - 78
    - 79    def __init__(
    - 80        self,        
    - 81        lower_bound,
    - 82        upper_bound,
    - 83        objective_func=None,
    - 84        gp_obj=None,
    - 85        x_init=None,
    - 86        y_init=None,
    - 87        n_init=10,
    - 88        n_choices=25000,
    - 89        n_iter=190,
    - 90        alpha=1e-6,
    - 91        n_restarts_optimizer=25,
    - 92        seed=123,
    - 93        save=None,
    - 94        n_jobs=1,
    - 95        per_second=False,  # /!\ very experimental
    - 96        log_scale=False,  # /!\ experimental
    - 97    ):
    - 98
    - 99        n_dims = len(lower_bound)
    -100
    -101        assert n_dims == len(
    -102            upper_bound
    -103        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    -104
    -105        self.objective_func = objective_func
    -106        self.lower_bound = lower_bound
    -107        self.upper_bound = upper_bound
    -108        self.y_init = y_init
    -109        self.log_scale = log_scale
    -110        self.n_dims = n_dims
    -111        self.n_init = n_init
    -112        self.n_choices = n_choices
    -113        self.n_iter = n_iter
    -114        self.alpha = alpha
    -115        self.n_restarts_optimizer = n_restarts_optimizer
    -116        self.seed = seed
    -117        self.save = save
    -118        self.per_second = per_second
    -119        self.x_min = None
    -120        self.y_min = None
    -121        self.y_mean = None
    -122        self.y_std = None
    -123        self.ei = np.array([])
    -124        self.max_ei = []
    -125        if gp_obj is None:
    -126            self.gp_obj = GaussianProcessRegressor(
    -127                kernel=Matern(nu=2.5),
    -128                alpha=self.alpha,
    -129                normalize_y=True,
    -130                n_restarts_optimizer=self.n_restarts_optimizer,
    -131                random_state=self.seed,
    -132            )
    -133        else:
    -134            self.gp_obj = gp_obj
    -135
    -136        # Sobol seqs for initial design and choices
    -137        sobol_seq_init = np.transpose(
    -138            generate_sobol2(
    -139                n_dims=self.n_dims,
    -140                n_points=self.n_init,
    -141                skip=2,
    -142            )
    -143        )
    -144        sobol_seq_choices = np.transpose(
    -145            generate_sobol2(
    -146                n_dims=self.n_dims,
    -147                n_points=self.n_choices,
    -148                skip=self.n_init + 2,
    -149            )
    -150        )
    -151
    -152        # Sobol seqs for initial design and choices with bounds
    -153        if self.log_scale == False:
    -154
    -155            bounds_range = upper_bound - lower_bound
    -156            self.x_init = (
    -157                bounds_range * sobol_seq_init + lower_bound
    -158                if x_init is None
    -159                else x_init
    -160            )
    -161            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    -162
    -163        else:  # (!) experimental
    -164
    -165            assert (
    -166                lower_bound > 0
    -167            ).all(), "all elements of `lower_bound` must be > 0"
    -168            assert (
    -169                upper_bound > 0
    -170            ).all(), "all elements of `upper_bound` must be > 0"
    -171
    -172            log_lower_bound = np.log(lower_bound)
    -173            log_upper_bound = np.log(upper_bound)
    -174            log_bounds_range = log_upper_bound - log_lower_bound
    -175            self.x_init = (
    -176                np.minimum(
    -177                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    -178                    1.7976931348623157e308,
    -179                )
    -180                if x_init is None
    -181                else x_init
    -182            )
    -183            self.x_choices = np.minimum(
    -184                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    -185                1.7976931348623157e308,
    -186            )
    -187
    -188        # shelve for saving (not for loading)
    -189        if self.save is not None:
    -190            self.sh = shelve.open(filename=save, flag="c", writeback=True)
    -191
    -192        if self.per_second:
    -193            self.timings = []
    -194            self.rf_obj = RandomForestRegressor(
    -195                n_estimators=250, random_state=self.seed
    -196            )
    +            
     22class GPOpt:
    + 23    """Class GPOpt.
    + 24
    + 25    # Arguments:
    + 26
    + 27        lower_bound: a numpy array;
    + 28            lower bound for researched minimum
    + 29
    + 30        upper_bound: a numpy array;
    + 31            upper bound for researched minimum
    + 32
    + 33        objective_func: a function;
    + 34            the objective function to be minimized
    + 35        
    + 36        params_names: a list;
    + 37            names of the parameters of the objective function (optional)
    + 38
    + 39        gp_obj: a GaussianProcessRegressor object;
    + 40            An ML model for estimating the uncertainty around the objective function        
    + 41
    + 42        x_init:
    + 43            initial setting of points where `objective_func` is evaluated (optional)
    + 44
    + 45        y_init:
    + 46            initial setting values at points where `objective_func` is evaluated (optional)
    + 47
    + 48        n_init: an integer;
    + 49            number of points in the initial setting, when `x_init` and `y_init` are not provided
    + 50
    + 51        n_choices: an integer;
    + 52            number of points for the calculation of expected improvement
    + 53
    + 54        n_iter: an integer;
    + 55            number of iterations of the minimization algorithm
    + 56
    + 57        alpha: a float;
    + 58            Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)
    + 59
    + 60        n_restarts_optimizer: an integer;
    + 61            The number of restarts of the optimizer for finding the kernel’s parameters which maximize the log-marginal likelihood.
    + 62
    + 63        seed: an integer;
    + 64            reproducibility seed
    + 65
    + 66        save: a string;
    + 67            Specifies where to save the optimizer in its current state
    + 68
    + 69        n_jobs: an integer;
    + 70            number of jobs for parallel computing on initial setting (can be -1)
    + 71
    + 72        per_second: a boolean;
    + 73            __experimental__, default is False (leave to default for now)
    + 74
    + 75        log_scale: a boolean;
    + 76            __experimental__, default is False (leave to default for now)
    + 77
    + 78    see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    + 79        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    + 80
    + 81    """
    + 82
    + 83    def __init__(
    + 84        self,        
    + 85        lower_bound,
    + 86        upper_bound,
    + 87        objective_func=None,
    + 88        params_names=None,
    + 89        gp_obj=None,
    + 90        x_init=None,
    + 91        y_init=None,
    + 92        n_init=10,
    + 93        n_choices=25000,
    + 94        n_iter=190,
    + 95        alpha=1e-6,
    + 96        n_restarts_optimizer=25,
    + 97        seed=123,
    + 98        save=None,
    + 99        n_jobs=1,
    +100        per_second=False,  # /!\ very experimental
    +101        log_scale=False,  # /!\ experimental
    +102    ):
    +103
    +104        n_dims = len(lower_bound)
    +105
    +106        assert n_dims == len(
    +107            upper_bound
    +108        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    +109
    +110        self.objective_func = objective_func
    +111        self.params_names = params_names
    +112        self.lower_bound = lower_bound
    +113        self.upper_bound = upper_bound
    +114        self.y_init = y_init
    +115        self.log_scale = log_scale
    +116        self.n_dims = n_dims
    +117        self.n_init = n_init
    +118        self.n_choices = n_choices
    +119        self.n_iter = n_iter
    +120        self.alpha = alpha
    +121        self.n_restarts_optimizer = n_restarts_optimizer
    +122        self.seed = seed
    +123        self.save = save
    +124        self.per_second = per_second
    +125        self.x_min = None
    +126        self.y_min = None
    +127        self.y_mean = None
    +128        self.y_std = None
    +129        self.ei = np.array([])
    +130        self.max_ei = []
    +131        if gp_obj is None:
    +132            self.gp_obj = GaussianProcessRegressor(
    +133                kernel=Matern(nu=2.5),
    +134                alpha=self.alpha,
    +135                normalize_y=True,
    +136                n_restarts_optimizer=self.n_restarts_optimizer,
    +137                random_state=self.seed,
    +138            )
    +139        else:
    +140            self.gp_obj = gp_obj
    +141
    +142        # Sobol seqs for initial design and choices
    +143        sobol_seq_init = np.transpose(
    +144            generate_sobol2(
    +145                n_dims=self.n_dims,
    +146                n_points=self.n_init,
    +147                skip=2,
    +148            )
    +149        )
    +150        sobol_seq_choices = np.transpose(
    +151            generate_sobol2(
    +152                n_dims=self.n_dims,
    +153                n_points=self.n_choices,
    +154                skip=self.n_init + 2,
    +155            )
    +156        )
    +157
    +158        # Sobol seqs for initial design and choices with bounds
    +159        if self.log_scale == False:
    +160
    +161            bounds_range = upper_bound - lower_bound
    +162            self.x_init = (
    +163                bounds_range * sobol_seq_init + lower_bound
    +164                if x_init is None
    +165                else x_init
    +166            )
    +167            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    +168
    +169        else:  # (!) experimental
    +170
    +171            assert (
    +172                lower_bound > 0
    +173            ).all(), "all elements of `lower_bound` must be > 0"
    +174            assert (
    +175                upper_bound > 0
    +176            ).all(), "all elements of `upper_bound` must be > 0"
    +177
    +178            log_lower_bound = np.log(lower_bound)
    +179            log_upper_bound = np.log(upper_bound)
    +180            log_bounds_range = log_upper_bound - log_lower_bound
    +181            self.x_init = (
    +182                np.minimum(
    +183                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    +184                    1.7976931348623157e308,
    +185                )
    +186                if x_init is None
    +187                else x_init
    +188            )
    +189            self.x_choices = np.minimum(
    +190                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    +191                1.7976931348623157e308,
    +192            )
    +193
    +194        # shelve for saving (not for loading)
    +195        if self.save is not None:
    +196            self.sh = shelve.open(filename=save, flag="c", writeback=True)
     197
    -198        self.n_jobs = n_jobs
    -199
    -200    # from sklearn.base
    -201    def get_params(self):
    -202        """Get object attributes.
    +198        if self.per_second:
    +199            self.timings = []
    +200            self.rf_obj = RandomForestRegressor(
    +201                n_estimators=250, random_state=self.seed
    +202            )
     203
    -204        Returns
    -205        -------
    -206        params : mapping of string to any
    -207            Parameter names mapped to their values.
    -208        """
    -209        out = dict()
    -210        param_names = dir(self)
    -211        for key in param_names:
    -212            if key.startswith("_") is False:
    -213                out[key] = getattr(self, key, None)
    -214
    -215        return out
    -216
    -217    # for parallel case on initial design
    -218    def eval_objective(self, arg):
    -219        try:
    -220            return self.objective_func(self.x_init[arg, :])
    -221        except:
    -222            return 1e06
    -223
    -224    # load data from stored shelve
    -225    def load(self, path):
    -226        """load data from stored shelve.
    -227
    -228        # Arguments
    +204        self.n_jobs = n_jobs
    +205
    +206    # from sklearn.base
    +207    def get_params(self):
    +208        """Get object attributes.
    +209
    +210        Returns
    +211        -------
    +212        params : mapping of string to any
    +213            Parameter names mapped to their values.
    +214        """
    +215        out = dict()
    +216        param_names = dir(self)
    +217        for key in param_names:
    +218            if key.startswith("_") is False:
    +219                out[key] = getattr(self, key, None)
    +220
    +221        return out
    +222
    +223    # for parallel case on initial design
    +224    def eval_objective(self, arg):
    +225        try:
    +226            return self.objective_func(self.x_init[arg, :])
    +227        except:
    +228            return 1e06
     229
    -230        path : a string; path to stored shelve.
    -231
    -232        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -233        """
    -234
    -235        self.sh = shelve.open(filename=path)
    -236        for key, value in self.sh.items():
    -237            setattr(self, key, value)
    -238
    -239    # update shelve in optimization loop
    -240    def update_shelve(self):
    -241        for key, value in self.get_params().items():
    -242            if (callable(value) is False) & (key != "sh"):
    -243                self.sh[key] = value
    -244        self.sh.sync()
    -245
    -246    # closing shelve (can't be modified after)
    -247    def close_shelve(self):
    -248        """Close shelve.
    -249
    -250        # Arguments
    +230    # load data from stored shelve
    +231    def load(self, path):
    +232        """load data from stored shelve.
    +233
    +234        # Arguments
    +235
    +236        path : a string; path to stored shelve.
    +237
    +238        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +239        """
    +240
    +241        self.sh = shelve.open(filename=path)
    +242        for key, value in self.sh.items():
    +243            setattr(self, key, value)
    +244
    +245    # update shelve in optimization loop
    +246    def update_shelve(self):
    +247        for key, value in self.get_params().items():
    +248            if (callable(value) is False) & (key != "sh"):
    +249                self.sh[key] = value
    +250        self.sh.sync()
     251
    -252        No argument.
    -253
    -254        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -255        """
    -256
    -257        self.sh.close()
    -258
    -259    # fit predict
    -260    def gp_fit_predict(self, X_train, y_train, X_test):
    -261
    -262        if len(X_train.shape) == 1:
    -263            X_train = X_train.reshape((-1, 1))
    -264            X_test = X_test.reshape((-1, 1))
    -265
    -266        # Get mean and standard deviation
    -267        return self.gp_obj.fit(X_train, y_train).predict(
    -268            X_test, return_std=True
    -269        )
    -270
    -271    # fit predict timings
    -272    def timings_fit_predict(self, X_train, y_train, X_test):
    -273
    -274        if len(X_train.shape) == 1:
    -275            X_train = X_train.reshape((-1, 1))
    -276            X_test = X_test.reshape((-1, 1))
    -277
    -278        # Get mean preds for timings
    -279        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    -280
    -281    # find next parameter by using expected improvement (ei)
    -282    def next_parameter_by_ei(self, seed, i):
    +252    # closing shelve (can't be modified after)
    +253    def close_shelve(self):
    +254        """Close shelve.
    +255
    +256        # Arguments
    +257
    +258        No argument.
    +259
    +260        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +261        """
    +262
    +263        self.sh.close()
    +264
    +265    # fit predict
    +266    def gp_fit_predict(self, X_train, y_train, X_test):
    +267
    +268        if len(X_train.shape) == 1:
    +269            X_train = X_train.reshape((-1, 1))
    +270            X_test = X_test.reshape((-1, 1))
    +271
    +272        # Get mean and standard deviation
    +273        return self.gp_obj.fit(X_train, y_train).predict(
    +274            X_test, return_std=True
    +275        )
    +276
    +277    # fit predict timings
    +278    def timings_fit_predict(self, X_train, y_train, X_test):
    +279
    +280        if len(X_train.shape) == 1:
    +281            X_train = X_train.reshape((-1, 1))
    +282            X_test = X_test.reshape((-1, 1))
     283
    -284        gamma_hat = (self.y_min - self.y_mean) / self.y_std
    -285
    -286        self.ei = -self.y_std * (
    -287            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    -288        )
    +284        # Get mean preds for timings
    +285        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    +286
    +287    # find next parameter by using expected improvement (ei)
    +288    def next_parameter_by_ei(self, seed, i):
     289
    -290        # find max index -----
    +290        gamma_hat = (self.y_min - self.y_mean) / self.y_std
     291
    -292        if self.per_second is False:
    -293
    -294            # find index for max. ei
    -295            max_index = self.ei.argmin()
    -296
    -297        else:  # self.per_second is True
    -298
    -299            # predict timings on self.x_choices
    -300            # train on X = self.parameters and y = self.timings
    -301            # (must have same shape[0])
    -302            timing_preds = self.timings_fit_predict(
    -303                X_train=np.asarray(self.parameters),
    -304                y_train=np.asarray(self.timings),
    -305                X_test=self.x_choices,
    -306            )
    -307
    -308            # find index for max. ei (and min. timings)
    -309            max_index = (-self.ei / timing_preds).argmax()
    -310
    -311        self.max_ei.append(np.abs(self.ei[max_index]))
    -312
    -313        # Select next choice
    -314        next_param = self.x_choices[max_index, :]
    -315
    -316        if next_param in np.asarray(self.parameters):
    -317
    -318            if self.log_scale == False:
    -319
    -320                np.random.seed(self.seed * i + 1000)
    -321                next_param = (
    -322                    self.upper_bound - self.lower_bound
    -323                ) * np.random.rand(self.n_dims) + self.lower_bound
    -324
    -325            else:  # /!\ very... experimental
    -326
    -327                np.random.seed(self.seed)
    -328                log_upper_bound = np.log(self.upper_bound)
    -329                log_lower_bound = np.log(self.lower_bound)
    -330                log_bounds_range = log_upper_bound - log_lower_bound
    -331
    -332                next_param = np.minimum(
    -333                    np.exp(
    -334                        log_bounds_range * np.random.rand(self.n_dims)
    -335                        + log_lower_bound
    -336                    ),
    -337                    1.7976931348623157e308,
    -338                )
    -339
    -340        return next_param
    -341
    -342    # optimize the objective
    -343    def optimize(
    -344        self,
    -345        verbose=1,
    -346        n_more_iter=None,
    -347        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    -348        min_budget=50,  # minimum budget for early stopping
    -349        func_args=None,
    -350    ):
    -351        """Launch optimization loop.
    -352
    -353        # Arguments:
    -354
    -355            verbose: an integer;
    -356                verbose = 0: nothing is printed,
    -357                verbose = 1: a progress bar is printed (longer than 0),
    -358                verbose = 2: information about each iteration is printed (longer than 1)
    -359
    -360            n_more_iter: an integer;
    -361                additional number of iterations for the optimizer (which has been run once)
    -362
    -363            abs_tol: a float;
    -364                tolerance for convergence of the optimizer (early stopping based on expected improvement)
    +292        self.ei = -self.y_std * (
    +293            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    +294        )
    +295
    +296        # find max index -----
    +297
    +298        if self.per_second is False:
    +299
    +300            # find index for max. ei
    +301            max_index = self.ei.argmin()
    +302
    +303        else:  # self.per_second is True
    +304
    +305            # predict timings on self.x_choices
    +306            # train on X = self.parameters and y = self.timings
    +307            # (must have same shape[0])
    +308            timing_preds = self.timings_fit_predict(
    +309                X_train=np.asarray(self.parameters),
    +310                y_train=np.asarray(self.timings),
    +311                X_test=self.x_choices,
    +312            )
    +313
    +314            # find index for max. ei (and min. timings)
    +315            max_index = (-self.ei / timing_preds).argmax()
    +316
    +317        self.max_ei.append(np.abs(self.ei[max_index]))
    +318
    +319        # Select next choice
    +320        next_param = self.x_choices[max_index, :]
    +321
    +322        if next_param in np.asarray(self.parameters):
    +323
    +324            if self.log_scale == False:
    +325
    +326                np.random.seed(self.seed * i + 1000)
    +327                next_param = (
    +328                    self.upper_bound - self.lower_bound
    +329                ) * np.random.rand(self.n_dims) + self.lower_bound
    +330
    +331            else:  # /!\ very... experimental
    +332
    +333                np.random.seed(self.seed)
    +334                log_upper_bound = np.log(self.upper_bound)
    +335                log_lower_bound = np.log(self.lower_bound)
    +336                log_bounds_range = log_upper_bound - log_lower_bound
    +337
    +338                next_param = np.minimum(
    +339                    np.exp(
    +340                        log_bounds_range * np.random.rand(self.n_dims)
    +341                        + log_lower_bound
    +342                    ),
    +343                    1.7976931348623157e308,
    +344                )
    +345
    +346        return next_param
    +347
    +348    # optimize the objective
    +349    def optimize(
    +350        self,
    +351        verbose=1,
    +352        n_more_iter=None,
    +353        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    +354        min_budget=50,  # minimum budget for early stopping
    +355        func_args=None,
    +356    ):
    +357        """Launch optimization loop.
    +358
    +359        # Arguments:
    +360
    +361            verbose: an integer;
    +362                verbose = 0: nothing is printed,
    +363                verbose = 1: a progress bar is printed (longer than 0),
    +364                verbose = 2: information about each iteration is printed (longer than 1)
     365
    -366            min_budget: an integer (default is 50);
    -367                minimum number of iterations before early stopping controlled by `abs_tol`
    +366            n_more_iter: an integer;
    +367                additional number of iterations for the optimizer (which has been run once)
     368
    -369            func_args: a list;
    -370                additional parameters for the objective function (if necessary)
    +369            abs_tol: a float;
    +370                tolerance for convergence of the optimizer (early stopping based on expected improvement)
     371
    -372        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    -373        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +372            min_budget: an integer (default is 50);
    +373                minimum number of iterations before early stopping controlled by `abs_tol`
     374
    -375        """
    -376
    -377        # verbose = 0: nothing is printed
    -378        # verbose = 1: a progress bar is printed (longer than 0)
    -379        # verbose = 2: information about each iteration is printed (longer than 1)
    -380        if func_args is None:
    -381            func_args = []
    +375            func_args: a list;
    +376                additional parameters for the objective function (if necessary)
    +377
    +378        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    +379        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +380
    +381        """
     382
    -383        if (
    -384            n_more_iter is None
    -385        ):  # initial optimization, before more iters are requested
    -386
    -387            n_iter = self.n_iter
    -388            # stopping iter for early stopping (default is total budget)
    -389            iter_stop = n_iter  # potentially # got to check this
    -390
    -391            # initial design  ----------
    +383        # verbose = 0: nothing is printed
    +384        # verbose = 1: a progress bar is printed (longer than 0)
    +385        # verbose = 2: information about each iteration is printed (longer than 1)
    +386        if func_args is None:
    +387            func_args = []
    +388
    +389        if (
    +390            n_more_iter is None
    +391        ):  # initial optimization, before more iters are requested
     392
    -393            if (verbose == 1) | (verbose == 2):
    -394                print(f"\n Creating initial design... \n")
    -395
    -396            if verbose == 1:
    -397                progbar = Progbar(target=self.n_init)
    +393            n_iter = self.n_iter
    +394            # stopping iter for early stopping (default is total budget)
    +395            iter_stop = n_iter  # potentially # got to check this
    +396
    +397            # initial design  ----------
     398
    -399            self.parameters = self.x_init.tolist()
    -400            self.scores = []
    +399            if (verbose == 1) | (verbose == 2):
    +400                print(f"\n Creating initial design... \n")
     401
    -402            if self.save is not None:
    -403                self.update_shelve()
    +402            if verbose == 1:
    +403                progbar = Progbar(target=self.n_init)
     404
    -405            if self.y_init is None:  # calculate scores on initial design
    -406
    -407                assert (
    -408                    self.objective_func is not None
    -409                ), "self.y_init is None: must have 'objective_func' not None"
    +405            self.parameters = self.x_init.tolist()
    +406            self.scores = []
    +407
    +408            if self.save is not None:
    +409                self.update_shelve()
     410
    -411                if self.n_jobs == 1:
    +411            if self.y_init is None:  # calculate scores on initial design
     412
    -413                    for i in range(self.n_init):
    -414
    -415                        x_next = self.x_init[i, :]
    +413                assert (
    +414                    self.objective_func is not None
    +415                ), "self.y_init is None: must have 'objective_func' not None"
     416
    -417                        try:
    +417                if self.n_jobs == 1:
     418
    -419                            if self.per_second is True:
    +419                    for i in range(self.n_init):
     420
    -421                                start = time()
    -422                                score = self.objective_func(x_next, *func_args)
    -423                                if (np.isfinite(score) == False) or (
    -424                                    np.isnan(score) == True
    -425                                ):
    -426                                    continue
    -427                                self.timings.append(np.log(time() - start))
    -428
    -429                            else:  # self.per_second is False
    -430
    -431                                score = self.objective_func(x_next, *func_args)
    -432                                if (np.isfinite(score) == False) or (
    -433                                    np.isnan(score) == True
    -434                                ):
    -435                                    continue
    +421                        x_next = self.x_init[i, :]
    +422
    +423                        try:
    +424
    +425                            if self.per_second is True:
    +426
    +427                                start = time()
    +428                                score = self.objective_func(x_next, *func_args)
    +429                                if (np.isfinite(score) == False) or (
    +430                                    np.isnan(score) == True
    +431                                ):
    +432                                    continue
    +433                                self.timings.append(np.log(time() - start))
    +434
    +435                            else:  # self.per_second is False
     436
    -437                            self.scores.append(score)
    -438
    -439                            if self.save is not None:
    -440                                self.update_shelve()
    -441
    -442                        except:
    -443
    -444                            continue
    -445
    -446                        if verbose == 1:
    -447                            progbar.update(i)  # update progress bar
    -448
    -449                        if verbose == 2:
    -450                            print(f"point: {x_next}; score: {score}")
    -451                    # end loop # calculate scores on initial design
    -452
    -453                    if verbose == 1:
    -454                        progbar.update(self.n_init)
    -455
    -456                else:  # self.n_jobs != 1
    -457
    -458                    assert (
    -459                        self.per_second is False
    -460                    ), "timings not calculated here"
    +437                                score = self.objective_func(x_next, *func_args)
    +438                                if (np.isfinite(score) == False) or (
    +439                                    np.isnan(score) == True
    +440                                ):
    +441                                    continue
    +442
    +443                            self.scores.append(score)
    +444
    +445                            if self.save is not None:
    +446                                self.update_shelve()
    +447
    +448                        except:
    +449
    +450                            continue
    +451
    +452                        if verbose == 1:
    +453                            progbar.update(i)  # update progress bar
    +454
    +455                        if verbose == 2:
    +456                            print(f"point: {x_next}; score: {score}")
    +457                    # end loop # calculate scores on initial design
    +458
    +459                    if verbose == 1:
    +460                        progbar.update(self.n_init)
     461
    -462                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    -463                        delayed(self.objective_func)(self.x_init[i, :])
    -464                        for i in range(self.n_init)
    -465                    )
    -466
    -467                    self.scores = scores
    -468
    -469                    if self.save is not None:
    -470                        self.update_shelve()
    -471
    -472            else:  # if self.y_init is None:
    -473
    -474                assert self.x_init.shape[0] == len(
    -475                    self.y_init
    -476                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +462                else:  # self.n_jobs != 1
    +463
    +464                    assert (
    +465                        self.per_second is False
    +466                    ), "timings not calculated here"
    +467
    +468                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    +469                        delayed(self.objective_func)(self.x_init[i, :])
    +470                        for i in range(self.n_init)
    +471                    )
    +472
    +473                    self.scores = scores
    +474
    +475                    if self.save is not None:
    +476                        self.update_shelve()
     477
    -478                self.scores = pickle.loads(
    -479                    pickle.dumps(self.y_init.tolist(), -1)
    -480                )
    -481
    -482            # current best score on initial design
    -483            min_index = (np.asarray(self.scores)).argmin()
    -484            self.y_min = self.scores[min_index]
    -485            self.x_min = self.x_init[min_index, :]
    -486
    -487            # current gp mean and std on initial design
    -488            y_mean, y_std = self.gp_fit_predict(
    -489                np.asarray(self.parameters),
    -490                np.asarray(self.scores),
    -491                self.x_choices,
    -492            )
    -493            self.y_mean = y_mean
    -494            self.y_std = np.maximum(2.220446049250313e-16, y_std)
    -495
    -496            # saving after initial design computation
    -497            if self.save is not None:
    -498                self.update_shelve()
    -499
    -500        else:  # if n_more_iter is not None
    +478            else:  # if self.y_init is None:
    +479
    +480                assert self.x_init.shape[0] == len(
    +481                    self.y_init
    +482                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +483
    +484                self.scores = pickle.loads(
    +485                    pickle.dumps(self.y_init.tolist(), -1)
    +486                )
    +487
    +488            # current best score on initial design
    +489            min_index = (np.asarray(self.scores)).argmin()
    +490            self.y_min = self.scores[min_index]
    +491            self.x_min = self.x_init[min_index, :]
    +492
    +493            # current gp mean and std on initial design
    +494            y_mean, y_std = self.gp_fit_predict(
    +495                np.asarray(self.parameters),
    +496                np.asarray(self.scores),
    +497                self.x_choices,
    +498            )
    +499            self.y_mean = y_mean
    +500            self.y_std = np.maximum(2.220446049250313e-16, y_std)
     501
    -502            assert self.n_iter > 5, "you must have n_iter > 5"
    -503            n_iter = n_more_iter
    -504            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +502            # saving after initial design computation
    +503            if self.save is not None:
    +504                self.update_shelve()
     505
    -506        if (verbose == 1) | (verbose == 2):
    -507            print(f"\n ...Done. \n")
    -508            try:
    -509                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    -510            except:
    -511                pass
    -512
    -513        # end init design ----------
    -514
    -515        # if n_more_iter is None: # initial optimization, before more iters are requested
    -516
    -517        if (verbose == 1) | (verbose == 2):
    -518            print(f"\n Optimization loop... \n")
    -519
    -520        # early stopping?
    -521        if abs_tol is not None:
    -522            assert (
    -523                min_budget > 20
    -524            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +506        else:  # if n_more_iter is not None
    +507
    +508            assert self.n_iter > 5, "you must have n_iter > 5"
    +509            n_iter = n_more_iter
    +510            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +511
    +512        if (verbose == 1) | (verbose == 2):
    +513            print(f"\n ...Done. \n")
    +514            try:
    +515                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    +516            except:
    +517                pass
    +518
    +519        # end init design ----------
    +520
    +521        # if n_more_iter is None: # initial optimization, before more iters are requested
    +522
    +523        if (verbose == 1) | (verbose == 2):
    +524            print(f"\n Optimization loop... \n")
     525
    -526        if verbose == 1:
    -527            progbar = Progbar(target=n_iter)
    -528
    -529        # main loop ----------
    -530
    -531        for i in range(n_iter):
    -532
    -533            # find next set of parameters (vector), maximizing ei
    -534            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
    -535
    -536            try:
    -537
    -538                if self.per_second is True:
    -539
    -540                    start = time()
    +526        # early stopping?
    +527        if abs_tol is not None:
    +528            assert (
    +529                min_budget > 20
    +530            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +531
    +532        if verbose == 1:
    +533            progbar = Progbar(target=n_iter)
    +534
    +535        # main loop ----------
    +536
    +537        for i in range(n_iter):
    +538
    +539            # find next set of parameters (vector), maximizing ei
    +540            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
     541
    -542                    if self.objective_func is not None:
    +542            try:
     543
    -544                        score_next_param = self.objective_func(
    -545                            next_param, *func_args
    -546                        )
    +544                if self.per_second is True:
    +545
    +546                    start = time()
     547
    -548                        if (np.isfinite(score_next_param) == False) or (
    -549                            np.isnan(score_next_param) == True
    -550                        ):
    -551                            continue
    -552
    -553                    else:
    -554
    -555                        assert (self.x_init is not None) and (
    -556                            self.y_init is not None
    -557                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +548                    if self.objective_func is not None:
    +549
    +550                        score_next_param = self.objective_func(
    +551                            next_param, *func_args
    +552                        )
    +553
    +554                        if (np.isfinite(score_next_param) == False) or (
    +555                            np.isnan(score_next_param) == True
    +556                        ):
    +557                            continue
     558
    -559                        print(f"\n next param: {next_param} \n")
    -560                        score_next_param = float(
    -561                            input("get new score: \n")
    -562                        )  # or an API response
    -563
    -564                        if (np.isfinite(score_next_param) == False) or (
    -565                            np.isnan(score_next_param) == True
    -566                        ):
    -567                            continue
    -568
    -569                    self.timings.append(np.log(time() - start))
    -570
    -571                else:  # self.per_second is False:
    -572
    -573                    if self.objective_func is not None:
    +559                    else:
    +560
    +561                        assert (self.x_init is not None) and (
    +562                            self.y_init is not None
    +563                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +564
    +565                        print(f"\n next param: {next_param} \n")
    +566                        score_next_param = float(
    +567                            input("get new score: \n")
    +568                        )  # or an API response
    +569
    +570                        if (np.isfinite(score_next_param) == False) or (
    +571                            np.isnan(score_next_param) == True
    +572                        ):
    +573                            continue
     574
    -575                        score_next_param = self.objective_func(
    -576                            next_param, *func_args
    -577                        )
    +575                    self.timings.append(np.log(time() - start))
    +576
    +577                else:  # self.per_second is False:
     578
    -579                        if (np.isfinite(score_next_param) == False) or (
    -580                            np.isnan(score_next_param) == True
    -581                        ):
    -582                            continue
    -583
    -584                    else:
    -585
    -586                        assert (self.x_init is not None) and (
    -587                            self.y_init is not None
    -588                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +579                    if self.objective_func is not None:
    +580
    +581                        score_next_param = self.objective_func(
    +582                            next_param, *func_args
    +583                        )
    +584
    +585                        if (np.isfinite(score_next_param) == False) or (
    +586                            np.isnan(score_next_param) == True
    +587                        ):
    +588                            continue
     589
    -590                        print(f"\n next param: {next_param} \n")
    -591                        score_next_param = float(
    -592                            input("get new score: \n")
    -593                        )  # or an API response
    -594
    -595                        if (np.isfinite(score_next_param) == False) or (
    -596                            np.isnan(score_next_param) == True
    -597                        ):
    -598                            continue
    -599
    -600            except:
    -601
    -602                continue
    -603
    -604            self.parameters.append(next_param.tolist())
    +590                    else:
    +591
    +592                        assert (self.x_init is not None) and (
    +593                            self.y_init is not None
    +594                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +595
    +596                        print(f"\n next param: {next_param} \n")
    +597                        score_next_param = float(
    +598                            input("get new score: \n")
    +599                        )  # or an API response
    +600
    +601                        if (np.isfinite(score_next_param) == False) or (
    +602                            np.isnan(score_next_param) == True
    +603                        ):
    +604                            continue
     605
    -606            self.scores.append(score_next_param)
    +606            except:
     607
    -608            if self.save is not None:
    -609                self.update_shelve()
    -610
    -611            if verbose == 2:
    -612                print(f"iteration {i + 1} -----")
    -613                print(f"current minimum:  {self.x_min}")
    -614                print(f"current minimum score:  {self.y_min}")
    -615                print(f"next parameter: {next_param}")
    -616                print(f"score for next parameter: {score_next_param} \n")
    -617
    -618            if score_next_param < self.y_min:
    -619                self.x_min = next_param
    -620                self.y_min = score_next_param
    -621                if self.save is not None:
    -622                    self.update_shelve()
    +608                continue
    +609
    +610            self.parameters.append(next_param.tolist())
    +611
    +612            self.scores.append(score_next_param)
    +613
    +614            if self.save is not None:
    +615                self.update_shelve()
    +616
    +617            if verbose == 2:
    +618                print(f"iteration {i + 1} -----")
    +619                print(f"current minimum:  {self.x_min}")
    +620                print(f"current minimum score:  {self.y_min}")
    +621                print(f"next parameter: {next_param}")
    +622                print(f"score for next parameter: {score_next_param} \n")
     623
    -624            self.y_mean, self.y_std = self.gp_fit_predict(
    -625                np.asarray(self.parameters),
    -626                np.asarray(self.scores),
    -627                self.x_choices,
    -628            )
    +624            if score_next_param < self.y_min:
    +625                self.x_min = next_param
    +626                self.y_min = score_next_param
    +627                if self.save is not None:
    +628                    self.update_shelve()
     629
    -630            if self.save is not None:
    -631                self.update_shelve()
    -632
    -633            if verbose == 1:
    -634                progbar.update(i + 1)  # update progress bar
    +630            self.y_mean, self.y_std = self.gp_fit_predict(
    +631                np.asarray(self.parameters),
    +632                np.asarray(self.scores),
    +633                self.x_choices,
    +634            )
     635
    -636            # early stopping
    -637
    -638            if abs_tol is not None:
    -639
    -640                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    -641                if len(self.max_ei) > min_budget:
    -642
    -643                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
    -644
    -645                    if diff_max_ei[-1] <= abs_tol:
    -646
    -647                        iter_stop = len(self.max_ei)  # index i starts at 0
    +636            if self.save is not None:
    +637                self.update_shelve()
    +638
    +639            if verbose == 1:
    +640                progbar.update(i + 1)  # update progress bar
    +641
    +642            # early stopping
    +643
    +644            if abs_tol is not None:
    +645
    +646                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    +647                if len(self.max_ei) > min_budget:
     648
    -649                        break
    +649                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
     650
    -651        # end main loop ----------
    +651                    if diff_max_ei[-1] <= abs_tol:
     652
    -653        if (verbose == 1) & (i < (n_iter - 1)):
    -654            progbar.update(n_iter)
    -655
    -656        self.n_iter = iter_stop
    -657        if self.save is not None:
    -658            self.update_shelve()
    -659
    -660        return (self.x_min, self.y_min)
    +653                        iter_stop = len(self.max_ei)  # index i starts at 0
    +654
    +655                        break
    +656
    +657        # end main loop ----------
    +658
    +659        if (verbose == 1) & (i < (n_iter - 1)):
    +660            progbar.update(n_iter)
    +661
    +662        self.n_iter = iter_stop
    +663        if self.save is not None:
    +664            self.update_shelve()
    +665        
    +666        DescribeResult = namedtuple(
    +667                "DescribeResult", ("best_params", "best_score")
    +668            )
    +669
    +670        if self.params_names is None:
    +671
    +672            return DescribeResult(self.x_min, self.y_min)
    +673
    +674        else:
    +675
    +676            return DescribeResult(
    +677                dict(zip(self.params_names, self.x_min)), self.y_min
    +678            )
     
    @@ -1482,6 +1520,9 @@

    Arguments:

    objective_func: a function; the objective function to be minimized +params_names: a list; + names of the parameters of the objective function (optional) + gp_obj: a GaussianProcessRegressor object; An ML model for estimating the uncertainty around the objective function @@ -1531,132 +1572,134 @@

    Arguments:

    - GPOpt( lower_bound, upper_bound, objective_func=None, gp_obj=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False) + GPOpt( lower_bound, upper_bound, objective_func=None, params_names=None, gp_obj=None, x_init=None, y_init=None, n_init=10, n_choices=25000, n_iter=190, alpha=1e-06, n_restarts_optimizer=25, seed=123, save=None, n_jobs=1, per_second=False, log_scale=False)
    -
     79    def __init__(
    - 80        self,        
    - 81        lower_bound,
    - 82        upper_bound,
    - 83        objective_func=None,
    - 84        gp_obj=None,
    - 85        x_init=None,
    - 86        y_init=None,
    - 87        n_init=10,
    - 88        n_choices=25000,
    - 89        n_iter=190,
    - 90        alpha=1e-6,
    - 91        n_restarts_optimizer=25,
    - 92        seed=123,
    - 93        save=None,
    - 94        n_jobs=1,
    - 95        per_second=False,  # /!\ very experimental
    - 96        log_scale=False,  # /!\ experimental
    - 97    ):
    - 98
    - 99        n_dims = len(lower_bound)
    -100
    -101        assert n_dims == len(
    -102            upper_bound
    -103        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    -104
    -105        self.objective_func = objective_func
    -106        self.lower_bound = lower_bound
    -107        self.upper_bound = upper_bound
    -108        self.y_init = y_init
    -109        self.log_scale = log_scale
    -110        self.n_dims = n_dims
    -111        self.n_init = n_init
    -112        self.n_choices = n_choices
    -113        self.n_iter = n_iter
    -114        self.alpha = alpha
    -115        self.n_restarts_optimizer = n_restarts_optimizer
    -116        self.seed = seed
    -117        self.save = save
    -118        self.per_second = per_second
    -119        self.x_min = None
    -120        self.y_min = None
    -121        self.y_mean = None
    -122        self.y_std = None
    -123        self.ei = np.array([])
    -124        self.max_ei = []
    -125        if gp_obj is None:
    -126            self.gp_obj = GaussianProcessRegressor(
    -127                kernel=Matern(nu=2.5),
    -128                alpha=self.alpha,
    -129                normalize_y=True,
    -130                n_restarts_optimizer=self.n_restarts_optimizer,
    -131                random_state=self.seed,
    -132            )
    -133        else:
    -134            self.gp_obj = gp_obj
    -135
    -136        # Sobol seqs for initial design and choices
    -137        sobol_seq_init = np.transpose(
    -138            generate_sobol2(
    -139                n_dims=self.n_dims,
    -140                n_points=self.n_init,
    -141                skip=2,
    -142            )
    -143        )
    -144        sobol_seq_choices = np.transpose(
    -145            generate_sobol2(
    -146                n_dims=self.n_dims,
    -147                n_points=self.n_choices,
    -148                skip=self.n_init + 2,
    -149            )
    -150        )
    -151
    -152        # Sobol seqs for initial design and choices with bounds
    -153        if self.log_scale == False:
    -154
    -155            bounds_range = upper_bound - lower_bound
    -156            self.x_init = (
    -157                bounds_range * sobol_seq_init + lower_bound
    -158                if x_init is None
    -159                else x_init
    -160            )
    -161            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    -162
    -163        else:  # (!) experimental
    -164
    -165            assert (
    -166                lower_bound > 0
    -167            ).all(), "all elements of `lower_bound` must be > 0"
    -168            assert (
    -169                upper_bound > 0
    -170            ).all(), "all elements of `upper_bound` must be > 0"
    -171
    -172            log_lower_bound = np.log(lower_bound)
    -173            log_upper_bound = np.log(upper_bound)
    -174            log_bounds_range = log_upper_bound - log_lower_bound
    -175            self.x_init = (
    -176                np.minimum(
    -177                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    -178                    1.7976931348623157e308,
    -179                )
    -180                if x_init is None
    -181                else x_init
    -182            )
    -183            self.x_choices = np.minimum(
    -184                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    -185                1.7976931348623157e308,
    -186            )
    -187
    -188        # shelve for saving (not for loading)
    -189        if self.save is not None:
    -190            self.sh = shelve.open(filename=save, flag="c", writeback=True)
    -191
    -192        if self.per_second:
    -193            self.timings = []
    -194            self.rf_obj = RandomForestRegressor(
    -195                n_estimators=250, random_state=self.seed
    -196            )
    +            
     83    def __init__(
    + 84        self,        
    + 85        lower_bound,
    + 86        upper_bound,
    + 87        objective_func=None,
    + 88        params_names=None,
    + 89        gp_obj=None,
    + 90        x_init=None,
    + 91        y_init=None,
    + 92        n_init=10,
    + 93        n_choices=25000,
    + 94        n_iter=190,
    + 95        alpha=1e-6,
    + 96        n_restarts_optimizer=25,
    + 97        seed=123,
    + 98        save=None,
    + 99        n_jobs=1,
    +100        per_second=False,  # /!\ very experimental
    +101        log_scale=False,  # /!\ experimental
    +102    ):
    +103
    +104        n_dims = len(lower_bound)
    +105
    +106        assert n_dims == len(
    +107            upper_bound
    +108        ), "'upper_bound' and 'lower_bound' must have the same dimensions"
    +109
    +110        self.objective_func = objective_func
    +111        self.params_names = params_names
    +112        self.lower_bound = lower_bound
    +113        self.upper_bound = upper_bound
    +114        self.y_init = y_init
    +115        self.log_scale = log_scale
    +116        self.n_dims = n_dims
    +117        self.n_init = n_init
    +118        self.n_choices = n_choices
    +119        self.n_iter = n_iter
    +120        self.alpha = alpha
    +121        self.n_restarts_optimizer = n_restarts_optimizer
    +122        self.seed = seed
    +123        self.save = save
    +124        self.per_second = per_second
    +125        self.x_min = None
    +126        self.y_min = None
    +127        self.y_mean = None
    +128        self.y_std = None
    +129        self.ei = np.array([])
    +130        self.max_ei = []
    +131        if gp_obj is None:
    +132            self.gp_obj = GaussianProcessRegressor(
    +133                kernel=Matern(nu=2.5),
    +134                alpha=self.alpha,
    +135                normalize_y=True,
    +136                n_restarts_optimizer=self.n_restarts_optimizer,
    +137                random_state=self.seed,
    +138            )
    +139        else:
    +140            self.gp_obj = gp_obj
    +141
    +142        # Sobol seqs for initial design and choices
    +143        sobol_seq_init = np.transpose(
    +144            generate_sobol2(
    +145                n_dims=self.n_dims,
    +146                n_points=self.n_init,
    +147                skip=2,
    +148            )
    +149        )
    +150        sobol_seq_choices = np.transpose(
    +151            generate_sobol2(
    +152                n_dims=self.n_dims,
    +153                n_points=self.n_choices,
    +154                skip=self.n_init + 2,
    +155            )
    +156        )
    +157
    +158        # Sobol seqs for initial design and choices with bounds
    +159        if self.log_scale == False:
    +160
    +161            bounds_range = upper_bound - lower_bound
    +162            self.x_init = (
    +163                bounds_range * sobol_seq_init + lower_bound
    +164                if x_init is None
    +165                else x_init
    +166            )
    +167            self.x_choices = bounds_range * sobol_seq_choices + lower_bound
    +168
    +169        else:  # (!) experimental
    +170
    +171            assert (
    +172                lower_bound > 0
    +173            ).all(), "all elements of `lower_bound` must be > 0"
    +174            assert (
    +175                upper_bound > 0
    +176            ).all(), "all elements of `upper_bound` must be > 0"
    +177
    +178            log_lower_bound = np.log(lower_bound)
    +179            log_upper_bound = np.log(upper_bound)
    +180            log_bounds_range = log_upper_bound - log_lower_bound
    +181            self.x_init = (
    +182                np.minimum(
    +183                    np.exp(log_bounds_range * sobol_seq_init + log_lower_bound),
    +184                    1.7976931348623157e308,
    +185                )
    +186                if x_init is None
    +187                else x_init
    +188            )
    +189            self.x_choices = np.minimum(
    +190                np.exp(log_bounds_range * sobol_seq_choices + log_lower_bound),
    +191                1.7976931348623157e308,
    +192            )
    +193
    +194        # shelve for saving (not for loading)
    +195        if self.save is not None:
    +196            self.sh = shelve.open(filename=save, flag="c", writeback=True)
     197
    -198        self.n_jobs = n_jobs
    +198        if self.per_second:
    +199            self.timings = []
    +200            self.rf_obj = RandomForestRegressor(
    +201                n_estimators=250, random_state=self.seed
    +202            )
    +203
    +204        self.n_jobs = n_jobs
     
    @@ -1673,6 +1716,17 @@

    Arguments:

    +
    +
    +
    + params_names + + +
    + + + +
    @@ -1905,21 +1959,21 @@

    Arguments:

    -
    201    def get_params(self):
    -202        """Get object attributes.
    -203
    -204        Returns
    -205        -------
    -206        params : mapping of string to any
    -207            Parameter names mapped to their values.
    -208        """
    -209        out = dict()
    -210        param_names = dir(self)
    -211        for key in param_names:
    -212            if key.startswith("_") is False:
    -213                out[key] = getattr(self, key, None)
    -214
    -215        return out
    +            
    207    def get_params(self):
    +208        """Get object attributes.
    +209
    +210        Returns
    +211        -------
    +212        params : mapping of string to any
    +213            Parameter names mapped to their values.
    +214        """
    +215        out = dict()
    +216        param_names = dir(self)
    +217        for key in param_names:
    +218            if key.startswith("_") is False:
    +219                out[key] = getattr(self, key, None)
    +220
    +221        return out
     
    @@ -1944,11 +1998,11 @@

    Returns

    -
    218    def eval_objective(self, arg):
    -219        try:
    -220            return self.objective_func(self.x_init[arg, :])
    -221        except:
    -222            return 1e06
    +            
    224    def eval_objective(self, arg):
    +225        try:
    +226            return self.objective_func(self.x_init[arg, :])
    +227        except:
    +228            return 1e06
     
    @@ -1966,19 +2020,19 @@

    Returns

    -
    225    def load(self, path):
    -226        """load data from stored shelve.
    -227
    -228        # Arguments
    -229
    -230        path : a string; path to stored shelve.
    -231
    -232        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -233        """
    -234
    -235        self.sh = shelve.open(filename=path)
    -236        for key, value in self.sh.items():
    -237            setattr(self, key, value)
    +            
    231    def load(self, path):
    +232        """load data from stored shelve.
    +233
    +234        # Arguments
    +235
    +236        path : a string; path to stored shelve.
    +237
    +238        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +239        """
    +240
    +241        self.sh = shelve.open(filename=path)
    +242        for key, value in self.sh.items():
    +243            setattr(self, key, value)
     
    @@ -2004,11 +2058,11 @@

    Arguments

    -
    240    def update_shelve(self):
    -241        for key, value in self.get_params().items():
    -242            if (callable(value) is False) & (key != "sh"):
    -243                self.sh[key] = value
    -244        self.sh.sync()
    +            
    246    def update_shelve(self):
    +247        for key, value in self.get_params().items():
    +248            if (callable(value) is False) & (key != "sh"):
    +249                self.sh[key] = value
    +250        self.sh.sync()
     
    @@ -2026,17 +2080,17 @@

    Arguments

    -
    247    def close_shelve(self):
    -248        """Close shelve.
    -249
    -250        # Arguments
    -251
    -252        No argument.
    -253
    -254        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    -255        """
    -256
    -257        self.sh.close()
    +            
    253    def close_shelve(self):
    +254        """Close shelve.
    +255
    +256        # Arguments
    +257
    +258        No argument.
    +259
    +260        See also: [Bayesian Optimization with GPopt Part 2 (save and resume)](https://thierrymoudiki.github.io/blog/2021/04/30/python/misc/gpopt)
    +261        """
    +262
    +263        self.sh.close()
     
    @@ -2062,16 +2116,16 @@

    Arguments

    -
    260    def gp_fit_predict(self, X_train, y_train, X_test):
    -261
    -262        if len(X_train.shape) == 1:
    -263            X_train = X_train.reshape((-1, 1))
    -264            X_test = X_test.reshape((-1, 1))
    -265
    -266        # Get mean and standard deviation
    -267        return self.gp_obj.fit(X_train, y_train).predict(
    -268            X_test, return_std=True
    -269        )
    +            
    266    def gp_fit_predict(self, X_train, y_train, X_test):
    +267
    +268        if len(X_train.shape) == 1:
    +269            X_train = X_train.reshape((-1, 1))
    +270            X_test = X_test.reshape((-1, 1))
    +271
    +272        # Get mean and standard deviation
    +273        return self.gp_obj.fit(X_train, y_train).predict(
    +274            X_test, return_std=True
    +275        )
     
    @@ -2089,14 +2143,14 @@

    Arguments

    -
    272    def timings_fit_predict(self, X_train, y_train, X_test):
    -273
    -274        if len(X_train.shape) == 1:
    -275            X_train = X_train.reshape((-1, 1))
    -276            X_test = X_test.reshape((-1, 1))
    -277
    -278        # Get mean preds for timings
    -279        return self.rf_obj.fit(X_train, y_train).predict(X_test)
    +            
    278    def timings_fit_predict(self, X_train, y_train, X_test):
    +279
    +280        if len(X_train.shape) == 1:
    +281            X_train = X_train.reshape((-1, 1))
    +282            X_test = X_test.reshape((-1, 1))
    +283
    +284        # Get mean preds for timings
    +285        return self.rf_obj.fit(X_train, y_train).predict(X_test)
     
    @@ -2114,65 +2168,65 @@

    Arguments

    -
    282    def next_parameter_by_ei(self, seed, i):
    -283
    -284        gamma_hat = (self.y_min - self.y_mean) / self.y_std
    -285
    -286        self.ei = -self.y_std * (
    -287            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    -288        )
    +            
    288    def next_parameter_by_ei(self, seed, i):
     289
    -290        # find max index -----
    +290        gamma_hat = (self.y_min - self.y_mean) / self.y_std
     291
    -292        if self.per_second is False:
    -293
    -294            # find index for max. ei
    -295            max_index = self.ei.argmin()
    -296
    -297        else:  # self.per_second is True
    -298
    -299            # predict timings on self.x_choices
    -300            # train on X = self.parameters and y = self.timings
    -301            # (must have same shape[0])
    -302            timing_preds = self.timings_fit_predict(
    -303                X_train=np.asarray(self.parameters),
    -304                y_train=np.asarray(self.timings),
    -305                X_test=self.x_choices,
    -306            )
    -307
    -308            # find index for max. ei (and min. timings)
    -309            max_index = (-self.ei / timing_preds).argmax()
    -310
    -311        self.max_ei.append(np.abs(self.ei[max_index]))
    -312
    -313        # Select next choice
    -314        next_param = self.x_choices[max_index, :]
    -315
    -316        if next_param in np.asarray(self.parameters):
    -317
    -318            if self.log_scale == False:
    -319
    -320                np.random.seed(self.seed * i + 1000)
    -321                next_param = (
    -322                    self.upper_bound - self.lower_bound
    -323                ) * np.random.rand(self.n_dims) + self.lower_bound
    -324
    -325            else:  # /!\ very... experimental
    -326
    -327                np.random.seed(self.seed)
    -328                log_upper_bound = np.log(self.upper_bound)
    -329                log_lower_bound = np.log(self.lower_bound)
    -330                log_bounds_range = log_upper_bound - log_lower_bound
    -331
    -332                next_param = np.minimum(
    -333                    np.exp(
    -334                        log_bounds_range * np.random.rand(self.n_dims)
    -335                        + log_lower_bound
    -336                    ),
    -337                    1.7976931348623157e308,
    -338                )
    -339
    -340        return next_param
    +292        self.ei = -self.y_std * (
    +293            gamma_hat * st.norm.cdf(gamma_hat) + st.norm.pdf(gamma_hat)
    +294        )
    +295
    +296        # find max index -----
    +297
    +298        if self.per_second is False:
    +299
    +300            # find index for max. ei
    +301            max_index = self.ei.argmin()
    +302
    +303        else:  # self.per_second is True
    +304
    +305            # predict timings on self.x_choices
    +306            # train on X = self.parameters and y = self.timings
    +307            # (must have same shape[0])
    +308            timing_preds = self.timings_fit_predict(
    +309                X_train=np.asarray(self.parameters),
    +310                y_train=np.asarray(self.timings),
    +311                X_test=self.x_choices,
    +312            )
    +313
    +314            # find index for max. ei (and min. timings)
    +315            max_index = (-self.ei / timing_preds).argmax()
    +316
    +317        self.max_ei.append(np.abs(self.ei[max_index]))
    +318
    +319        # Select next choice
    +320        next_param = self.x_choices[max_index, :]
    +321
    +322        if next_param in np.asarray(self.parameters):
    +323
    +324            if self.log_scale == False:
    +325
    +326                np.random.seed(self.seed * i + 1000)
    +327                next_param = (
    +328                    self.upper_bound - self.lower_bound
    +329                ) * np.random.rand(self.n_dims) + self.lower_bound
    +330
    +331            else:  # /!\ very... experimental
    +332
    +333                np.random.seed(self.seed)
    +334                log_upper_bound = np.log(self.upper_bound)
    +335                log_lower_bound = np.log(self.lower_bound)
    +336                log_bounds_range = log_upper_bound - log_lower_bound
    +337
    +338                next_param = np.minimum(
    +339                    np.exp(
    +340                        log_bounds_range * np.random.rand(self.n_dims)
    +341                        + log_lower_bound
    +342                    ),
    +343                    1.7976931348623157e308,
    +344                )
    +345
    +346        return next_param
     
    @@ -2190,324 +2244,336 @@

    Arguments

    -
    343    def optimize(
    -344        self,
    -345        verbose=1,
    -346        n_more_iter=None,
    -347        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    -348        min_budget=50,  # minimum budget for early stopping
    -349        func_args=None,
    -350    ):
    -351        """Launch optimization loop.
    -352
    -353        # Arguments:
    -354
    -355            verbose: an integer;
    -356                verbose = 0: nothing is printed,
    -357                verbose = 1: a progress bar is printed (longer than 0),
    -358                verbose = 2: information about each iteration is printed (longer than 1)
    -359
    -360            n_more_iter: an integer;
    -361                additional number of iterations for the optimizer (which has been run once)
    -362
    -363            abs_tol: a float;
    -364                tolerance for convergence of the optimizer (early stopping based on expected improvement)
    +            
    349    def optimize(
    +350        self,
    +351        verbose=1,
    +352        n_more_iter=None,
    +353        abs_tol=None,  # suggested 1e-4, for n_iter = 200
    +354        min_budget=50,  # minimum budget for early stopping
    +355        func_args=None,
    +356    ):
    +357        """Launch optimization loop.
    +358
    +359        # Arguments:
    +360
    +361            verbose: an integer;
    +362                verbose = 0: nothing is printed,
    +363                verbose = 1: a progress bar is printed (longer than 0),
    +364                verbose = 2: information about each iteration is printed (longer than 1)
     365
    -366            min_budget: an integer (default is 50);
    -367                minimum number of iterations before early stopping controlled by `abs_tol`
    +366            n_more_iter: an integer;
    +367                additional number of iterations for the optimizer (which has been run once)
     368
    -369            func_args: a list;
    -370                additional parameters for the objective function (if necessary)
    +369            abs_tol: a float;
    +370                tolerance for convergence of the optimizer (early stopping based on expected improvement)
     371
    -372        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    -373        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +372            min_budget: an integer (default is 50);
    +373                minimum number of iterations before early stopping controlled by `abs_tol`
     374
    -375        """
    -376
    -377        # verbose = 0: nothing is printed
    -378        # verbose = 1: a progress bar is printed (longer than 0)
    -379        # verbose = 2: information about each iteration is printed (longer than 1)
    -380        if func_args is None:
    -381            func_args = []
    +375            func_args: a list;
    +376                additional parameters for the objective function (if necessary)
    +377
    +378        see also [Bayesian Optimization with GPopt](https://thierrymoudiki.github.io/blog/2021/04/16/python/misc/gpopt)
    +379        and [Hyperparameters tuning with GPopt](https://thierrymoudiki.github.io/blog/2021/06/11/python/misc/hyperparam-tuning-gpopt)
    +380
    +381        """
     382
    -383        if (
    -384            n_more_iter is None
    -385        ):  # initial optimization, before more iters are requested
    -386
    -387            n_iter = self.n_iter
    -388            # stopping iter for early stopping (default is total budget)
    -389            iter_stop = n_iter  # potentially # got to check this
    -390
    -391            # initial design  ----------
    +383        # verbose = 0: nothing is printed
    +384        # verbose = 1: a progress bar is printed (longer than 0)
    +385        # verbose = 2: information about each iteration is printed (longer than 1)
    +386        if func_args is None:
    +387            func_args = []
    +388
    +389        if (
    +390            n_more_iter is None
    +391        ):  # initial optimization, before more iters are requested
     392
    -393            if (verbose == 1) | (verbose == 2):
    -394                print(f"\n Creating initial design... \n")
    -395
    -396            if verbose == 1:
    -397                progbar = Progbar(target=self.n_init)
    +393            n_iter = self.n_iter
    +394            # stopping iter for early stopping (default is total budget)
    +395            iter_stop = n_iter  # potentially # got to check this
    +396
    +397            # initial design  ----------
     398
    -399            self.parameters = self.x_init.tolist()
    -400            self.scores = []
    +399            if (verbose == 1) | (verbose == 2):
    +400                print(f"\n Creating initial design... \n")
     401
    -402            if self.save is not None:
    -403                self.update_shelve()
    +402            if verbose == 1:
    +403                progbar = Progbar(target=self.n_init)
     404
    -405            if self.y_init is None:  # calculate scores on initial design
    -406
    -407                assert (
    -408                    self.objective_func is not None
    -409                ), "self.y_init is None: must have 'objective_func' not None"
    +405            self.parameters = self.x_init.tolist()
    +406            self.scores = []
    +407
    +408            if self.save is not None:
    +409                self.update_shelve()
     410
    -411                if self.n_jobs == 1:
    +411            if self.y_init is None:  # calculate scores on initial design
     412
    -413                    for i in range(self.n_init):
    -414
    -415                        x_next = self.x_init[i, :]
    +413                assert (
    +414                    self.objective_func is not None
    +415                ), "self.y_init is None: must have 'objective_func' not None"
     416
    -417                        try:
    +417                if self.n_jobs == 1:
     418
    -419                            if self.per_second is True:
    +419                    for i in range(self.n_init):
     420
    -421                                start = time()
    -422                                score = self.objective_func(x_next, *func_args)
    -423                                if (np.isfinite(score) == False) or (
    -424                                    np.isnan(score) == True
    -425                                ):
    -426                                    continue
    -427                                self.timings.append(np.log(time() - start))
    -428
    -429                            else:  # self.per_second is False
    -430
    -431                                score = self.objective_func(x_next, *func_args)
    -432                                if (np.isfinite(score) == False) or (
    -433                                    np.isnan(score) == True
    -434                                ):
    -435                                    continue
    +421                        x_next = self.x_init[i, :]
    +422
    +423                        try:
    +424
    +425                            if self.per_second is True:
    +426
    +427                                start = time()
    +428                                score = self.objective_func(x_next, *func_args)
    +429                                if (np.isfinite(score) == False) or (
    +430                                    np.isnan(score) == True
    +431                                ):
    +432                                    continue
    +433                                self.timings.append(np.log(time() - start))
    +434
    +435                            else:  # self.per_second is False
     436
    -437                            self.scores.append(score)
    -438
    -439                            if self.save is not None:
    -440                                self.update_shelve()
    -441
    -442                        except:
    -443
    -444                            continue
    -445
    -446                        if verbose == 1:
    -447                            progbar.update(i)  # update progress bar
    -448
    -449                        if verbose == 2:
    -450                            print(f"point: {x_next}; score: {score}")
    -451                    # end loop # calculate scores on initial design
    -452
    -453                    if verbose == 1:
    -454                        progbar.update(self.n_init)
    -455
    -456                else:  # self.n_jobs != 1
    -457
    -458                    assert (
    -459                        self.per_second is False
    -460                    ), "timings not calculated here"
    +437                                score = self.objective_func(x_next, *func_args)
    +438                                if (np.isfinite(score) == False) or (
    +439                                    np.isnan(score) == True
    +440                                ):
    +441                                    continue
    +442
    +443                            self.scores.append(score)
    +444
    +445                            if self.save is not None:
    +446                                self.update_shelve()
    +447
    +448                        except:
    +449
    +450                            continue
    +451
    +452                        if verbose == 1:
    +453                            progbar.update(i)  # update progress bar
    +454
    +455                        if verbose == 2:
    +456                            print(f"point: {x_next}; score: {score}")
    +457                    # end loop # calculate scores on initial design
    +458
    +459                    if verbose == 1:
    +460                        progbar.update(self.n_init)
     461
    -462                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    -463                        delayed(self.objective_func)(self.x_init[i, :])
    -464                        for i in range(self.n_init)
    -465                    )
    -466
    -467                    self.scores = scores
    -468
    -469                    if self.save is not None:
    -470                        self.update_shelve()
    -471
    -472            else:  # if self.y_init is None:
    -473
    -474                assert self.x_init.shape[0] == len(
    -475                    self.y_init
    -476                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +462                else:  # self.n_jobs != 1
    +463
    +464                    assert (
    +465                        self.per_second is False
    +466                    ), "timings not calculated here"
    +467
    +468                    scores = Parallel(n_jobs=self.n_jobs, prefer="threads")(
    +469                        delayed(self.objective_func)(self.x_init[i, :])
    +470                        for i in range(self.n_init)
    +471                    )
    +472
    +473                    self.scores = scores
    +474
    +475                    if self.save is not None:
    +476                        self.update_shelve()
     477
    -478                self.scores = pickle.loads(
    -479                    pickle.dumps(self.y_init.tolist(), -1)
    -480                )
    -481
    -482            # current best score on initial design
    -483            min_index = (np.asarray(self.scores)).argmin()
    -484            self.y_min = self.scores[min_index]
    -485            self.x_min = self.x_init[min_index, :]
    -486
    -487            # current gp mean and std on initial design
    -488            y_mean, y_std = self.gp_fit_predict(
    -489                np.asarray(self.parameters),
    -490                np.asarray(self.scores),
    -491                self.x_choices,
    -492            )
    -493            self.y_mean = y_mean
    -494            self.y_std = np.maximum(2.220446049250313e-16, y_std)
    -495
    -496            # saving after initial design computation
    -497            if self.save is not None:
    -498                self.update_shelve()
    -499
    -500        else:  # if n_more_iter is not None
    +478            else:  # if self.y_init is None:
    +479
    +480                assert self.x_init.shape[0] == len(
    +481                    self.y_init
    +482                ), "must have: self.x_init.shape[0] == len(self.y_init)"
    +483
    +484                self.scores = pickle.loads(
    +485                    pickle.dumps(self.y_init.tolist(), -1)
    +486                )
    +487
    +488            # current best score on initial design
    +489            min_index = (np.asarray(self.scores)).argmin()
    +490            self.y_min = self.scores[min_index]
    +491            self.x_min = self.x_init[min_index, :]
    +492
    +493            # current gp mean and std on initial design
    +494            y_mean, y_std = self.gp_fit_predict(
    +495                np.asarray(self.parameters),
    +496                np.asarray(self.scores),
    +497                self.x_choices,
    +498            )
    +499            self.y_mean = y_mean
    +500            self.y_std = np.maximum(2.220446049250313e-16, y_std)
     501
    -502            assert self.n_iter > 5, "you must have n_iter > 5"
    -503            n_iter = n_more_iter
    -504            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +502            # saving after initial design computation
    +503            if self.save is not None:
    +504                self.update_shelve()
     505
    -506        if (verbose == 1) | (verbose == 2):
    -507            print(f"\n ...Done. \n")
    -508            try:
    -509                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    -510            except:
    -511                pass
    -512
    -513        # end init design ----------
    -514
    -515        # if n_more_iter is None: # initial optimization, before more iters are requested
    -516
    -517        if (verbose == 1) | (verbose == 2):
    -518            print(f"\n Optimization loop... \n")
    -519
    -520        # early stopping?
    -521        if abs_tol is not None:
    -522            assert (
    -523                min_budget > 20
    -524            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +506        else:  # if n_more_iter is not None
    +507
    +508            assert self.n_iter > 5, "you must have n_iter > 5"
    +509            n_iter = n_more_iter
    +510            iter_stop = len(self.max_ei) + n_more_iter  # potentially
    +511
    +512        if (verbose == 1) | (verbose == 2):
    +513            print(f"\n ...Done. \n")
    +514            try:
    +515                print(np.hstack((self.x_init, self.y_init.reshape(-1, 1))))
    +516            except:
    +517                pass
    +518
    +519        # end init design ----------
    +520
    +521        # if n_more_iter is None: # initial optimization, before more iters are requested
    +522
    +523        if (verbose == 1) | (verbose == 2):
    +524            print(f"\n Optimization loop... \n")
     525
    -526        if verbose == 1:
    -527            progbar = Progbar(target=n_iter)
    -528
    -529        # main loop ----------
    -530
    -531        for i in range(n_iter):
    -532
    -533            # find next set of parameters (vector), maximizing ei
    -534            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
    -535
    -536            try:
    -537
    -538                if self.per_second is True:
    -539
    -540                    start = time()
    +526        # early stopping?
    +527        if abs_tol is not None:
    +528            assert (
    +529                min_budget > 20
    +530            ), "With 'abs_tol' provided, you must have 'min_budget' > 20"
    +531
    +532        if verbose == 1:
    +533            progbar = Progbar(target=n_iter)
    +534
    +535        # main loop ----------
    +536
    +537        for i in range(n_iter):
    +538
    +539            # find next set of parameters (vector), maximizing ei
    +540            next_param = self.next_parameter_by_ei(seed=len(self.max_ei), i=i)
     541
    -542                    if self.objective_func is not None:
    +542            try:
     543
    -544                        score_next_param = self.objective_func(
    -545                            next_param, *func_args
    -546                        )
    +544                if self.per_second is True:
    +545
    +546                    start = time()
     547
    -548                        if (np.isfinite(score_next_param) == False) or (
    -549                            np.isnan(score_next_param) == True
    -550                        ):
    -551                            continue
    -552
    -553                    else:
    -554
    -555                        assert (self.x_init is not None) and (
    -556                            self.y_init is not None
    -557                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +548                    if self.objective_func is not None:
    +549
    +550                        score_next_param = self.objective_func(
    +551                            next_param, *func_args
    +552                        )
    +553
    +554                        if (np.isfinite(score_next_param) == False) or (
    +555                            np.isnan(score_next_param) == True
    +556                        ):
    +557                            continue
     558
    -559                        print(f"\n next param: {next_param} \n")
    -560                        score_next_param = float(
    -561                            input("get new score: \n")
    -562                        )  # or an API response
    -563
    -564                        if (np.isfinite(score_next_param) == False) or (
    -565                            np.isnan(score_next_param) == True
    -566                        ):
    -567                            continue
    -568
    -569                    self.timings.append(np.log(time() - start))
    -570
    -571                else:  # self.per_second is False:
    -572
    -573                    if self.objective_func is not None:
    +559                    else:
    +560
    +561                        assert (self.x_init is not None) and (
    +562                            self.y_init is not None
    +563                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +564
    +565                        print(f"\n next param: {next_param} \n")
    +566                        score_next_param = float(
    +567                            input("get new score: \n")
    +568                        )  # or an API response
    +569
    +570                        if (np.isfinite(score_next_param) == False) or (
    +571                            np.isnan(score_next_param) == True
    +572                        ):
    +573                            continue
     574
    -575                        score_next_param = self.objective_func(
    -576                            next_param, *func_args
    -577                        )
    +575                    self.timings.append(np.log(time() - start))
    +576
    +577                else:  # self.per_second is False:
     578
    -579                        if (np.isfinite(score_next_param) == False) or (
    -580                            np.isnan(score_next_param) == True
    -581                        ):
    -582                            continue
    -583
    -584                    else:
    -585
    -586                        assert (self.x_init is not None) and (
    -587                            self.y_init is not None
    -588                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +579                    if self.objective_func is not None:
    +580
    +581                        score_next_param = self.objective_func(
    +582                            next_param, *func_args
    +583                        )
    +584
    +585                        if (np.isfinite(score_next_param) == False) or (
    +586                            np.isnan(score_next_param) == True
    +587                        ):
    +588                            continue
     589
    -590                        print(f"\n next param: {next_param} \n")
    -591                        score_next_param = float(
    -592                            input("get new score: \n")
    -593                        )  # or an API response
    -594
    -595                        if (np.isfinite(score_next_param) == False) or (
    -596                            np.isnan(score_next_param) == True
    -597                        ):
    -598                            continue
    -599
    -600            except:
    -601
    -602                continue
    -603
    -604            self.parameters.append(next_param.tolist())
    +590                    else:
    +591
    +592                        assert (self.x_init is not None) and (
    +593                            self.y_init is not None
    +594                        ), "self.objective_func is not None: must have (self.x_init is not None) and (self.y_init is not None)"
    +595
    +596                        print(f"\n next param: {next_param} \n")
    +597                        score_next_param = float(
    +598                            input("get new score: \n")
    +599                        )  # or an API response
    +600
    +601                        if (np.isfinite(score_next_param) == False) or (
    +602                            np.isnan(score_next_param) == True
    +603                        ):
    +604                            continue
     605
    -606            self.scores.append(score_next_param)
    +606            except:
     607
    -608            if self.save is not None:
    -609                self.update_shelve()
    -610
    -611            if verbose == 2:
    -612                print(f"iteration {i + 1} -----")
    -613                print(f"current minimum:  {self.x_min}")
    -614                print(f"current minimum score:  {self.y_min}")
    -615                print(f"next parameter: {next_param}")
    -616                print(f"score for next parameter: {score_next_param} \n")
    -617
    -618            if score_next_param < self.y_min:
    -619                self.x_min = next_param
    -620                self.y_min = score_next_param
    -621                if self.save is not None:
    -622                    self.update_shelve()
    +608                continue
    +609
    +610            self.parameters.append(next_param.tolist())
    +611
    +612            self.scores.append(score_next_param)
    +613
    +614            if self.save is not None:
    +615                self.update_shelve()
    +616
    +617            if verbose == 2:
    +618                print(f"iteration {i + 1} -----")
    +619                print(f"current minimum:  {self.x_min}")
    +620                print(f"current minimum score:  {self.y_min}")
    +621                print(f"next parameter: {next_param}")
    +622                print(f"score for next parameter: {score_next_param} \n")
     623
    -624            self.y_mean, self.y_std = self.gp_fit_predict(
    -625                np.asarray(self.parameters),
    -626                np.asarray(self.scores),
    -627                self.x_choices,
    -628            )
    +624            if score_next_param < self.y_min:
    +625                self.x_min = next_param
    +626                self.y_min = score_next_param
    +627                if self.save is not None:
    +628                    self.update_shelve()
     629
    -630            if self.save is not None:
    -631                self.update_shelve()
    -632
    -633            if verbose == 1:
    -634                progbar.update(i + 1)  # update progress bar
    +630            self.y_mean, self.y_std = self.gp_fit_predict(
    +631                np.asarray(self.parameters),
    +632                np.asarray(self.scores),
    +633                self.x_choices,
    +634            )
     635
    -636            # early stopping
    -637
    -638            if abs_tol is not None:
    -639
    -640                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    -641                if len(self.max_ei) > min_budget:
    -642
    -643                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
    -644
    -645                    if diff_max_ei[-1] <= abs_tol:
    -646
    -647                        iter_stop = len(self.max_ei)  # index i starts at 0
    +636            if self.save is not None:
    +637                self.update_shelve()
    +638
    +639            if verbose == 1:
    +640                progbar.update(i + 1)  # update progress bar
    +641
    +642            # early stopping
    +643
    +644            if abs_tol is not None:
    +645
    +646                # if self.max_ei.size > (self.n_init + self.n_iter * min_budget_pct):
    +647                if len(self.max_ei) > min_budget:
     648
    -649                        break
    +649                    diff_max_ei = np.abs(np.diff(np.asarray(self.max_ei)))
     650
    -651        # end main loop ----------
    +651                    if diff_max_ei[-1] <= abs_tol:
     652
    -653        if (verbose == 1) & (i < (n_iter - 1)):
    -654            progbar.update(n_iter)
    -655
    -656        self.n_iter = iter_stop
    -657        if self.save is not None:
    -658            self.update_shelve()
    -659
    -660        return (self.x_min, self.y_min)
    +653                        iter_stop = len(self.max_ei)  # index i starts at 0
    +654
    +655                        break
    +656
    +657        # end main loop ----------
    +658
    +659        if (verbose == 1) & (i < (n_iter - 1)):
    +660            progbar.update(n_iter)
    +661
    +662        self.n_iter = iter_stop
    +663        if self.save is not None:
    +664            self.update_shelve()
    +665        
    +666        DescribeResult = namedtuple(
    +667                "DescribeResult", ("best_params", "best_score")
    +668            )
    +669
    +670        if self.params_names is None:
    +671
    +672            return DescribeResult(self.x_min, self.y_min)
    +673
    +674        else:
    +675
    +676            return DescribeResult(
    +677                dict(zip(self.params_names, self.x_min)), self.y_min
    +678            )
     
    diff --git a/gpopt-docs/search.js b/gpopt-docs/search.js index 5180332..2740d26 100644 --- a/gpopt-docs/search.js +++ b/gpopt-docs/search.js @@ -1,6 +1,6 @@ window.pdocSearch = (function(){ /** elasticlunr - http://weixsong.github.io * Copyright (C) 2017 Oliver Nightingale * Copyright (C) 2017 Wei Song * MIT Licensed */!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();oGPOpt class.

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt", "kind": "class", "doc": "

    Class GPOpt.

    \n\n

    Arguments:

    \n\n
    lower_bound: a numpy array;\n    lower bound for researched minimum\n\nupper_bound: a numpy array;\n    upper bound for researched minimum\n\nobjective_func: a function;\n    the objective function to be minimized\n\ngp_obj: a GaussianProcessRegressor object;\n    An ML model for estimating the uncertainty around the objective function        \n\nx_init:\n    initial setting of points where `objective_func` is evaluated (optional)\n\ny_init:\n    initial setting values at points where `objective_func` is evaluated (optional)\n\nn_init: an integer;\n    number of points in the initial setting, when `x_init` and `y_init` are not provided\n\nn_choices: an integer;\n    number of points for the calculation of expected improvement\n\nn_iter: an integer;\n    number of iterations of the minimization algorithm\n\nalpha: a float;\n    Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)\n\nn_restarts_optimizer: an integer;\n    The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood.\n\nseed: an integer;\n    reproducibility seed\n\nsave: a string;\n    Specifies where to save the optimizer in its current state\n\nn_jobs: an integer;\n    number of jobs for parallel computing on initial setting (can be -1)\n\nper_second: a boolean;\n    __experimental__, default is False (leave to default for now)\n\nlog_scale: a boolean;\n    __experimental__, default is False (leave to default for now)\n
    \n\n

    see also Bayesian Optimization with GPopt\n and Hyperparameters tuning with GPopt

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.__init__", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tlower_bound,\tupper_bound,\tobjective_func=None,\tgp_obj=None,\tx_init=None,\ty_init=None,\tn_init=10,\tn_choices=25000,\tn_iter=190,\talpha=1e-06,\tn_restarts_optimizer=25,\tseed=123,\tsave=None,\tn_jobs=1,\tper_second=False,\tlog_scale=False)"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.objective_func", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.objective_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.lower_bound", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.lower_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.upper_bound", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.upper_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_init", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.log_scale", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.log_scale", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_dims", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_dims", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_init", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_choices", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_choices", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_iter", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_iter", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.alpha", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.alpha", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_restarts_optimizer", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_restarts_optimizer", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.seed", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.seed", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.save", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.save", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.per_second", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.per_second", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.x_min", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.x_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_min", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_mean", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_mean", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_std", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_std", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.max_ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.max_ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_jobs", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.get_params", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.get_params", "kind": "function", "doc": "

    Get object attributes.

    \n\n

    Returns

    \n\n

    params : mapping of string to any\n Parameter names mapped to their values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.eval_objective", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.eval_objective", "kind": "function", "doc": "

    \n", "signature": "(self, arg):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.load", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.load", "kind": "function", "doc": "

    load data from stored shelve.

    \n\n

    Arguments

    \n\n

    path : a string; path to stored shelve.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self, path):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.update_shelve", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.update_shelve", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.close_shelve", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.close_shelve", "kind": "function", "doc": "

    Close shelve.

    \n\n

    Arguments

    \n\n

    No argument.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.gp_fit_predict", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.gp_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.timings_fit_predict", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.timings_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.next_parameter_by_ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.next_parameter_by_ei", "kind": "function", "doc": "

    \n", "signature": "(self, seed, i):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.optimize", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.optimize", "kind": "function", "doc": "

    Launch optimization loop.

    \n\n

    Arguments:

    \n\n
    verbose: an integer;\n    verbose = 0: nothing is printed,\n    verbose = 1: a progress bar is printed (longer than 0),\n    verbose = 2: information about each iteration is printed (longer than 1)\n\nn_more_iter: an integer;\n    additional number of iterations for the optimizer (which has been run once)\n\nabs_tol: a float;\n    tolerance for convergence of the optimizer (early stopping based on expected improvement)\n\nmin_budget: an integer (default is 50);\n    minimum number of iterations before early stopping controlled by `abs_tol`\n\nfunc_args: a list;\n    additional parameters for the objective function (if necessary)\n
    \n\n

    see also Bayesian Optimization with GPopt\nand Hyperparameters tuning with GPopt

    \n", "signature": "(\tself,\tverbose=1,\tn_more_iter=None,\tabs_tol=None,\tmin_budget=50,\tfunc_args=None):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt", "modulename": "GPopt.GPOpt", "kind": "module", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt", "modulename": "GPopt.GPOpt", "qualname": "GPOpt", "kind": "class", "doc": "

    Class GPOpt.

    \n\n

    Arguments:

    \n\n
    lower_bound: a numpy array;\n    lower bound for researched minimum\n\nupper_bound: a numpy array;\n    upper bound for researched minimum\n\nobjective_func: a function;\n    the objective function to be minimized\n\ngp_obj: a GaussianProcessRegressor object;\n    An ML model for estimating the uncertainty around the objective function        \n\nx_init:\n    initial setting of points where `objective_func` is evaluated (optional)\n\ny_init:\n    initial setting values at points where `objective_func` is evaluated (optional)\n\nn_init: an integer;\n    number of points in the initial setting, when `x_init` and `y_init` are not provided\n\nn_choices: an integer;\n    number of points for the calculation of expected improvement\n\nn_iter: an integer;\n    number of iterations of the minimization algorithm\n\nalpha: a float;\n    Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)\n\nn_restarts_optimizer: an integer;\n    The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood.\n\nseed: an integer;\n    reproducibility seed\n\nsave: a string;\n    Specifies where to save the optimizer in its current state\n\nn_jobs: an integer;\n    number of jobs for parallel computing on initial setting (can be -1)\n\nper_second: a boolean;\n    __experimental__, default is False (leave to default for now)\n\nlog_scale: a boolean;\n    __experimental__, default is False (leave to default for now)\n
    \n\n

    see also Bayesian Optimization with GPopt\n and Hyperparameters tuning with GPopt

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.__init__", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tlower_bound,\tupper_bound,\tobjective_func=None,\tgp_obj=None,\tx_init=None,\ty_init=None,\tn_init=10,\tn_choices=25000,\tn_iter=190,\talpha=1e-06,\tn_restarts_optimizer=25,\tseed=123,\tsave=None,\tn_jobs=1,\tper_second=False,\tlog_scale=False)"}, {"fullname": "GPopt.GPOpt.GPOpt.objective_func", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.objective_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.lower_bound", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.lower_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.upper_bound", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.upper_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_init", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.log_scale", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.log_scale", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_dims", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_dims", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_init", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_choices", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_choices", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_iter", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_iter", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.alpha", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.alpha", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_restarts_optimizer", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_restarts_optimizer", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.seed", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.seed", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.save", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.save", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.per_second", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.per_second", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.x_min", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.x_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_min", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_mean", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_mean", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_std", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_std", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.max_ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.max_ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_jobs", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.get_params", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.get_params", "kind": "function", "doc": "

    Get object attributes.

    \n\n

    Returns

    \n\n

    params : mapping of string to any\n Parameter names mapped to their values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.eval_objective", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.eval_objective", "kind": "function", "doc": "

    \n", "signature": "(self, arg):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.load", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.load", "kind": "function", "doc": "

    load data from stored shelve.

    \n\n

    Arguments

    \n\n

    path : a string; path to stored shelve.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self, path):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.update_shelve", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.update_shelve", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.close_shelve", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.close_shelve", "kind": "function", "doc": "

    Close shelve.

    \n\n

    Arguments

    \n\n

    No argument.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.gp_fit_predict", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.gp_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.timings_fit_predict", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.timings_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.next_parameter_by_ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.next_parameter_by_ei", "kind": "function", "doc": "

    \n", "signature": "(self, seed, i):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.optimize", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.optimize", "kind": "function", "doc": "

    Launch optimization loop.

    \n\n

    Arguments:

    \n\n
    verbose: an integer;\n    verbose = 0: nothing is printed,\n    verbose = 1: a progress bar is printed (longer than 0),\n    verbose = 2: information about each iteration is printed (longer than 1)\n\nn_more_iter: an integer;\n    additional number of iterations for the optimizer (which has been run once)\n\nabs_tol: a float;\n    tolerance for convergence of the optimizer (early stopping based on expected improvement)\n\nmin_budget: an integer (default is 50);\n    minimum number of iterations before early stopping controlled by `abs_tol`\n\nfunc_args: a list;\n    additional parameters for the objective function (if necessary)\n
    \n\n

    see also Bayesian Optimization with GPopt\nand Hyperparameters tuning with GPopt

    \n", "signature": "(\tself,\tverbose=1,\tn_more_iter=None,\tabs_tol=None,\tmin_budget=50,\tfunc_args=None):", "funcdef": "def"}]; + /** pdoc search index */const docs = [{"fullname": "GPopt.GPOpt.GPOpt", "modulename": "GPopt.GPOpt.GPOpt", "kind": "module", "doc": "

    GPOpt class.

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt", "kind": "class", "doc": "

    Class GPOpt.

    \n\n

    Arguments:

    \n\n
    lower_bound: a numpy array;\n    lower bound for researched minimum\n\nupper_bound: a numpy array;\n    upper bound for researched minimum\n\nobjective_func: a function;\n    the objective function to be minimized\n\nparams_names: a list;\n    names of the parameters of the objective function (optional)\n\ngp_obj: a GaussianProcessRegressor object;\n    An ML model for estimating the uncertainty around the objective function        \n\nx_init:\n    initial setting of points where `objective_func` is evaluated (optional)\n\ny_init:\n    initial setting values at points where `objective_func` is evaluated (optional)\n\nn_init: an integer;\n    number of points in the initial setting, when `x_init` and `y_init` are not provided\n\nn_choices: an integer;\n    number of points for the calculation of expected improvement\n\nn_iter: an integer;\n    number of iterations of the minimization algorithm\n\nalpha: a float;\n    Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)\n\nn_restarts_optimizer: an integer;\n    The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood.\n\nseed: an integer;\n    reproducibility seed\n\nsave: a string;\n    Specifies where to save the optimizer in its current state\n\nn_jobs: an integer;\n    number of jobs for parallel computing on initial setting (can be -1)\n\nper_second: a boolean;\n    __experimental__, default is False (leave to default for now)\n\nlog_scale: a boolean;\n    __experimental__, default is False (leave to default for now)\n
    \n\n

    see also Bayesian Optimization with GPopt\n and Hyperparameters tuning with GPopt

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.__init__", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tlower_bound,\tupper_bound,\tobjective_func=None,\tparams_names=None,\tgp_obj=None,\tx_init=None,\ty_init=None,\tn_init=10,\tn_choices=25000,\tn_iter=190,\talpha=1e-06,\tn_restarts_optimizer=25,\tseed=123,\tsave=None,\tn_jobs=1,\tper_second=False,\tlog_scale=False)"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.objective_func", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.objective_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.params_names", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.params_names", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.lower_bound", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.lower_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.upper_bound", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.upper_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_init", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.log_scale", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.log_scale", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_dims", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_dims", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_init", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_choices", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_choices", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_iter", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_iter", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.alpha", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.alpha", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_restarts_optimizer", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_restarts_optimizer", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.seed", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.seed", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.save", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.save", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.per_second", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.per_second", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.x_min", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.x_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_min", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_mean", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_mean", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.y_std", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.y_std", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.max_ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.max_ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.n_jobs", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.n_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.get_params", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.get_params", "kind": "function", "doc": "

    Get object attributes.

    \n\n

    Returns

    \n\n

    params : mapping of string to any\n Parameter names mapped to their values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.eval_objective", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.eval_objective", "kind": "function", "doc": "

    \n", "signature": "(self, arg):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.load", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.load", "kind": "function", "doc": "

    load data from stored shelve.

    \n\n

    Arguments

    \n\n

    path : a string; path to stored shelve.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self, path):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.update_shelve", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.update_shelve", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.close_shelve", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.close_shelve", "kind": "function", "doc": "

    Close shelve.

    \n\n

    Arguments

    \n\n

    No argument.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.gp_fit_predict", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.gp_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.timings_fit_predict", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.timings_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.next_parameter_by_ei", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.next_parameter_by_ei", "kind": "function", "doc": "

    \n", "signature": "(self, seed, i):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.GPOpt.optimize", "modulename": "GPopt.GPOpt.GPOpt", "qualname": "GPOpt.optimize", "kind": "function", "doc": "

    Launch optimization loop.

    \n\n

    Arguments:

    \n\n
    verbose: an integer;\n    verbose = 0: nothing is printed,\n    verbose = 1: a progress bar is printed (longer than 0),\n    verbose = 2: information about each iteration is printed (longer than 1)\n\nn_more_iter: an integer;\n    additional number of iterations for the optimizer (which has been run once)\n\nabs_tol: a float;\n    tolerance for convergence of the optimizer (early stopping based on expected improvement)\n\nmin_budget: an integer (default is 50);\n    minimum number of iterations before early stopping controlled by `abs_tol`\n\nfunc_args: a list;\n    additional parameters for the objective function (if necessary)\n
    \n\n

    see also Bayesian Optimization with GPopt\nand Hyperparameters tuning with GPopt

    \n", "signature": "(\tself,\tverbose=1,\tn_more_iter=None,\tabs_tol=None,\tmin_budget=50,\tfunc_args=None):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt", "modulename": "GPopt.GPOpt", "kind": "module", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt", "modulename": "GPopt.GPOpt", "qualname": "GPOpt", "kind": "class", "doc": "

    Class GPOpt.

    \n\n

    Arguments:

    \n\n
    lower_bound: a numpy array;\n    lower bound for researched minimum\n\nupper_bound: a numpy array;\n    upper bound for researched minimum\n\nobjective_func: a function;\n    the objective function to be minimized\n\nparams_names: a list;\n    names of the parameters of the objective function (optional)\n\ngp_obj: a GaussianProcessRegressor object;\n    An ML model for estimating the uncertainty around the objective function        \n\nx_init:\n    initial setting of points where `objective_func` is evaluated (optional)\n\ny_init:\n    initial setting values at points where `objective_func` is evaluated (optional)\n\nn_init: an integer;\n    number of points in the initial setting, when `x_init` and `y_init` are not provided\n\nn_choices: an integer;\n    number of points for the calculation of expected improvement\n\nn_iter: an integer;\n    number of iterations of the minimization algorithm\n\nalpha: a float;\n    Value added to the diagonal of the kernel matrix during fitting (for Matern 5/2 kernel)\n\nn_restarts_optimizer: an integer;\n    The number of restarts of the optimizer for finding the kernel\u2019s parameters which maximize the log-marginal likelihood.\n\nseed: an integer;\n    reproducibility seed\n\nsave: a string;\n    Specifies where to save the optimizer in its current state\n\nn_jobs: an integer;\n    number of jobs for parallel computing on initial setting (can be -1)\n\nper_second: a boolean;\n    __experimental__, default is False (leave to default for now)\n\nlog_scale: a boolean;\n    __experimental__, default is False (leave to default for now)\n
    \n\n

    see also Bayesian Optimization with GPopt\n and Hyperparameters tuning with GPopt

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.__init__", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.__init__", "kind": "function", "doc": "

    \n", "signature": "(\tlower_bound,\tupper_bound,\tobjective_func=None,\tparams_names=None,\tgp_obj=None,\tx_init=None,\ty_init=None,\tn_init=10,\tn_choices=25000,\tn_iter=190,\talpha=1e-06,\tn_restarts_optimizer=25,\tseed=123,\tsave=None,\tn_jobs=1,\tper_second=False,\tlog_scale=False)"}, {"fullname": "GPopt.GPOpt.GPOpt.objective_func", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.objective_func", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.params_names", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.params_names", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.lower_bound", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.lower_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.upper_bound", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.upper_bound", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_init", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.log_scale", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.log_scale", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_dims", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_dims", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_init", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_init", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_choices", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_choices", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_iter", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_iter", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.alpha", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.alpha", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_restarts_optimizer", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_restarts_optimizer", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.seed", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.seed", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.save", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.save", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.per_second", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.per_second", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.x_min", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.x_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_min", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_min", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_mean", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_mean", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.y_std", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.y_std", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.max_ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.max_ei", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.n_jobs", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.n_jobs", "kind": "variable", "doc": "

    \n"}, {"fullname": "GPopt.GPOpt.GPOpt.get_params", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.get_params", "kind": "function", "doc": "

    Get object attributes.

    \n\n

    Returns

    \n\n

    params : mapping of string to any\n Parameter names mapped to their values.

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.eval_objective", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.eval_objective", "kind": "function", "doc": "

    \n", "signature": "(self, arg):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.load", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.load", "kind": "function", "doc": "

    load data from stored shelve.

    \n\n

    Arguments

    \n\n

    path : a string; path to stored shelve.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self, path):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.update_shelve", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.update_shelve", "kind": "function", "doc": "

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.close_shelve", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.close_shelve", "kind": "function", "doc": "

    Close shelve.

    \n\n

    Arguments

    \n\n

    No argument.

    \n\n

    See also: Bayesian Optimization with GPopt Part 2 (save and resume)

    \n", "signature": "(self):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.gp_fit_predict", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.gp_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.timings_fit_predict", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.timings_fit_predict", "kind": "function", "doc": "

    \n", "signature": "(self, X_train, y_train, X_test):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.next_parameter_by_ei", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.next_parameter_by_ei", "kind": "function", "doc": "

    \n", "signature": "(self, seed, i):", "funcdef": "def"}, {"fullname": "GPopt.GPOpt.GPOpt.optimize", "modulename": "GPopt.GPOpt", "qualname": "GPOpt.optimize", "kind": "function", "doc": "

    Launch optimization loop.

    \n\n

    Arguments:

    \n\n
    verbose: an integer;\n    verbose = 0: nothing is printed,\n    verbose = 1: a progress bar is printed (longer than 0),\n    verbose = 2: information about each iteration is printed (longer than 1)\n\nn_more_iter: an integer;\n    additional number of iterations for the optimizer (which has been run once)\n\nabs_tol: a float;\n    tolerance for convergence of the optimizer (early stopping based on expected improvement)\n\nmin_budget: an integer (default is 50);\n    minimum number of iterations before early stopping controlled by `abs_tol`\n\nfunc_args: a list;\n    additional parameters for the objective function (if necessary)\n
    \n\n

    see also Bayesian Optimization with GPopt\nand Hyperparameters tuning with GPopt

    \n", "signature": "(\tself,\tverbose=1,\tn_more_iter=None,\tabs_tol=None,\tmin_budget=50,\tfunc_args=None):", "funcdef": "def"}]; // mirrored in build-search-index.js (part 1) // Also split on html tags. this is a cheap heuristic, but good enough. diff --git a/requirements.txt b/requirements.txt index 9f9430b..43ece8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,9 @@ joblib matplotlib +nnetsauce numpy pandas scipy scikit-learn -threadpoolctl \ No newline at end of file +threadpoolctl +tqdm \ No newline at end of file diff --git a/save.db b/save.db new file mode 100644 index 0000000..06208da Binary files /dev/null and b/save.db differ diff --git a/setup.py b/setup.py index 4dc4545..19a09ad 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from codecs import open from os import path -__version__ = "0.4.1" +__version__ = "0.6.0" subprocess.call("pip install -r requirements.txt", shell=True)