Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1NearestNeighborQuery

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/aiplatform_v1beta1/classes.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb,
lib/google/apis/aiplatform_v1beta1/representations.rb

Overview

A query to find a number of similar entities.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1NearestNeighborQuery

Returns a new instance of GoogleCloudAiplatformV1beta1NearestNeighborQuery.



21181
21182
21183
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21181

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#embeddingGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1NearestNeighborQueryEmbedding

The embedding vector. Corresponds to the JSON property embedding



21143
21144
21145
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21143

def embedding
  @embedding
end

#entity_idString

Optional. The entity id whose similar entities should be searched for. If embedding is set, search will use embedding instead of entity_id. Corresponds to the JSON property entityId

Returns:

  • (String)


21149
21150
21151
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21149

def entity_id
  @entity_id
end

#neighbor_countFixnum

Optional. The number of similar entities to be retrieved from feature view for each query. Corresponds to the JSON property neighborCount

Returns:

  • (Fixnum)


21155
21156
21157
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21155

def neighbor_count
  @neighbor_count
end

#numeric_filtersArray<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1NearestNeighborQueryNumericFilter>

Optional. The list of numeric filters. Corresponds to the JSON property numericFilters



21160
21161
21162
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21160

def numeric_filters
  @numeric_filters
end

#parametersGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1NearestNeighborQueryParameters

Parameters that can be overrided in each query to tune query latency and recall. Corresponds to the JSON property parameters



21166
21167
21168
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21166

def parameters
  @parameters
end

#per_crowding_attribute_neighbor_countFixnum

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. Corresponds to the JSON property perCrowdingAttributeNeighborCount

Returns:

  • (Fixnum)


21174
21175
21176
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21174

def per_crowding_attribute_neighbor_count
  @per_crowding_attribute_neighbor_count
end

#string_filtersArray<Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1NearestNeighborQueryStringFilter>

Optional. The list of string filters. Corresponds to the JSON property stringFilters



21179
21180
21181
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21179

def string_filters
  @string_filters
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



21186
21187
21188
21189
21190
21191
21192
21193
21194
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 21186

def update!(**args)
  @embedding = args[:embedding] if args.key?(:embedding)
  @entity_id = args[:entity_id] if args.key?(:entity_id)
  @neighbor_count = args[:neighbor_count] if args.key?(:neighbor_count)
  @numeric_filters = args[:numeric_filters] if args.key?(:numeric_filters)
  @parameters = args[:parameters] if args.key?(:parameters)
  @per_crowding_attribute_neighbor_count = args[:per_crowding_attribute_neighbor_count] if args.key?(:per_crowding_attribute_neighbor_count)
  @string_filters = args[:string_filters] if args.key?(:string_filters)
end