Euclidean distances are measures of proximity between points in standard Euclidean spaces.
The abstract :class:`UQpy.utilities.distances.baseclass.EuclideanDistance` class is the base class for all Euclidean distances in :py:mod:`UQpy`. It provides a blueprint for classes in the :mod:`.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.
.. autoclass:: UQpy.utilities.distances.baseclass.EuclideanDistance :members: calculate_distance_matrix
The :class:`.EuclideanDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.baseclass.EuclideanDistance import EuclideanDistance
All the distances classes below are subclasses of the :class:`.EuclideanDistance` class.
The Bray-Curtis distance between two 1D arrays, x and y, is given by:
d(x,y) = \dfrac{\sum_i |x_i - y_i|}{\sum_i |x_i + y_i|}
The :class:`.BrayCurtisDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.BrayCurtisDistance import BrayCurtisDistance
One can use the following command to instantiate the :class:`.BrayCurtisDistance` class.
.. autoclass:: UQpy.utilities.distances.euclidean_distances.BrayCurtisDistance :members:
.. autoattribute:: UQpy.utilities.distances.BrayCurtisDistance.distance_matrix
The Canberra distance between two 1D arrays, x and y, is given by:
d(x,y) = \sum_i \dfrac{|x_i - y_i|}{|x_i| + |y_i|}
The :class:`.CanberraDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CanberraDistance import CanberraDistance
One can use the following command to instantiate the :class:`.CanberraDistance` class.
.. autoclass:: UQpy.utilities.distances.euclidean_distances.CanberraDistance :members:
.. autoattribute:: UQpy.utilities.distances.CanberraDistance.distance_matrix
The Chebyshev distance between two 1D arrays, x and y, is given by:
d(x,y) = \max_i |x_i-y_i|
The :class:`.ChebyshevDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.ChebyshevDistance import ChebyshevDistance
One can use the following command to instantiate the :class:`.ChebyshevDistance` class:
.. autoclass:: UQpy.utilities.distances.euclidean_distances.ChebyshevDistance :members:
.. autoattribute:: UQpy.utilities.distances.ChebyshevDistance.distance_matrix
The City Block (Manhattan) distance between two 1D arrays, x and y, is given by:
d(x,y) = \sum_i |x_i - y_i|
The :class:`.CityBlockDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CityBlockDistance import CityBlockDistance
One can use the following command to instantiate the :class:`.CityBlockDistance` class
.. autoclass:: UQpy.utilities.distances.euclidean_distances.CityBlockDistance :members:
.. autoattribute:: UQpy.utilities.distances.CityBlockDistance.distance_matrix
The Correlation distance between two 1D arrays, x and y, is given by:
d(x,y) = 1 - \dfrac{(x-\bar{x})\cdot(y-\bar{y})}{||x-\bar{x}||_2||y-\bar{y}||_2}
where \bar{x} denotes the mean of the elements of x and x\cdot y denotes the dot product.
The :class:`.CorrelationDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CorrelationDistance import CorrelationDistance
One can use the following command to instantiate the class :class:`.CorrelationDistance`
.. autoclass:: UQpy.utilities.distances.euclidean_distances.CorrelationDistance :members:
.. autoattribute:: UQpy.utilities.distances.euclidean_distances.CorrelationDistance.distance_matrix
The Cosine distance between two 1D arrays, x and y, is given by:
d(x,y) = 1 - \dfrac{x\cdot y}{||x||_2||y||_2}
where x\cdot y denotes the dot product.
The :class:`.CosineDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.CosineDistance import CosineDistance
One can use the following command to instantiate the class :class:`.CosineDistance`
.. autoclass:: UQpy.utilities.distances.euclidean_distances.CosineDistance :members:
.. autoattribute:: UQpy.utilities.distances.euclidean_distances.CosineDistance.distance_matrix
The :class:`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:
d(x,y) = ||x - y||_2
The :class:`UQpy.utilities.distances.euclidean_distances.L2Distance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.L2Distance import L2Distance
One can use the following command to instantiate the class :class:`UQpy.utilities.distances.euclidean_distances.L2Distance`
.. autoclass:: UQpy.utilities.distances.euclidean_distances.L2Distance :members:
.. autoattribute:: UQpy.utilities.distances.euclidean_distances.L2Distance.distance_matrix
The Minkowski distance between two 1D arrays, x and y, is given by:
d(x,y) = ||x - y||_p = \left(\sum_i |x_i-y_i|^p \right)^{1/p}.
The :class:`.MinkowskiDistance` class is imported using the following command:
>>> from UQpy.utilities.distances.euclidean_distances.MinkowskiDistance import MinkowskiDistance
One can use the following command to instantiate the class :class:`.MinkowskiDistance`
.. autoclass:: UQpy.utilities.distances.euclidean_distances.MinkowskiDistance :members:
.. autoattribute:: UQpy.utilities.distances.euclidean_distances.MinkowskiDistance.distance_matrix