Package org.tribuo.math.neighbour
Interface NeighboursQueryFactory
- All Superinterfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,ProtoSerializable<org.tribuo.math.protos.NeighbourFactoryProto>
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,Serializable
- All Known Implementing Classes:
KDTreeFactory
,NeighboursBruteForceFactory
public interface NeighboursQueryFactory
extends com.oracle.labs.mlrg.olcut.config.Configurable, ProtoSerializable<org.tribuo.math.protos.NeighbourFactoryProto>, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, Serializable
An interface for factories which create nearest neighbour query objects.
-
Field Summary
Fields inherited from interface org.tribuo.protos.ProtoSerializable
DESERIALIZATION_METHOD_NAME, PROVENANCE_SERIALIZER
-
Method Summary
Modifier and TypeMethodDescriptioncreateNeighboursQuery
(SGDVector[] data) Constructs a nearest neighbour query object using the supplied array ofSGDVector
.static NeighboursQueryFactory
deserialize
(org.tribuo.math.protos.NeighbourFactoryProto proto) Deserialization helper for NeighboursQueryFactories.Gets theDistance
set on this object.int
Get the number of threads set on this object.default com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
Methods inherited from interface org.tribuo.protos.ProtoSerializable
serialize
-
Method Details
-
createNeighboursQuery
Constructs a nearest neighbour query object using the supplied array ofSGDVector
.- Parameters:
data
- An array ofSGDVector
.- Returns:
- A query object.
-
getDistance
Distance getDistance()Gets theDistance
set on this object.- Returns:
- The distance function.
-
getNumThreads
int getNumThreads()Get the number of threads set on this object. There could be factory implementations that are sequential, meaning they are single threaded.- Returns:
- The number of threads used to parallelize the query operation.
-
getProvenance
default com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-
deserialize
Deserialization helper for NeighboursQueryFactories.- Parameters:
proto
- The proto to deserialize.- Returns:
- The query factory.
-