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.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ AggregateClassificationMetrics
Returns a new instance of AggregateClassificationMetrics.
78 79 80 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 78 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
38 39 40 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 38 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
44 45 46 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 44 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
49 50 51 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 49 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
56 57 58 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 56 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
62 63 64 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 62 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
68 69 70 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 68 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
76 77 78 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 76 def threshold @threshold end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
83 84 85 86 87 88 89 90 91 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 83 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 |