Provides caching facility for query engines.
Notes
This QueryEngine simply remembers the results of the previous queries. Not much checking is done on either datasets it gets in train() is the same as the on in previous sweep of queries, i.e. either none of the relevant for underlying QueryEngine feature attributes was modified. So, CAUTION should be paid to avoid calling the same instance of CachedQueryEngine on different datasets (which might have different masking etc) .
query_byid() should be working reliably and without surprises.
query() relies on hashid of the queries, so there might be a collision! Thus consider it EXPERIMENTAL for now.
Methods
query(**kwargs) | Return feature ids of neighbors given a specific query |
query_byid(fid) | Return feature ids of neighbors for a given feature id |
train(dataset) | ‘Train’ CachedQueryEngine. |
untrain() | Forgetting that CachedQueryEngine was already trained |
Parameters: | queryengine : QueryEngine
|
---|
Methods
query(**kwargs) | Return feature ids of neighbors given a specific query |
query_byid(fid) | Return feature ids of neighbors for a given feature id |
train(dataset) | ‘Train’ CachedQueryEngine. |
untrain() | Forgetting that CachedQueryEngine was already trained |
Return feature ids of neighbors given a specific query
Return feature ids of neighbors for a given feature id
‘Train’ CachedQueryEngine.
Raises: | ValueError :
|
---|
Forgetting that CachedQueryEngine was already trained