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.

Data Type Compatibility: Continuous


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


use Rubix\ML\Kernels\Distance\Minkowski;

$kernel = new Minkowski(4.0);