Class: Google::Apis::BigqueryV2::RankingMetrics
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::RankingMetrics
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/bigquery_v2/classes.rb,
generated/google/apis/bigquery_v2/representations.rb,
generated/google/apis/bigquery_v2/representations.rb
Overview
Evaluation metrics used by weighted-ALS models specified by feedback_type= implicit.
Instance Attribute Summary collapse
-
#average_rank ⇒ Float
Determines the goodness of a ranking by computing the percentile rank from the predicted confidence and dividing it by the original rank.
-
#mean_average_precision ⇒ Float
Calculates a precision per user for all the items by ranking them and then averages all the precisions across all the users.
-
#mean_squared_error ⇒ Float
Similar to the mean squared error computed in regression and explicit recommendation models except instead of computing the rating directly, the output from evaluate is computed against a preference which is 1 or 0 depending on if the rating exists or not.
-
#normalized_discounted_cumulative_gain ⇒ Float
A metric to determine the goodness of a ranking calculated from the predicted confidence by comparing it to an ideal rank measured by the original ratings.
Instance Method Summary collapse
-
#initialize(**args) ⇒ RankingMetrics
constructor
A new instance of RankingMetrics.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ RankingMetrics
Returns a new instance of RankingMetrics.
5177 5178 5179 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5177 def initialize(**args) update!(**args) end |
Instance Attribute Details
#average_rank ⇒ Float
Determines the goodness of a ranking by computing the percentile rank from the
predicted confidence and dividing it by the original rank.
Corresponds to the JSON property averageRank
5155 5156 5157 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5155 def average_rank @average_rank end |
#mean_average_precision ⇒ Float
Calculates a precision per user for all the items by ranking them and then
averages all the precisions across all the users.
Corresponds to the JSON property meanAveragePrecision
5161 5162 5163 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5161 def mean_average_precision @mean_average_precision end |
#mean_squared_error ⇒ Float
Similar to the mean squared error computed in regression and explicit
recommendation models except instead of computing the rating directly, the
output from evaluate is computed against a preference which is 1 or 0
depending on if the rating exists or not.
Corresponds to the JSON property meanSquaredError
5169 5170 5171 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5169 def mean_squared_error @mean_squared_error end |
#normalized_discounted_cumulative_gain ⇒ Float
A metric to determine the goodness of a ranking calculated from the predicted
confidence by comparing it to an ideal rank measured by the original ratings.
Corresponds to the JSON property normalizedDiscountedCumulativeGain
5175 5176 5177 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5175 def normalized_discounted_cumulative_gain @normalized_discounted_cumulative_gain end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5182 5183 5184 5185 5186 5187 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5182 def update!(**args) @average_rank = args[:average_rank] if args.key?(:average_rank) @mean_average_precision = args[:mean_average_precision] if args.key?(:mean_average_precision) @mean_squared_error = args[:mean_squared_error] if args.key?(:mean_squared_error) @normalized_discounted_cumulative_gain = args[:normalized_discounted_cumulative_gain] if args.key?(:normalized_discounted_cumulative_gain) end |