Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1FindNeighborsRequestQuery

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 the nearest neighbors (most similar vectors) of a vector.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1FindNeighborsRequestQuery

Returns a new instance of GoogleCloudAiplatformV1beta1FindNeighborsRequestQuery.



10618
10619
10620
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10618

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

Instance Attribute Details

#approximate_neighbor_countFixnum

The number of neighbors to find via approximate search before exact reordering is performed. If not set, the default value from scam config is used; if set, this value must be > 0. Corresponds to the JSON property approximateNeighborCount

Returns:

  • (Fixnum)


10580
10581
10582
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10580

def approximate_neighbor_count
  @approximate_neighbor_count
end

#datapointGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1IndexDatapoint

A datapoint of Index. Corresponds to the JSON property datapoint



10585
10586
10587
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10585

def datapoint
  @datapoint
end

#fraction_leaf_nodes_to_search_overrideFloat

The fraction of the number of leaves to search, set at query time allows user to tune search performance. This value increase result in both search accuracy and latency increase. The value should be between 0.0 and 1.0. If not set or set to 0.0, query uses the default value specified in NearestNeighborSearchConfig.TreeAHConfig.fraction_leaf_nodes_to_search. Corresponds to the JSON property fractionLeafNodesToSearchOverride

Returns:

  • (Float)


10594
10595
10596
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10594

def fraction_leaf_nodes_to_search_override
  @fraction_leaf_nodes_to_search_override
end

#neighbor_countFixnum

The number of nearest neighbors to be retrieved from database for each query. If not set, will use the default from the service configuration (https://cloud. google.com/vertex-ai/docs/matching-engine/configuring-indexes#nearest-neighbor- search-config). Corresponds to the JSON property neighborCount

Returns:

  • (Fixnum)


10602
10603
10604
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10602

def neighbor_count
  @neighbor_count
end

#per_crowding_attribute_neighbor_countFixnum

Crowding is a constraint on a neighbor list produced by nearest neighbor search requiring that no more than some value k' of the k neighbors returned have the same value of crowding_attribute. It's used for improving result diversity. This field is the maximum number of matches with the same crowding tag. Corresponds to the JSON property perCrowdingAttributeNeighborCount

Returns:

  • (Fixnum)


10611
10612
10613
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10611

def per_crowding_attribute_neighbor_count
  @per_crowding_attribute_neighbor_count
end

#rrfGoogle::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1FindNeighborsRequestQueryRrf

Parameters for RRF algorithm that combines search results. Corresponds to the JSON property rrf



10616
10617
10618
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10616

def rrf
  @rrf
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



10623
10624
10625
10626
10627
10628
10629
10630
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 10623

def update!(**args)
  @approximate_neighbor_count = args[:approximate_neighbor_count] if args.key?(:approximate_neighbor_count)
  @datapoint = args[:datapoint] if args.key?(:datapoint)
  @fraction_leaf_nodes_to_search_override = args[:fraction_leaf_nodes_to_search_override] if args.key?(:fraction_leaf_nodes_to_search_override)
  @neighbor_count = args[:neighbor_count] if args.key?(:neighbor_count)
  @per_crowding_attribute_neighbor_count = args[:per_crowding_attribute_neighbor_count] if args.key?(:per_crowding_attribute_neighbor_count)
  @rrf = args[:rrf] if args.key?(:rrf)
end