Class: Google::Apis::AiplatformV1::GoogleCloudAiplatformV1Metric

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

Overview

The metric used for running evaluations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAiplatformV1Metric

Returns a new instance of GoogleCloudAiplatformV1Metric.



21141
21142
21143
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21141

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

Instance Attribute Details

#aggregation_metricsArray<String>

Optional. The aggregation metrics to use. Corresponds to the JSON property aggregationMetrics

Returns:

  • (Array<String>)


21091
21092
21093
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21091

def aggregation_metrics
  @aggregation_metrics
end

#bleu_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1BleuSpec

Spec for bleu score metric - calculates the precision of n-grams in the prediction as compared to reference - returns a score ranging between 0 to 1. Corresponds to the JSON property bleuSpec



21097
21098
21099
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21097

def bleu_spec
  @bleu_spec
end

#computation_based_metric_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1ComputationBasedMetricSpec

Specification for a computation based metric. Corresponds to the JSON property computationBasedMetricSpec



21102
21103
21104
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21102

def computation_based_metric_spec
  @computation_based_metric_spec
end

#custom_code_execution_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1CustomCodeExecutionSpec

Specificies a metric that is populated by evaluating user-defined Python code. Corresponds to the JSON property customCodeExecutionSpec



21107
21108
21109
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21107

def custom_code_execution_spec
  @custom_code_execution_spec
end

#exact_match_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1ExactMatchSpec

Spec for exact match metric - returns 1 if prediction and reference exactly matches, otherwise 0. Corresponds to the JSON property exactMatchSpec



21113
21114
21115
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21113

def exact_match_spec
  @exact_match_spec
end

#llm_based_metric_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1LlmBasedMetricSpec

Specification for an LLM based metric. Corresponds to the JSON property llmBasedMetricSpec



21118
21119
21120
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21118

def llm_based_metric_spec
  @llm_based_metric_spec
end

#pairwise_metric_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1PairwiseMetricSpec

Spec for pairwise metric. Corresponds to the JSON property pairwiseMetricSpec



21123
21124
21125
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21123

def pairwise_metric_spec
  @pairwise_metric_spec
end

#pointwise_metric_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1PointwiseMetricSpec

Spec for pointwise metric. Corresponds to the JSON property pointwiseMetricSpec



21128
21129
21130
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21128

def pointwise_metric_spec
  @pointwise_metric_spec
end

#predefined_metric_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1PredefinedMetricSpec

The spec for a pre-defined metric. Corresponds to the JSON property predefinedMetricSpec



21133
21134
21135
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21133

def predefined_metric_spec
  @predefined_metric_spec
end

#rouge_specGoogle::Apis::AiplatformV1::GoogleCloudAiplatformV1RougeSpec

Spec for rouge score metric - calculates the recall of n-grams in prediction as compared to reference - returns a score ranging between 0 and 1. Corresponds to the JSON property rougeSpec



21139
21140
21141
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21139

def rouge_spec
  @rouge_spec
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
# File 'lib/google/apis/aiplatform_v1/classes.rb', line 21146

def update!(**args)
  @aggregation_metrics = args[:aggregation_metrics] if args.key?(:aggregation_metrics)
  @bleu_spec = args[:bleu_spec] if args.key?(:bleu_spec)
  @computation_based_metric_spec = args[:computation_based_metric_spec] if args.key?(:computation_based_metric_spec)
  @custom_code_execution_spec = args[:custom_code_execution_spec] if args.key?(:custom_code_execution_spec)
  @exact_match_spec = args[:exact_match_spec] if args.key?(:exact_match_spec)
  @llm_based_metric_spec = args[:llm_based_metric_spec] if args.key?(:llm_based_metric_spec)
  @pairwise_metric_spec = args[:pairwise_metric_spec] if args.key?(:pairwise_metric_spec)
  @pointwise_metric_spec = args[:pointwise_metric_spec] if args.key?(:pointwise_metric_spec)
  @predefined_metric_spec = args[:predefined_metric_spec] if args.key?(:predefined_metric_spec)
  @rouge_spec = args[:rouge_spec] if args.key?(:rouge_spec)
end