Class: Google::Apis::LanguageV2::XpsConfusionMatrix

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

Overview

Confusion matrix of the model running the classification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ XpsConfusionMatrix

Returns a new instance of XpsConfusionMatrix.



1611
1612
1613
# File 'lib/google/apis/language_v2/classes.rb', line 1611

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

Instance Attribute Details

#annotation_spec_id_tokenArray<String>

For the following three repeated fields, only one is intended to be set. annotation_spec_id_token is preferable to be set. ID tokens of the annotation specs used in the confusion matrix. Corresponds to the JSON property annotationSpecIdToken

Returns:

  • (Array<String>)


1588
1589
1590
# File 'lib/google/apis/language_v2/classes.rb', line 1588

def annotation_spec_id_token
  @annotation_spec_id_token
end

#categoryArray<Fixnum>

Category (mainly for segmentation). Set only for image segmentation models. Note: uCAIP Image Segmentation should use annotation_spec_id_token. Corresponds to the JSON property category

Returns:

  • (Array<Fixnum>)


1594
1595
1596
# File 'lib/google/apis/language_v2/classes.rb', line 1594

def category
  @category
end

#rowArray<Google::Apis::LanguageV2::XpsConfusionMatrixRow>

Rows in the confusion matrix. The number of rows is equal to the size of annotation_spec_id_token. row[i].value[j] is the number of examples that have ground truth of the annotation_spec_id_token[i] and are predicted as annotation_spec_id_token[j] by the model being evaluated. Corresponds to the JSON property row



1602
1603
1604
# File 'lib/google/apis/language_v2/classes.rb', line 1602

def row
  @row
end

#sentiment_labelArray<Fixnum>

Sentiment labels used in the confusion matrix. Set only for text sentiment models. For AutoML Text Revamp, use annotation_spec_id_token instead and leave this field empty. Corresponds to the JSON property sentimentLabel

Returns:

  • (Array<Fixnum>)


1609
1610
1611
# File 'lib/google/apis/language_v2/classes.rb', line 1609

def sentiment_label
  @sentiment_label
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1616
1617
1618
1619
1620
1621
# File 'lib/google/apis/language_v2/classes.rb', line 1616

def update!(**args)
  @annotation_spec_id_token = args[:annotation_spec_id_token] if args.key?(:annotation_spec_id_token)
  @category = args[:category] if args.key?(:category)
  @row = args[:row] if args.key?(:row)
  @sentiment_label = args[:sentiment_label] if args.key?(:sentiment_label)
end