Google Cloud Ai Platform V1 Client - Class NearestNeighborQuery (1.13.1)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class NearestNeighborQuery.

A query to find a number of similar entities.

Generated from protobuf message google.cloud.aiplatform.v1.NearestNeighborQuery

Namespace

Google \ Cloud \ AIPlatform \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ entity_id string

Optional. The entity id whose similar entities should be searched for. If embedding is set, search will use embedding instead of entity_id.

↳ embedding NearestNeighborQuery\Embedding

Optional. The embedding vector that be used for similar search.

↳ neighbor_count int

Optional. The number of similar entities to be retrieved from feature view for each query.

↳ string_filters array<NearestNeighborQuery\StringFilter>

Optional. The list of string filters.

↳ numeric_filters array<NearestNeighborQuery\NumericFilter>

Optional. The list of numeric filters.

↳ per_crowding_attribute_neighbor_count int

Optional. Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than sper_crowding_attribute_neighbor_count of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity.

↳ parameters NearestNeighborQuery\Parameters

Optional. Parameters that can be set to tune query on the fly.

getEntityId

Optional. The entity id whose similar entities should be searched for.

If embedding is set, search will use embedding instead of entity_id.

Returns
Type Description
string

hasEntityId

setEntityId

Optional. The entity id whose similar entities should be searched for.

If embedding is set, search will use embedding instead of entity_id.

Parameter
Name Description
var string
Returns
Type Description
$this

getEmbedding

Optional. The embedding vector that be used for similar search.

Returns
Type Description
NearestNeighborQuery\Embedding|null

hasEmbedding

setEmbedding

Optional. The embedding vector that be used for similar search.

Parameter
Name Description
var NearestNeighborQuery\Embedding
Returns
Type Description
$this

getNeighborCount

Optional. The number of similar entities to be retrieved from feature view for each query.

Returns
Type Description
int

setNeighborCount

Optional. The number of similar entities to be retrieved from feature view for each query.

Parameter
Name Description
var int
Returns
Type Description
$this

getStringFilters

Optional. The list of string filters.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setStringFilters

Optional. The list of string filters.

Parameter
Name Description
var array<NearestNeighborQuery\StringFilter>
Returns
Type Description
$this

getNumericFilters

Optional. The list of numeric filters.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setNumericFilters

Optional. The list of numeric filters.

Parameter
Name Description
var array<NearestNeighborQuery\NumericFilter>
Returns
Type Description
$this

getPerCrowdingAttributeNeighborCount

Optional. Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than sper_crowding_attribute_neighbor_count of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity.

Returns
Type Description
int

setPerCrowdingAttributeNeighborCount

Optional. Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than sper_crowding_attribute_neighbor_count of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity.

Parameter
Name Description
var int
Returns
Type Description
$this

getParameters

Optional. Parameters that can be set to tune query on the fly.

Returns
Type Description
NearestNeighborQuery\Parameters|null

hasParameters

clearParameters

setParameters

Optional. Parameters that can be set to tune query on the fly.

Parameter
Name Description
var NearestNeighborQuery\Parameters
Returns
Type Description
$this

getInstance

Returns
Type Description
string