utils.boundaries.map_to_original_scale

utils.boundaries.map_to_original_scale(X_search, x_min, x_max)

Maps the values in X_search from the range [0, 1] to the original scale defined by x_min and x_max.

Parameters

Name Type Description Default
X_search Union[pd.DataFrame, np.ndarray] A Pandas DataFrame or NumPy array containing the search points in the range [0, 1]. required
x_min np.ndarray A NumPy array containing the minimum values for each feature in the original scale. required
x_max np.ndarray A NumPy array containing the maximum values for each feature in the original scale. required

Returns

Name Type Description
Union[pd.DataFrame, np.ndarray] Union[pd.DataFrame, np.ndarray]: A Pandas DataFrame or NumPy array with the values mapped to the original scale.

Examples

>>> from spotoptim.utils.boundaries import map_to_original_scale
>>> import numpy as np
>>> import pandas as pd
>>> X_search = pd.DataFrame([[0.5, 0.5], [0.25, 0.75]], columns=['x', 'y'])
>>> x_min = np.array([0, 0])
>>> x_max = np.array([10, 20])
>>> X_search_scaled = map_to_original_scale(X_search, x_min, x_max)
>>> print(X_search_scaled)
      x     y
0   5.0  10.0
1   2.5  15.0