Class: Google::Apis::BigqueryV2::BinaryConfusionMatrix

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ BinaryConfusionMatrix

Returns a new instance of BinaryConfusionMatrix.



1079
1080
1081
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1079

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

Instance Attribute Details

#accuracyFloat

The fraction of predictions given the correct label. Corresponds to the JSON property accuracy

Returns:

  • (Float)


1037
1038
1039
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1037

def accuracy
  @accuracy
end

#f1_scoreFloat

The equally weighted average of recall and precision. Corresponds to the JSON property f1Score

Returns:

  • (Float)


1042
1043
1044
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1042

def f1_score
  @f1_score
end

#false_negativesFixnum

Number of false samples predicted as false. Corresponds to the JSON property falseNegatives

Returns:

  • (Fixnum)


1047
1048
1049
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1047

def false_negatives
  @false_negatives
end

#false_positivesFixnum

Number of false samples predicted as true. Corresponds to the JSON property falsePositives

Returns:

  • (Fixnum)


1052
1053
1054
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1052

def false_positives
  @false_positives
end

#positive_class_thresholdFloat

Threshold value used when computing each of the following metric. Corresponds to the JSON property positiveClassThreshold

Returns:

  • (Float)


1057
1058
1059
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1057

def positive_class_threshold
  @positive_class_threshold
end

#precisionFloat

The fraction of actual positive predictions that had positive actual labels. Corresponds to the JSON property precision

Returns:

  • (Float)


1062
1063
1064
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1062

def precision
  @precision
end

#recallFloat

The fraction of actual positive labels that were given a positive prediction. Corresponds to the JSON property recall

Returns:

  • (Float)


1067
1068
1069
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1067

def recall
  @recall
end

#true_negativesFixnum

Number of true samples predicted as false. Corresponds to the JSON property trueNegatives

Returns:

  • (Fixnum)


1072
1073
1074
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1072

def true_negatives
  @true_negatives
end

#true_positivesFixnum

Number of true samples predicted as true. Corresponds to the JSON property truePositives

Returns:

  • (Fixnum)


1077
1078
1079
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1077

def true_positives
  @true_positives
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
# File 'lib/google/apis/bigquery_v2/classes.rb', line 1084

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