Class: Google::Apis::BigqueryV2::AggregateClassificationMetrics
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::AggregateClassificationMetrics
- 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
Aggregate metrics for classification/classifier models. For multi-class models, the metrics are either macro-averaged or micro-averaged. When macro-averaged, the metrics are calculated for each label and then an unweighted average is taken of those values. When micro-averaged, the metric is calculated globally by counting the total number of correctly predicted rows.
Instance Attribute Summary collapse
-
#accuracy ⇒ Float
Accuracy is the fraction of predictions given the correct label.
-
#f1_score ⇒ Float
The F1 score is an average of recall and precision.
-
#log_loss ⇒ Float
Logarithmic Loss.
-
#precision ⇒ Float
Precision is the fraction of actual positive predictions that had positive actual labels.
-
#recall ⇒ Float
Recall is the fraction of actual positive labels that were given a positive prediction.
-
#roc_auc ⇒ Float
Area Under a ROC Curve.
-
#threshold ⇒ Float
Threshold at which the metrics are computed.
Instance Method Summary collapse
-
#initialize(**args) ⇒ AggregateClassificationMetrics
constructor
A new instance of AggregateClassificationMetrics.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ AggregateClassificationMetrics
Returns a new instance of AggregateClassificationMetrics.
75 76 77 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 75 def initialize(**args) update!(**args) end |
Instance Attribute Details
#accuracy ⇒ Float
Accuracy is the fraction of predictions given the correct label. For
multiclass this is a micro-averaged metric.
Corresponds to the JSON property accuracy
37 38 39 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 37 def accuracy @accuracy end |
#f1_score ⇒ Float
The F1 score is an average of recall and precision. For multiclass this is a
macro-averaged metric.
Corresponds to the JSON property f1Score
43 44 45 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 43 def f1_score @f1_score end |
#log_loss ⇒ Float
Logarithmic Loss. For multiclass this is a macro-averaged metric.
Corresponds to the JSON property logLoss
48 49 50 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 48 def log_loss @log_loss end |
#precision ⇒ Float
Precision is the fraction of actual positive predictions that had positive
actual labels. For multiclass this is a macro-averaged metric treating each
class as a binary classifier.
Corresponds to the JSON property precision
55 56 57 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 55 def precision @precision end |
#recall ⇒ Float
Recall is the fraction of actual positive labels that were given a positive
prediction. For multiclass this is a macro-averaged metric.
Corresponds to the JSON property recall
61 62 63 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 61 def recall @recall end |
#roc_auc ⇒ Float
Area Under a ROC Curve. For multiclass this is a macro-averaged metric.
Corresponds to the JSON property rocAuc
66 67 68 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 66 def roc_auc @roc_auc end |
#threshold ⇒ Float
Threshold at which the metrics are computed. For binary classification models
this is the positive class threshold. For multi-class classfication models
this is the confidence threshold.
Corresponds to the JSON property threshold
73 74 75 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 73 def threshold @threshold end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
80 81 82 83 84 85 86 87 88 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 80 def update!(**args) @accuracy = args[:accuracy] if args.key?(:accuracy) @f1_score = args[:f1_score] if args.key?(:f1_score) @log_loss = args[:log_loss] if args.key?(:log_loss) @precision = args[:precision] if args.key?(:precision) @recall = args[:recall] if args.key?(:recall) @roc_auc = args[:roc_auc] if args.key?(:roc_auc) @threshold = args[:threshold] if args.key?(:threshold) end |