Skip to content

[source]

Minkowski#

The Minkowski distance can be considered as a generalization of both the Euclidean and Manhattan distances. When the lambda parameter is set to 1 or 2, the distance is equivalent to Manhattan and Euclidean respectively.

Minkowski(a,b)=(i=1n|aibi|p)1p

Data Type Compatibility: Continuous

Parameters#

# Name Default Type Description
1 lambda 3.0 float Controls the curvature of the unit circle drawn from a point at a fixed distance.

Example#

use Rubix\ML\Kernels\Distance\Minkowski;

$kernel = new Minkowski(4.0);