|
|
# Approximate furthest neighbor search
|
|
|
|
|
|
An implementation of two strategies for furthest neighbor search. This can be used to compute the furthest neighbor of query point(s) from a set of points.
|
|
|
|
|
|
# Available Predicates
|
|
|
|
|
|
* [initDrusillaModelNoTrain/2](/PrologMethods/Geometry/approx_kfn#initdrusillamodelnotrain2)
|
|
|
* [initDrusillaModelWithTrain/5](/PrologMethods/Geometry/approx_kfn#initdrusillamodelwithtrain5)
|
|
|
* [searchDrusilla/10](/PrologMethods/Geometry/approx_kfn#searchdrusilla10)
|
|
|
* [trainDrusilla/5](/PrologMethods/Geometry/approx_kfn#traindrusilla5)
|
|
|
* [initQDAFNModelNoTrain/2](/PrologMethods/Geometry/approx_kfn#initqdafnmodelnotrain2)
|
|
|
* [initQDAFNModelWithTrain/5](/PrologMethods/Geometry/approx_kfn#initqdafnmodelwithtrain5)
|
|
|
* [searchQDAFN/10](/PrologMethods/Geometry/approx_kfn#searchqdafn10)
|
|
|
* [trainQDAFN/5](/PrologMethods/Geometry/approx_kfn#trainqdafn5)
|
|
|
|
|
|
---
|
|
|
|
|
|
[links/resources](/PrologMethods/Geometry/approx_kfn#connected-linksresources)
|
|
|
|
|
|
## **_initDrusillaModelNoTrain/2_**
|
|
|
|
|
|
Initiates the DrusillaSearch Model but doesn’t train it.
|
|
|
|
|
|
**trainDrusilla** has to be used before **searchDrusilla** can be used.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the definition
|
|
|
initDrusillaModelNoTrain( +integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_initDrusillaModelWithTrain/5_**
|
|
|
|
|
|
Initiates the DrusillaSearch Model and trains it with the given reference Set.
|
|
|
|
|
|
Afterwards **searchDrusilla** can be used.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the definition
|
|
|
initDrusillaModelWithTrain( +pointer(float_array), +integer, +integer,
|
|
|
+integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| referenceSet | +matrix | Matrix containing the reference dataset | - |
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_searchDrusilla/10_**
|
|
|
|
|
|
Kurze beschreibung evt. hinweise
|
|
|
|
|
|
```prolog
|
|
|
%% part of the predicate definition
|
|
|
searchDrusilla( +pointer(float_array), +integer, +integer,
|
|
|
+integer,
|
|
|
-pointer(float_array), -integer, -integer,
|
|
|
-pointer(float_array), -integer, -integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| querySet | +matrix | Matrix containing query points | - |
|
|
|
| k | +integer | Number of furthest neighbors to search for | 0 |
|
|
|
| neighbors | -matrix | Matrix to save furthest neighbor distances to | - |
|
|
|
| distance | -matrix | Matrix to save neighbor indices to | - |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_trainDrusilla/5_**
|
|
|
|
|
|
Trains the DrusillaSearch Model with the given reference Set.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the predicate definition
|
|
|
trainDrusilla( +pointer(float_array), +integer, +integer,
|
|
|
+integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| referenceSet | +matrix | Matrix containing the reference dataset | - |
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_initQDAFNModelNoTrain/2_**
|
|
|
|
|
|
Initiates the QDAFNSearch Model but doesn’t train it.
|
|
|
|
|
|
**trainQDAFN** has to be used before **searchQDAFN** can be used.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the definition
|
|
|
initQDAFNModelNoTrain( +integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_initQDAFNModelWithTrain/5_**
|
|
|
|
|
|
Initiates the QDAFNSearch Model and trains it with the given reference Set.
|
|
|
|
|
|
Afterwards **searchQDAFN** can be used.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the definition
|
|
|
initQDAFNModelWithTrain( +pointer(float_array), +integer, +integer,
|
|
|
+integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| referenceSet | +matrix | Matrix containing the reference dataset | - |
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_searchQDAFN/10_**
|
|
|
|
|
|
Kurze beschreibung evt. hinweise
|
|
|
|
|
|
```prolog
|
|
|
%% part of the predicate definition
|
|
|
searchQDAFN( +pointer(float_array), +integer, +integer,
|
|
|
+integer,
|
|
|
-pointer(float_array), -integer, -integer,
|
|
|
-pointer(float_array), -integer, -integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| querySet | +matrix | Matrix containing query points | - |
|
|
|
| k | +integer | Number of furthest neighbors to search for | 0 |
|
|
|
| neighbors | -matrix | Matrix to save furthest neighbor distances to | - |
|
|
|
| distance | -matrix | Matrix to save neighbor indices to | - |
|
|
|
|
|
|
---
|
|
|
|
|
|
## **_trainQDAFN/5_**
|
|
|
|
|
|
Trains the QDAFNSearch Model with the given reference Set.
|
|
|
|
|
|
```prolog
|
|
|
%% part of the predicate definition
|
|
|
trainQDAFN( +pointer(float_array), +integer, +integer,
|
|
|
+integer, +integer).
|
|
|
```
|
|
|
|
|
|
### Parameters
|
|
|
| Name | Type | Description | Default |
|
|
|
|------|------|-------------|---------|
|
|
|
| referenceSet | +matrix | Matrix containing the reference dataset | - |
|
|
|
| l | +integer | Number of projections | 5 |
|
|
|
| m | +integer | Number of elements to store for each projection | 5 |
|
|
|
|
|
|
---
|
|
|
|
|
|
# Connected Links/Resources
|
|
|
|
|
|
If you want a more detailed explanation, then go to the python documentation. There is most of the time a good explanation on how the methods work and what the parameters do.
|
|
|
|
|
|
* [MLpack::DrusillaSearch_C++\_documentation](https://www.mlpack.org/doc/stable/doxygen/classmlpack_1_1neighbor_1_1DrusillaSelect.html)
|
|
|
* [MLpack::QDAFN_C++\_documentation](https://www.mlpack.org/doc/stable/doxygen/classmlpack_1_1neighbor_1_1QDAFN.html)
|
|
|
* [MLpack::Approx_KFN_Python_documentation](https://www.mlpack.org/doc/stable/python_documentation.html#approx_kfn)
|
|
|
|
|
|
added some of the links from the python documentation
|
|
|
|
|
|
* [k-furthest-neighbor search](https://www.mlpack.org/doc/stable/kfn)
|
|
|
* [k-nearest-neighbor search](https://www.mlpack.org/doc/stable/knn)
|
|
|
* [Fast approximate furthest neighbors with data-dependent candidate selection (pdf)](http://ratml.org/pub/pdf/2016fast.pdf)
|
|
|
* [Approximate furthest neighbor in high dimensions (pdf)](https://pdfs.semanticscholar.org/a4b5/7b9cbf37201fb1d9a56c0f4eefad04669c20.pdf) |
|
|
\ No newline at end of file |