Euclidean Distances
Euclidean distances are measures of proximity between points in standard Euclidean spaces.
EuclideanDistance Class
The abstract UQpy.utilities.distances.baseclass.EuclideanDistance
class is the base class for all Euclidean
distances in UQpy
. It provides a blueprint for classes in the euclidean_distances
module and allows
the user to define a set of methods that must be created within any child classes built from this abstract class.
The EuclideanDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.baseclass.EuclideanDistance import EuclideanDistance
List of Available Distances
All the distances classes below are subclasses of the EuclideanDistance
class.
Bray-Curtis Distance
The Bray-Curtis distance between two 1D arrays, x and y, is given by:
The BrayCurtisDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.BrayCurtisDistance import BrayCurtisDistance
Methods
One can use the following command to instantiate the BrayCurtisDistance
class.
Attributes
- BrayCurtisDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
Canberra Distance
The Canberra distance between two 1D arrays, x and y, is given by:
The CanberraDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CanberraDistance import CanberraDistance
Methods
One can use the following command to instantiate the CanberraDistance
class.
Attributes
- CanberraDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
Chebyshev Distance
The Chebyshev distance between two 1D arrays, x and y, is given by:
The ChebyshevDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.ChebyshevDistance import ChebyshevDistance
Methods
One can use the following command to instantiate the ChebyshevDistance
class:
Attributes
- ChebyshevDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
CityBlock Distance
The City Block (Manhattan) distance between two 1D arrays, x and y, is given by:
The CityBlockDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CityBlockDistance import CityBlockDistance
Methods
One can use the following command to instantiate the CityBlockDistance
class
Attributes
- CityBlockDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
Correlation Distance
The Correlation distance between two 1D arrays, x and y, is given by:
where \(\bar{x}\) denotes the mean of the elements of \(x\) and \(x\cdot y\) denotes the dot product.
The CorrelationDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CorrelationDistance import CorrelationDistance
Methods
One can use the following command to instantiate the class CorrelationDistance
Attributes
- CorrelationDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
Cosine Distance
The Cosine distance between two 1D arrays, x and y, is given by:
where \(x\cdot y\) denotes the dot product.
The CosineDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CosineDistance import CosineDistance
Methods
One can use the following command to instantiate the class CosineDistance
Attributes
- CosineDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
L2 Distance
The UQpy.utilities.distances.euclidean_distances.L2Distance
class is imported using the following command:
The L2 distance between two 1D arrays, x and y, is given by:
The UQpy.utilities.distances.euclidean_distances.L2Distance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.L2Distance import L2Distance
Methods
One can use the following command to instantiate the class UQpy.utilities.distances.euclidean_distances.L2Distance
Attributes
- L2Distance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points
Minkowski Distance
The Minkowski distance between two 1D arrays, x and y, is given by:
The MinkowskiDistance
class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.MinkowskiDistance import MinkowskiDistance
Methods
One can use the following command to instantiate the class MinkowskiDistance
Attributes
- MinkowskiDistance.distance_matrix: np.ndarray
Distance matrix defining the pairwise distances between the points