You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/16 20:40:18 UTC
[jira] [Commented] (FLINK-1745) Add exact k-nearest-neighbours
algorithm to machine learning library
[ https://issues.apache.org/jira/browse/FLINK-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15149173#comment-15149173 ]
ASF GitHub Bot commented on FLINK-1745:
---------------------------------------
Github user danielblazevski commented on the pull request:
https://github.com/apache/flink/pull/1220#issuecomment-184847163
Hi @chiwanpark sorry for the delay! I will now have more time to wrap this PR up. I added a check just before calling `knn`:
```scala
if (useQuadTree) {
if (metric.isInstanceOf[EuclideanDistanceMetric] ||
metric.isInstanceOf[SquaredEuclideanDistanceMetric]){
knnQueryWithQuadTree(training.values, testing.values, k, metric, queue, out)
} else {
throw new IllegalArgumentException(s" Error: metric must be" +
s" Euclidean or SquaredEuclidean!")
}
} else {
knnQueryBasic(training.values, testing.values, k, metric, queue, out)
}
}
}
}
```
Does that work? The commit includes the hint for the cross operation as well.
> Add exact k-nearest-neighbours algorithm to machine learning library
> --------------------------------------------------------------------
>
> Key: FLINK-1745
> URL: https://issues.apache.org/jira/browse/FLINK-1745
> Project: Flink
> Issue Type: New Feature
> Components: Machine Learning Library
> Reporter: Till Rohrmann
> Assignee: Daniel Blazevski
> Labels: ML, Starter
>
> Even though the k-nearest-neighbours (kNN) [1,2] algorithm is quite trivial it is still used as a mean to classify data and to do regression. This issue focuses on the implementation of an exact kNN (H-BNLJ, H-BRJ) algorithm as proposed in [2].
> Could be a starter task.
> Resources:
> [1] [http://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm]
> [2] [https://www.cs.utah.edu/~lifeifei/papers/mrknnj.pdf]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)