Class: Google::Apis::BigqueryV2::BinaryConfusionMatrix
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::BinaryConfusionMatrix
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/bigquery_v2/classes.rb,
lib/google/apis/bigquery_v2/representations.rb,
lib/google/apis/bigquery_v2/representations.rb
Overview
Confusion matrix for binary classification models.
Instance Attribute Summary collapse
-
#accuracy ⇒ Float
The fraction of predictions given the correct label.
-
#f1_score ⇒ Float
The equally weighted average of recall and precision.
-
#false_negatives ⇒ Fixnum
Number of false samples predicted as false.
-
#false_positives ⇒ Fixnum
Number of false samples predicted as true.
-
#positive_class_threshold ⇒ Float
Threshold value used when computing each of the following metric.
-
#precision ⇒ Float
The fraction of actual positive predictions that had positive actual labels.
-
#recall ⇒ Float
The fraction of actual positive labels that were given a positive prediction.
-
#true_negatives ⇒ Fixnum
Number of true samples predicted as false.
-
#true_positives ⇒ Fixnum
Number of true samples predicted as true.
Instance Method Summary collapse
-
#initialize(**args) ⇒ BinaryConfusionMatrix
constructor
A new instance of BinaryConfusionMatrix.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ BinaryConfusionMatrix
Returns a new instance of BinaryConfusionMatrix.
909 910 911 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 909 def initialize(**args) update!(**args) end |
Instance Attribute Details
#accuracy ⇒ Float
The fraction of predictions given the correct label.
Corresponds to the JSON property accuracy
867 868 869 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 867 def accuracy @accuracy end |
#f1_score ⇒ Float
The equally weighted average of recall and precision.
Corresponds to the JSON property f1Score
872 873 874 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 872 def f1_score @f1_score end |
#false_negatives ⇒ Fixnum
Number of false samples predicted as false.
Corresponds to the JSON property falseNegatives
877 878 879 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 877 def false_negatives @false_negatives end |
#false_positives ⇒ Fixnum
Number of false samples predicted as true.
Corresponds to the JSON property falsePositives
882 883 884 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 882 def false_positives @false_positives end |
#positive_class_threshold ⇒ Float
Threshold value used when computing each of the following metric.
Corresponds to the JSON property positiveClassThreshold
887 888 889 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 887 def positive_class_threshold @positive_class_threshold end |
#precision ⇒ Float
The fraction of actual positive predictions that had positive actual labels.
Corresponds to the JSON property precision
892 893 894 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 892 def precision @precision end |
#recall ⇒ Float
The fraction of actual positive labels that were given a positive prediction.
Corresponds to the JSON property recall
897 898 899 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 897 def recall @recall end |
#true_negatives ⇒ Fixnum
Number of true samples predicted as false.
Corresponds to the JSON property trueNegatives
902 903 904 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 902 def true_negatives @true_negatives end |
#true_positives ⇒ Fixnum
Number of true samples predicted as true.
Corresponds to the JSON property truePositives
907 908 909 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 907 def true_positives @true_positives end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
914 915 916 917 918 919 920 921 922 923 924 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 914 def update!(**args) @accuracy = args[:accuracy] if args.key?(:accuracy) @f1_score = args[:f1_score] if args.key?(:f1_score) @false_negatives = args[:false_negatives] if args.key?(:false_negatives) @false_positives = args[:false_positives] if args.key?(:false_positives) @positive_class_threshold = args[:positive_class_threshold] if args.key?(:positive_class_threshold) @precision = args[:precision] if args.key?(:precision) @recall = args[:recall] if args.key?(:recall) @true_negatives = args[:true_negatives] if args.key?(:true_negatives) @true_positives = args[:true_positives] if args.key?(:true_positives) end |