sampling.mm.mm_improvement
sampling.mm.mm_improvement(
x,
X_base,
phi_base=None,
J_base=None,
d_base=None,
q=2,
p=2,
normalize_flag=False,
verbose=False,
exponential=True,
)
Calculates the Morris-Mitchell improvement for a candidate point x.
Parameters
| x |
np.ndarray |
Candidate point (1D array). |
required |
| X_base |
np.ndarray |
Existing design points. |
required |
| J_base |
np.ndarray |
Multiplicities of distances for X_base. |
None |
| d_base |
np.ndarray |
Unique distances for X_base. |
None |
| q |
int |
Number of nearest neighbors for MM metric. |
2 |
| p |
int |
Power for MM metric. |
2 |
| normalize_flag |
bool |
If True, normalizes the X array and candidate point before computing distances. Defaults to False. |
False |
| exponential |
bool |
If True, the exponential is applied. |
True |
Returns
| float |
float |
Morris-Mitchell improvement. |
Examples
>>> import numpy as np
>>> from spotoptim.sampling.mm import mm_improvement
>>> X_base = np.array([[0.1, 0.2], [0.4, 0.5], [0.7, 0.8]])
>>> x = np.array([0.5, 0.5])
>>> improvement = mm_improvement(x, X_base, q=2, p=2)
>>> print(improvement)
0.123456789