# For example, to find the 5 approximate furthest neighbors with
# "reference_set" as the reference set and "query_set" as the query set using
# DrusillaSelect, storing the furthest neighbor indices to "neighbors" and
# the furthest neighbor distances to "distances", one could call
if (FALSE) {
output <- approx_kfn(query=query_set, reference=reference_set, k=5,
algorithm="ds")
neighbors <- output$neighbors
distances <- output$distances
}
# and to perform approximate all-furthest-neighbors search with k=1 on the
# set "data" storing only the furthest neighbor distances to "distances", one
# could call
if (FALSE) {
output <- approx_kfn(reference=reference_set, k=1)
distances <- output$distances
}
# A trained model can be re-used. If a model has been previously saved to
# "model", then we may find 3 approximate furthest neighbors on a query set
# "new_query_set" using that model and store the furthest neighbor indices
# into "neighbors" by calling
if (FALSE) {
output <- approx_kfn(input_model=model, query=new_query_set, k=3)
neighbors <- output$neighbors
}
Run the code above in your browser using DataLab