Title

Global

Members

constant utils

Class used to handle distances functions

View Source knn/distances/distances.js, line 21

Example
//new instance
let distances = new Distances();
//define two points
let point1 = [1,3];
let point2 = [4,-2];
//minkowski distance from two points
let minkowski_distance = distances.minkowski(point1,point2);
//chebyshev distance from two points
let chebyshev_distance = distances.chebyshev(point1,point2);
//mahalanobis distance from two points
let mahalanobis_distance = distances.mahalanobis(point1,point2);
//setting the grade for minkowski
distances.setMinkowskiDegree(2);