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

y_transform_test(y_original: numpy.ndarray) → numpy.ndarray[source]

Given a response/output which is not in the training set, this function will do the forward log_10 transformation.

Param

y_original (float or np.ndarray) : original output

Returns

y_trans_test (array) : transformed output