# For example, the following command will calculate, for each point in the
# query set "query", the five points in the reference set "reference" with
# maximum kernel evaluation using the linear kernel. The kernel evaluations
# may be saved with the "kernels" output parameter and the indices may be
# saved with the "indices" output parameter.
if (FALSE) {
output <- fastmks(k=5, reference=reference, query=query, kernel="linear")
indices <- output$indices
kernels <- output$kernels
}
# The output matrices are organized such that row i and column j in the
# indices matrix corresponds to the index of the point in the reference set
# that has j'th largest kernel evaluation with the point in the query set
# with index i. Row i and column j in the kernels matrix corresponds to the
# kernel evaluation between those two points.
#
# This program performs FastMKS using a cover tree. The base used to build
# the cover tree can be specified with the "base" parameter.
Run the code above in your browser using DataLab