Transformation¶
Functions to transform the inputs and outputs
-
class
transformation.
transformation
(theta: numpy.ndarray, y: numpy.ndarray)[source]¶ Bases:
object
Module to perform all relevant transformation, for example, pre-whitening the inputs and logarithm (supports log10 transformation) for the outputs.
-
x_transform
() → numpy.ndarray[source]¶ Transform the inputs (pre-whitening step)
- Returns
theta_trans (np.ndarray) : transformed input parameters
-
x_transform_test
(xtest: numpy.ndarray) → numpy.ndarray[source]¶ Given a test point, we transform the test point in the appropriate basis
- Param
xtext (np.ndarray) : a vector of dimension d for the test point
- Returns
x_trans (np.ndarray) : the transformed input parameters
-
y_inv_transform_test
(y_test: numpy.ndarray) → numpy.ndarray[source]¶ Given a response (a prediction), this function will do the inverse transformation (from log_10 to the original function).
- Param
y_test (float or np.ndarray) : a test (transformed) response (output)
- Returns
y_inv (np.ndarray) : original (predicted) output
-
y_transform
() → numpy.ndarray[source]¶ Transform the output (depends on whether we want this criterion)
If all the outputs are positive, then y_min = 0, otherwise the minimum is computed and the outputs are shifted by this amount before the logarithm transformation is applied
- Returns
y_trans (np.ndarray) : array for the transformed output
-