diff --git a/examples/ml/knn.kg b/examples/ml/knn.kg new file mode 100644 index 0000000..35141d0 --- /dev/null +++ b/examples/ml/knn.kg @@ -0,0 +1,20 @@ +:" euclidean distance " +ed::{[d];d::x-y;({+/x}'d*d)^0.5} + +:" compute knn between point x and data y " +knn::{[distances];distances::ed(y;z);x#