Class: Google::Apis::AiplatformV1beta1::GoogleCloudAiplatformV1beta1DatasetCustomMetric

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

Defines a custom dataset-level aggregation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1beta1DatasetCustomMetric

Returns a new instance of GoogleCloudAiplatformV1beta1DatasetCustomMetric.



7348
7349
7350
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7348

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

Instance Attribute Details

#aggregation_functionString

Required. The Python code string containing the aggregation function. Expected function signature: def aggregate(instances: list[dict[str, Any]]) -> dict[ str, float]: The instances argument is a list of dictionaries, where each dictionary represents a single evaluation result item. The structure of each dictionary corresponds to the fields in the EvaluationResult message. This includes: - "request": Contains the original input data and model inputs ( from EvaluationResult.EvaluationRequest). - "candidate_results": Contains the results of any instance-level metrics (from EvaluationResult. CandidateResults). Example of a single item in the instances list: " request": "prompt": "text": "What is the capital of France?", " golden_response": "text": "Paris", "candidate_responses": ["candidate": " model-v1", "text": "Paris"] , "candidate_results": ["metric": "exact_match" , "score": 1.0,"metric": "bleu", "score": 0.9] Corresponds to the JSON property aggregationFunction

Returns:

  • (String)


7338
7339
7340
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7338

def aggregation_function
  @aggregation_function
end

#display_nameString

Optional. A display name for this custom summary metric. Used to prefix keys in the output summaryMetrics map. If not provided, a default name like " dataset_custom_metric_1", "dataset_custom_metric_2", etc., will be generated based on the order in the repeated field. Corresponds to the JSON property displayName

Returns:

  • (String)


7346
7347
7348
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7346

def display_name
  @display_name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7353
7354
7355
7356
# File 'lib/google/apis/aiplatform_v1beta1/classes.rb', line 7353

def update!(**args)
  @aggregation_function = args[:aggregation_function] if args.key?(:aggregation_function)
  @display_name = args[:display_name] if args.key?(:display_name)
end