spotoptim 3.2.0__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spotoptim-3.2.0 → spotoptim-3.3.0}/PKG-INFO +1 -1
- {spotoptim-3.2.0 → spotoptim-3.3.0}/pyproject.toml +1 -1
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/kriging.py +32 -6
- {spotoptim-3.2.0 → spotoptim-3.3.0}/README.md +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/SpotOptim.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/core/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/core/data.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/core/experiment.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/core/protocol.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/core/storage.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/data/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/data/base.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/data/diabetes.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/data/manydataset.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/datasets/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/datasets/py.typed +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/datasets/test01.csv +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/datasets/test02.csv +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/datasets/test11.csv +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/eda/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/eda/plots.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/confirmatory_factor_analyzer.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/factor_analyzer.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/factor_analyzer_rotator.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/factor_analyzer_utils.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/cd_data.csv +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/forr08a.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/mo.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/remote.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/sequence_cv_objective.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/so.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/function/torch_objective.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/hyperparameters/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/hyperparameters/parameters.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/hyperparameters/repr_helpers.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/inspection/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/inspection/importance.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/inspection/predictions.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/mo/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/mo/mo_mm.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/mo/pareto.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/linear_regressor.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/many_to_many_rnn.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/mlp.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/optimizer.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/nn/training.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/optimizer/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/optimizer/acquisition.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/optimizer/schedule_free.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/optimizer/wrapper.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/plot/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/plot/contour.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/plot/mo.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/plot/visualization.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/py.typed +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/reporting/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/reporting/analysis.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/reporting/results.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/sampling/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/sampling/design.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/sampling/effects.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/sampling/lhs.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/sampling/mm.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/kernels.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/mlp_surrogate.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/nystroem.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/pipeline.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/surrogate/simple_kriging.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/tricands/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/tricands/tricands.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/__init__.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/boundaries.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/convert.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/dimreduction.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/eval.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/file.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/mapping.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/ocba.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/pca.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/scaler.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/seed.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/serialization.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/stats.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/tensorboard.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/transform.py +0 -0
- {spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/utils/variables.py +0 -0
|
@@ -73,8 +73,17 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
73
73
|
theta_init_zero (bool, optional): Initialize theta to zero. Defaults to False.
|
|
74
74
|
n_p (int, optional): Number of p parameters (currently not optimized). Defaults to 1.
|
|
75
75
|
optim_p (bool, optional): Optimize p parameters (currently not supported). Defaults to False.
|
|
76
|
-
min_Lambda (float, optional): Minimum log10(Lambda) bound
|
|
76
|
+
min_Lambda (float, optional): Minimum log10(Lambda) bound; the admissible
|
|
77
|
+
nugget range is [10**min_Lambda, 10**max_Lambda] regardless of
|
|
78
|
+
``lambda_scale``. Defaults to -9.0.
|
|
77
79
|
max_Lambda (float, optional): Maximum log10(Lambda) bound. Defaults to 0.0.
|
|
80
|
+
lambda_scale (str, optional): Search parametrization of the nugget Lambda
|
|
81
|
+
within [10**min_Lambda, 10**max_Lambda]. Options:
|
|
82
|
+
- "log10": the optimizer searches the exponent log10(Lambda)
|
|
83
|
+
uniformly, emphasizing small nuggets (near-interpolation).
|
|
84
|
+
- "linear": the optimizer searches Lambda itself uniformly,
|
|
85
|
+
emphasizing larger nuggets (more smoothing on noisy data).
|
|
86
|
+
Defaults to "log10".
|
|
78
87
|
metric_factorial (str, optional): Distance metric for factor variables.
|
|
79
88
|
Defaults to ``"hamming"``. Hamming is a true nominal (order-agnostic) metric;
|
|
80
89
|
canberra distance on integer level indices is order-dependent and singles out
|
|
@@ -86,7 +95,9 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
86
95
|
X_ (ndarray): Training data, shape (n_samples, n_features).
|
|
87
96
|
y_ (ndarray): Training targets, shape (n_samples,).
|
|
88
97
|
theta_ (ndarray): Optimized log10(theta) parameters.
|
|
89
|
-
Lambda_ (float or None): Optimized
|
|
98
|
+
Lambda_ (float or None): Optimized Lambda parameter in the search scale
|
|
99
|
+
(the log10 exponent for ``lambda_scale="log10"``, the linear value
|
|
100
|
+
for ``lambda_scale="linear"``) for regression methods.
|
|
90
101
|
mu_ (float): Mean of Kriging predictor.
|
|
91
102
|
sigma2_ (float): Variance of Kriging predictor.
|
|
92
103
|
U_ (ndarray): Cholesky factor of correlation matrix.
|
|
@@ -162,6 +173,7 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
162
173
|
optim_p: bool = False,
|
|
163
174
|
min_Lambda: float = -9.0,
|
|
164
175
|
max_Lambda: float = 0.0,
|
|
176
|
+
lambda_scale: str = "log10",
|
|
165
177
|
metric_factorial: str = "hamming",
|
|
166
178
|
isotropic: bool = False,
|
|
167
179
|
theta: Optional[np.ndarray] = None,
|
|
@@ -183,6 +195,9 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
183
195
|
self.max_theta = max_theta
|
|
184
196
|
self.min_Lambda = min_Lambda
|
|
185
197
|
self.max_Lambda = max_Lambda
|
|
198
|
+
if lambda_scale not in ["log10", "linear"]:
|
|
199
|
+
raise ValueError("lambda_scale must be 'log10' or 'linear'")
|
|
200
|
+
self.lambda_scale = lambda_scale
|
|
186
201
|
self.n_theta = n_theta
|
|
187
202
|
self.isotropic = isotropic
|
|
188
203
|
self.n_p = n_p
|
|
@@ -216,6 +231,18 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
216
231
|
"""Get square root of machine epsilon."""
|
|
217
232
|
return np.sqrt(np.finfo(float).eps)
|
|
218
233
|
|
|
234
|
+
def _lambda_bounds(self) -> Tuple[float, float]:
|
|
235
|
+
"""Search bounds of the Lambda parameter in the configured scale."""
|
|
236
|
+
if self.lambda_scale == "linear":
|
|
237
|
+
return (10.0**self.min_Lambda, 10.0**self.max_Lambda)
|
|
238
|
+
return (self.min_Lambda, self.max_Lambda)
|
|
239
|
+
|
|
240
|
+
def _lambda_value(self, param: float) -> float:
|
|
241
|
+
"""Nugget value Lambda from its search-scale parameter."""
|
|
242
|
+
if self.lambda_scale == "linear":
|
|
243
|
+
return param
|
|
244
|
+
return 10.0**param
|
|
245
|
+
|
|
219
246
|
def _set_variable_types(self) -> None:
|
|
220
247
|
"""Set variable type masks for different variable types.
|
|
221
248
|
|
|
@@ -298,7 +325,7 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
298
325
|
bounds = [(self.min_theta, self.max_theta)] * self.n_theta
|
|
299
326
|
|
|
300
327
|
if self.method in ["regression", "reinterpolation"]:
|
|
301
|
-
bounds += [
|
|
328
|
+
bounds += [self._lambda_bounds()]
|
|
302
329
|
|
|
303
330
|
if self.optim_p:
|
|
304
331
|
bounds += [(1.0, 2.0)] * self.n_p
|
|
@@ -431,8 +458,7 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
431
458
|
self.theta_ = params[: self.n_theta]
|
|
432
459
|
|
|
433
460
|
if self.method in ["regression", "reinterpolation"]:
|
|
434
|
-
|
|
435
|
-
lambda_ = 10.0**lambda_log
|
|
461
|
+
lambda_ = self._lambda_value(params[self.n_theta : self.n_theta + 1][0])
|
|
436
462
|
else:
|
|
437
463
|
lambda_ = self.noise
|
|
438
464
|
|
|
@@ -536,7 +562,7 @@ class Kriging(BaseEstimator, RegressorMixin):
|
|
|
536
562
|
>>> y_pred, y_std = k.predict_single(x_new)
|
|
537
563
|
"""
|
|
538
564
|
if self.method in ["regression", "reinterpolation"]:
|
|
539
|
-
lambda_ =
|
|
565
|
+
lambda_ = self._lambda_value(self.Lambda_)
|
|
540
566
|
else:
|
|
541
567
|
lambda_ = self.noise
|
|
542
568
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/confirmatory_factor_analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
{spotoptim-3.2.0 → spotoptim-3.3.0}/src/spotoptim/factor_analyzer/factor_analyzer_rotator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|