E

KMeansDistanceMetric

Provides constants for different distance metrics for the kMeansClustering.

Members

No filters for this type

Constants

Specifies the Chebyshev distance metric or L metric.
This is calculated by max(p1.x - p2.x) + abs(p1.y - p2.y)
static
Specifies the (squared) Euclidean distance metric or L² metric.
This is calculated by (p1.x - p2.x)^2 + (p1.y - p2.y)^2.
static
Specifies the Manhattan distance metric or L¹ metric.
This is calculated by abs(p1.x - p2.x) + abs(p1.y - p2.y)
static

Static Methods

Converts the given argument to an enum constant of this enum type.
Most notably, this method can convert an enum constant's name into the enum constant itself.
static

Parameters

value: KMeansDistanceMetric
The value to convert to an enum constant.

Return Value

KMeansDistanceMetric
The enum constant that corresponds to the given argument.
Returns the name of the given enum constant.
static

Parameters

value: KMeansDistanceMetric
The numeric value of an enum constant.

Return Value

string
The name of the enum constant.

Throws

Exception ({ name: 'Error' })
If this type is a flags enums, and the provided value doesn't correspond to a single enum constant, or if this enum type contains no constant of the given numeric value.