pytuq.utils.maps
Module for various mapping functions.
Classes
Base class for a map. |
|
Exponential map. |
|
Logarithmic map. |
|
Composition of two maps. |
|
Linear scaler map. |
|
Standardizer map, linearly scaling data to zero mean and unit variance. |
|
Normalizer map, linearly scaling data to [0,1]. |
|
Domainizer map, linearly scaling data (assumed to be in [0,1]) to a given domain. |
|
Affine map. |
Functions
|
Scaling an array to a given domain, assuming the inputs are in [0,1]^d. |
|
Scaling an array from a given domain to [0,1]^d. |
|
Scale an array to [0,1], using dimension-wise min and max. |
|
Normalize an array, i.e. map it to zero mean and unit variance. |
Module Contents
- pytuq.utils.maps.scale01ToDom(xx, dom)[source]
Scaling an array to a given domain, assuming the inputs are in [0,1]^d.
- Parameters:
xx (np.ndarray) – Nxd input array.
dom (np.ndarray) – dx2 domain.
- Returns:
Nxd scaled array.
- Return type:
np.ndarray
Note
If input is outside [0,1]^d, a warning is given, but the scaling will happen nevertheless.
- pytuq.utils.maps.scaleDomTo01(xx, dom)[source]
Scaling an array from a given domain to [0,1]^d.
- Parameters:
xx (np.ndarray) – Nxd input array.
dom (np.ndarray) – dx2 domain.
- Returns:
Nxd scaled array.
- Return type:
np.ndarray
Note
If input is outside domain, a warning is given, but the scaling will happen nevertheless.
- pytuq.utils.maps.scaleTo01(xx)[source]
Scale an array to [0,1], using dimension-wise min and max.
- Parameters:
xx (np.ndarray) – Initial 2d array
- Returns:
Scaled array.
- Return type:
np.ndarray
- pytuq.utils.maps.standardize(xx)[source]
Normalize an array, i.e. map it to zero mean and unit variance.
- Parameters:
xx (np.ndarray) – Initial 2d array
- Returns:
Normalized array.
- Return type:
np.ndarray
- class pytuq.utils.maps.XMap[source]
Base class for a map.
- class pytuq.utils.maps.Standardizer(x)[source]
Bases:
LinearScaler
Standardizer map, linearly scaling data to zero mean and unit variance.
- class pytuq.utils.maps.Normalizer(x, nugget=0.0)[source]
Bases:
LinearScaler
Normalizer map, linearly scaling data to [0,1].
- class pytuq.utils.maps.Domainizer(dom)[source]
Bases:
LinearScaler
Domainizer map, linearly scaling data (assumed to be in [0,1]) to a given domain.
Note
This also can be accomplished by functions scaleDomTo01 and its inverse scale01ToDom.