Class: Google::Apis::LanguageV1beta2::XpsConfidenceMetricsEntry

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/language_v1beta2/classes.rb,
lib/google/apis/language_v1beta2/representations.rb,
lib/google/apis/language_v1beta2/representations.rb

Overview

ConfidenceMetricsEntry includes generic precision, recall, f1 score etc. Next tag: 16.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ XpsConfidenceMetricsEntry

Returns a new instance of XpsConfidenceMetricsEntry.



1854
1855
1856
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1854

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

Instance Attribute Details

#confidence_thresholdFloat

Metrics are computed with an assumption that the model never return predictions with score lower than this value. Corresponds to the JSON property confidenceThreshold

Returns:

  • (Float)


1779
1780
1781
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1779

def confidence_threshold
  @confidence_threshold
end

#f1_scoreFloat

The harmonic mean of recall and precision. Corresponds to the JSON property f1Score

Returns:

  • (Float)


1784
1785
1786
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1784

def f1_score
  @f1_score
end

#f1_score_at1Float

The harmonic mean of recall_at1 and precision_at1. Corresponds to the JSON property f1ScoreAt1

Returns:

  • (Float)


1789
1790
1791
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1789

def f1_score_at1
  @f1_score_at1
end

#false_negative_countFixnum

The number of ground truth labels that are not matched by a model created label. Corresponds to the JSON property falseNegativeCount

Returns:

  • (Fixnum)


1795
1796
1797
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1795

def false_negative_count
  @false_negative_count
end

#false_positive_countFixnum

The number of model created labels that do not match a ground truth label. Corresponds to the JSON property falsePositiveCount

Returns:

  • (Fixnum)


1800
1801
1802
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1800

def false_positive_count
  @false_positive_count
end

#false_positive_rateFloat

False Positive Rate for the given confidence threshold. Corresponds to the JSON property falsePositiveRate

Returns:

  • (Float)


1805
1806
1807
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1805

def false_positive_rate
  @false_positive_rate
end

#false_positive_rate_at1Float

The False Positive Rate when only considering the label that has the highest prediction score and not below the confidence threshold for each example. Corresponds to the JSON property falsePositiveRateAt1

Returns:

  • (Float)


1811
1812
1813
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1811

def false_positive_rate_at1
  @false_positive_rate_at1
end

#position_thresholdFixnum

Metrics are computed with an assumption that the model always returns at most this many predictions (ordered by their score, descendingly), but they all still need to meet the confidence_threshold. Corresponds to the JSON property positionThreshold

Returns:

  • (Fixnum)


1818
1819
1820
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1818

def position_threshold
  @position_threshold
end

#precisionFloat

Precision for the given confidence threshold. Corresponds to the JSON property precision

Returns:

  • (Float)


1823
1824
1825
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1823

def precision
  @precision
end

#precision_at1Float

The precision when only considering the label that has the highest prediction score and not below the confidence threshold for each example. Corresponds to the JSON property precisionAt1

Returns:

  • (Float)


1829
1830
1831
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1829

def precision_at1
  @precision_at1
end

#recallFloat

Recall (true positive rate) for the given confidence threshold. Corresponds to the JSON property recall

Returns:

  • (Float)


1834
1835
1836
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1834

def recall
  @recall
end

#recall_at1Float

The recall (true positive rate) when only considering the label that has the highest prediction score and not below the confidence threshold for each example. Corresponds to the JSON property recallAt1

Returns:

  • (Float)


1841
1842
1843
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1841

def recall_at1
  @recall_at1
end

#true_negative_countFixnum

The number of labels that were not created by the model, but if they would, they would not match a ground truth label. Corresponds to the JSON property trueNegativeCount

Returns:

  • (Fixnum)


1847
1848
1849
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1847

def true_negative_count
  @true_negative_count
end

#true_positive_countFixnum

The number of model created labels that match a ground truth label. Corresponds to the JSON property truePositiveCount

Returns:

  • (Fixnum)


1852
1853
1854
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1852

def true_positive_count
  @true_positive_count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1859

def update!(**args)
  @confidence_threshold = args[:confidence_threshold] if args.key?(:confidence_threshold)
  @f1_score = args[:f1_score] if args.key?(:f1_score)
  @f1_score_at1 = args[:f1_score_at1] if args.key?(:f1_score_at1)
  @false_negative_count = args[:false_negative_count] if args.key?(:false_negative_count)
  @false_positive_count = args[:false_positive_count] if args.key?(:false_positive_count)
  @false_positive_rate = args[:false_positive_rate] if args.key?(:false_positive_rate)
  @false_positive_rate_at1 = args[:false_positive_rate_at1] if args.key?(:false_positive_rate_at1)
  @position_threshold = args[:position_threshold] if args.key?(:position_threshold)
  @precision = args[:precision] if args.key?(:precision)
  @precision_at1 = args[:precision_at1] if args.key?(:precision_at1)
  @recall = args[:recall] if args.key?(:recall)
  @recall_at1 = args[:recall_at1] if args.key?(:recall_at1)
  @true_negative_count = args[:true_negative_count] if args.key?(:true_negative_count)
  @true_positive_count = args[:true_positive_count] if args.key?(:true_positive_count)
end