Google Cloud Ai Platform V1 Client - Class NearestNeighborQuery (0.37.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 Google\Cloud\AIPlatform\V1\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<Google\Cloud\AIPlatform\V1\NearestNeighborQuery\StringFilter>

Optional. The list of string 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 Google\Cloud\AIPlatform\V1\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
Google\Cloud\AIPlatform\V1\NearestNeighborQuery\Embedding|null

hasEmbedding

setEmbedding

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

Parameter
Name Description
var Google\Cloud\AIPlatform\V1\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<Google\Cloud\AIPlatform\V1\NearestNeighborQuery\StringFilter>
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
Google\Cloud\AIPlatform\V1\NearestNeighborQuery\Parameters|null

hasParameters

clearParameters

setParameters

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

Parameter
Name Description
var Google\Cloud\AIPlatform\V1\NearestNeighborQuery\Parameters
Returns
Type Description
$this

getInstance

Returns
Type Description
string