/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/automl/v1/classification.proto

package com.google.cloud.automl.v1;

/**
 *
 *
 * <pre>
 * Model evaluation metrics for classification problems.
 * Note: For Video Classification this metrics only describe quality of the
 * Video Classification predictions of "segment_classification" type.
 * </pre>
 *
 * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics}
 */
public final class ClassificationEvaluationMetrics extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics)
    ClassificationEvaluationMetricsOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ClassificationEvaluationMetrics.newBuilder() to construct.
  private ClassificationEvaluationMetrics(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ClassificationEvaluationMetrics() {
    confidenceMetricsEntry_ = java.util.Collections.emptyList();
    annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new ClassificationEvaluationMetrics();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.automl.v1.ClassificationProto
        .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.automl.v1.ClassificationProto
        .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.class,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder.class);
  }

  public interface ConfidenceMetricsEntryOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Output only. Metrics are computed with an assumption that the model
     * never returns predictions with score lower than this value.
     * </pre>
     *
     * <code>float confidence_threshold = 1;</code>
     *
     * @return The confidenceThreshold.
     */
    float getConfidenceThreshold();

    /**
     *
     *
     * <pre>
     * Output only. 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.
     * </pre>
     *
     * <code>int32 position_threshold = 14;</code>
     *
     * @return The positionThreshold.
     */
    int getPositionThreshold();

    /**
     *
     *
     * <pre>
     * Output only. Recall (True Positive Rate) for the given confidence
     * threshold.
     * </pre>
     *
     * <code>float recall = 2;</code>
     *
     * @return The recall.
     */
    float getRecall();

    /**
     *
     *
     * <pre>
     * Output only. Precision for the given confidence threshold.
     * </pre>
     *
     * <code>float precision = 3;</code>
     *
     * @return The precision.
     */
    float getPrecision();

    /**
     *
     *
     * <pre>
     * Output only. False Positive Rate for the given confidence threshold.
     * </pre>
     *
     * <code>float false_positive_rate = 8;</code>
     *
     * @return The falsePositiveRate.
     */
    float getFalsePositiveRate();

    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of recall and precision.
     * </pre>
     *
     * <code>float f1_score = 4;</code>
     *
     * @return The f1Score.
     */
    float getF1Score();

    /**
     *
     *
     * <pre>
     * Output only. 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.
     * </pre>
     *
     * <code>float recall_at1 = 5;</code>
     *
     * @return The recallAt1.
     */
    float getRecallAt1();

    /**
     *
     *
     * <pre>
     * Output only. The precision when only considering the label that has the
     * highest prediction score and not below the confidence threshold for each
     * example.
     * </pre>
     *
     * <code>float precision_at1 = 6;</code>
     *
     * @return The precisionAt1.
     */
    float getPrecisionAt1();

    /**
     *
     *
     * <pre>
     * Output only. The False Positive Rate when only considering the label that
     * has the highest prediction score and not below the confidence threshold
     * for each example.
     * </pre>
     *
     * <code>float false_positive_rate_at1 = 9;</code>
     *
     * @return The falsePositiveRateAt1.
     */
    float getFalsePositiveRateAt1();

    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
     * </pre>
     *
     * <code>float f1_score_at1 = 7;</code>
     *
     * @return The f1ScoreAt1.
     */
    float getF1ScoreAt1();

    /**
     *
     *
     * <pre>
     * Output only. The number of model created labels that match a ground truth
     * label.
     * </pre>
     *
     * <code>int64 true_positive_count = 10;</code>
     *
     * @return The truePositiveCount.
     */
    long getTruePositiveCount();

    /**
     *
     *
     * <pre>
     * Output only. The number of model created labels that do not match a
     * ground truth label.
     * </pre>
     *
     * <code>int64 false_positive_count = 11;</code>
     *
     * @return The falsePositiveCount.
     */
    long getFalsePositiveCount();

    /**
     *
     *
     * <pre>
     * Output only. The number of ground truth labels that are not matched
     * by a model created label.
     * </pre>
     *
     * <code>int64 false_negative_count = 12;</code>
     *
     * @return The falseNegativeCount.
     */
    long getFalseNegativeCount();

    /**
     *
     *
     * <pre>
     * Output only. The number of labels that were not created by the model,
     * but if they would, they would not match a ground truth label.
     * </pre>
     *
     * <code>int64 true_negative_count = 13;</code>
     *
     * @return The trueNegativeCount.
     */
    long getTrueNegativeCount();
  }
  /**
   *
   *
   * <pre>
   * Metrics for a single confidence threshold.
   * </pre>
   *
   * Protobuf type {@code
   * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry}
   */
  public static final class ConfidenceMetricsEntry extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
      ConfidenceMetricsEntryOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ConfidenceMetricsEntry.newBuilder() to construct.
    private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ConfidenceMetricsEntry() {}

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
      return new ConfidenceMetricsEntry();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                  .class,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                  .Builder.class);
    }

    public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1;
    private float confidenceThreshold_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. Metrics are computed with an assumption that the model
     * never returns predictions with score lower than this value.
     * </pre>
     *
     * <code>float confidence_threshold = 1;</code>
     *
     * @return The confidenceThreshold.
     */
    @java.lang.Override
    public float getConfidenceThreshold() {
      return confidenceThreshold_;
    }

    public static final int POSITION_THRESHOLD_FIELD_NUMBER = 14;
    private int positionThreshold_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. 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.
     * </pre>
     *
     * <code>int32 position_threshold = 14;</code>
     *
     * @return The positionThreshold.
     */
    @java.lang.Override
    public int getPositionThreshold() {
      return positionThreshold_;
    }

    public static final int RECALL_FIELD_NUMBER = 2;
    private float recall_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. Recall (True Positive Rate) for the given confidence
     * threshold.
     * </pre>
     *
     * <code>float recall = 2;</code>
     *
     * @return The recall.
     */
    @java.lang.Override
    public float getRecall() {
      return recall_;
    }

    public static final int PRECISION_FIELD_NUMBER = 3;
    private float precision_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. Precision for the given confidence threshold.
     * </pre>
     *
     * <code>float precision = 3;</code>
     *
     * @return The precision.
     */
    @java.lang.Override
    public float getPrecision() {
      return precision_;
    }

    public static final int FALSE_POSITIVE_RATE_FIELD_NUMBER = 8;
    private float falsePositiveRate_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. False Positive Rate for the given confidence threshold.
     * </pre>
     *
     * <code>float false_positive_rate = 8;</code>
     *
     * @return The falsePositiveRate.
     */
    @java.lang.Override
    public float getFalsePositiveRate() {
      return falsePositiveRate_;
    }

    public static final int F1_SCORE_FIELD_NUMBER = 4;
    private float f1Score_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of recall and precision.
     * </pre>
     *
     * <code>float f1_score = 4;</code>
     *
     * @return The f1Score.
     */
    @java.lang.Override
    public float getF1Score() {
      return f1Score_;
    }

    public static final int RECALL_AT1_FIELD_NUMBER = 5;
    private float recallAt1_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. 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.
     * </pre>
     *
     * <code>float recall_at1 = 5;</code>
     *
     * @return The recallAt1.
     */
    @java.lang.Override
    public float getRecallAt1() {
      return recallAt1_;
    }

    public static final int PRECISION_AT1_FIELD_NUMBER = 6;
    private float precisionAt1_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. The precision when only considering the label that has the
     * highest prediction score and not below the confidence threshold for each
     * example.
     * </pre>
     *
     * <code>float precision_at1 = 6;</code>
     *
     * @return The precisionAt1.
     */
    @java.lang.Override
    public float getPrecisionAt1() {
      return precisionAt1_;
    }

    public static final int FALSE_POSITIVE_RATE_AT1_FIELD_NUMBER = 9;
    private float falsePositiveRateAt1_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. The False Positive Rate when only considering the label that
     * has the highest prediction score and not below the confidence threshold
     * for each example.
     * </pre>
     *
     * <code>float false_positive_rate_at1 = 9;</code>
     *
     * @return The falsePositiveRateAt1.
     */
    @java.lang.Override
    public float getFalsePositiveRateAt1() {
      return falsePositiveRateAt1_;
    }

    public static final int F1_SCORE_AT1_FIELD_NUMBER = 7;
    private float f1ScoreAt1_ = 0F;
    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
     * </pre>
     *
     * <code>float f1_score_at1 = 7;</code>
     *
     * @return The f1ScoreAt1.
     */
    @java.lang.Override
    public float getF1ScoreAt1() {
      return f1ScoreAt1_;
    }

    public static final int TRUE_POSITIVE_COUNT_FIELD_NUMBER = 10;
    private long truePositiveCount_ = 0L;
    /**
     *
     *
     * <pre>
     * Output only. The number of model created labels that match a ground truth
     * label.
     * </pre>
     *
     * <code>int64 true_positive_count = 10;</code>
     *
     * @return The truePositiveCount.
     */
    @java.lang.Override
    public long getTruePositiveCount() {
      return truePositiveCount_;
    }

    public static final int FALSE_POSITIVE_COUNT_FIELD_NUMBER = 11;
    private long falsePositiveCount_ = 0L;
    /**
     *
     *
     * <pre>
     * Output only. The number of model created labels that do not match a
     * ground truth label.
     * </pre>
     *
     * <code>int64 false_positive_count = 11;</code>
     *
     * @return The falsePositiveCount.
     */
    @java.lang.Override
    public long getFalsePositiveCount() {
      return falsePositiveCount_;
    }

    public static final int FALSE_NEGATIVE_COUNT_FIELD_NUMBER = 12;
    private long falseNegativeCount_ = 0L;
    /**
     *
     *
     * <pre>
     * Output only. The number of ground truth labels that are not matched
     * by a model created label.
     * </pre>
     *
     * <code>int64 false_negative_count = 12;</code>
     *
     * @return The falseNegativeCount.
     */
    @java.lang.Override
    public long getFalseNegativeCount() {
      return falseNegativeCount_;
    }

    public static final int TRUE_NEGATIVE_COUNT_FIELD_NUMBER = 13;
    private long trueNegativeCount_ = 0L;
    /**
     *
     *
     * <pre>
     * Output only. The number of labels that were not created by the model,
     * but if they would, they would not match a ground truth label.
     * </pre>
     *
     * <code>int64 true_negative_count = 13;</code>
     *
     * @return The trueNegativeCount.
     */
    @java.lang.Override
    public long getTrueNegativeCount() {
      return trueNegativeCount_;
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (java.lang.Float.floatToRawIntBits(confidenceThreshold_) != 0) {
        output.writeFloat(1, confidenceThreshold_);
      }
      if (java.lang.Float.floatToRawIntBits(recall_) != 0) {
        output.writeFloat(2, recall_);
      }
      if (java.lang.Float.floatToRawIntBits(precision_) != 0) {
        output.writeFloat(3, precision_);
      }
      if (java.lang.Float.floatToRawIntBits(f1Score_) != 0) {
        output.writeFloat(4, f1Score_);
      }
      if (java.lang.Float.floatToRawIntBits(recallAt1_) != 0) {
        output.writeFloat(5, recallAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(precisionAt1_) != 0) {
        output.writeFloat(6, precisionAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(f1ScoreAt1_) != 0) {
        output.writeFloat(7, f1ScoreAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(falsePositiveRate_) != 0) {
        output.writeFloat(8, falsePositiveRate_);
      }
      if (java.lang.Float.floatToRawIntBits(falsePositiveRateAt1_) != 0) {
        output.writeFloat(9, falsePositiveRateAt1_);
      }
      if (truePositiveCount_ != 0L) {
        output.writeInt64(10, truePositiveCount_);
      }
      if (falsePositiveCount_ != 0L) {
        output.writeInt64(11, falsePositiveCount_);
      }
      if (falseNegativeCount_ != 0L) {
        output.writeInt64(12, falseNegativeCount_);
      }
      if (trueNegativeCount_ != 0L) {
        output.writeInt64(13, trueNegativeCount_);
      }
      if (positionThreshold_ != 0) {
        output.writeInt32(14, positionThreshold_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (java.lang.Float.floatToRawIntBits(confidenceThreshold_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceThreshold_);
      }
      if (java.lang.Float.floatToRawIntBits(recall_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_);
      }
      if (java.lang.Float.floatToRawIntBits(precision_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, precision_);
      }
      if (java.lang.Float.floatToRawIntBits(f1Score_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, f1Score_);
      }
      if (java.lang.Float.floatToRawIntBits(recallAt1_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, recallAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(precisionAt1_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, precisionAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(f1ScoreAt1_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, f1ScoreAt1_);
      }
      if (java.lang.Float.floatToRawIntBits(falsePositiveRate_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(8, falsePositiveRate_);
      }
      if (java.lang.Float.floatToRawIntBits(falsePositiveRateAt1_) != 0) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(9, falsePositiveRateAt1_);
      }
      if (truePositiveCount_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(10, truePositiveCount_);
      }
      if (falsePositiveCount_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(11, falsePositiveCount_);
      }
      if (falseNegativeCount_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(12, falseNegativeCount_);
      }
      if (trueNegativeCount_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(13, trueNegativeCount_);
      }
      if (positionThreshold_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(14, positionThreshold_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj
          instanceof
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)) {
        return super.equals(obj);
      }
      com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other =
          (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) obj;

      if (java.lang.Float.floatToIntBits(getConfidenceThreshold())
          != java.lang.Float.floatToIntBits(other.getConfidenceThreshold())) return false;
      if (getPositionThreshold() != other.getPositionThreshold()) return false;
      if (java.lang.Float.floatToIntBits(getRecall())
          != java.lang.Float.floatToIntBits(other.getRecall())) return false;
      if (java.lang.Float.floatToIntBits(getPrecision())
          != java.lang.Float.floatToIntBits(other.getPrecision())) return false;
      if (java.lang.Float.floatToIntBits(getFalsePositiveRate())
          != java.lang.Float.floatToIntBits(other.getFalsePositiveRate())) return false;
      if (java.lang.Float.floatToIntBits(getF1Score())
          != java.lang.Float.floatToIntBits(other.getF1Score())) return false;
      if (java.lang.Float.floatToIntBits(getRecallAt1())
          != java.lang.Float.floatToIntBits(other.getRecallAt1())) return false;
      if (java.lang.Float.floatToIntBits(getPrecisionAt1())
          != java.lang.Float.floatToIntBits(other.getPrecisionAt1())) return false;
      if (java.lang.Float.floatToIntBits(getFalsePositiveRateAt1())
          != java.lang.Float.floatToIntBits(other.getFalsePositiveRateAt1())) return false;
      if (java.lang.Float.floatToIntBits(getF1ScoreAt1())
          != java.lang.Float.floatToIntBits(other.getF1ScoreAt1())) return false;
      if (getTruePositiveCount() != other.getTruePositiveCount()) return false;
      if (getFalsePositiveCount() != other.getFalsePositiveCount()) return false;
      if (getFalseNegativeCount() != other.getFalseNegativeCount()) return false;
      if (getTrueNegativeCount() != other.getTrueNegativeCount()) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceThreshold());
      hash = (37 * hash) + POSITION_THRESHOLD_FIELD_NUMBER;
      hash = (53 * hash) + getPositionThreshold();
      hash = (37 * hash) + RECALL_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall());
      hash = (37 * hash) + PRECISION_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision());
      hash = (37 * hash) + FALSE_POSITIVE_RATE_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getFalsePositiveRate());
      hash = (37 * hash) + F1_SCORE_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score());
      hash = (37 * hash) + RECALL_AT1_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecallAt1());
      hash = (37 * hash) + PRECISION_AT1_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecisionAt1());
      hash = (37 * hash) + FALSE_POSITIVE_RATE_AT1_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getFalsePositiveRateAt1());
      hash = (37 * hash) + F1_SCORE_AT1_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1ScoreAt1());
      hash = (37 * hash) + TRUE_POSITIVE_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTruePositiveCount());
      hash = (37 * hash) + FALSE_POSITIVE_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFalsePositiveCount());
      hash = (37 * hash) + FALSE_NEGATIVE_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getFalseNegativeCount());
      hash = (37 * hash) + TRUE_NEGATIVE_COUNT_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTrueNegativeCount());
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(
            java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseDelimitedFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
            prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Metrics for a single confidence threshold.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                    .class,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                    .Builder.class);
      }

      // Construct using
      // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.newBuilder()
      private Builder() {}

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        confidenceThreshold_ = 0F;
        positionThreshold_ = 0;
        recall_ = 0F;
        precision_ = 0F;
        falsePositiveRate_ = 0F;
        f1Score_ = 0F;
        recallAt1_ = 0F;
        precisionAt1_ = 0F;
        falsePositiveRateAt1_ = 0F;
        f1ScoreAt1_ = 0F;
        truePositiveCount_ = 0L;
        falsePositiveCount_ = 0L;
        falseNegativeCount_ = 0L;
        trueNegativeCount_ = 0L;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfidenceMetricsEntry_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
          getDefaultInstanceForType() {
        return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
          build() {
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
          buildPartial() {
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry result =
            new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry(
                this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
              result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.confidenceThreshold_ = confidenceThreshold_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.positionThreshold_ = positionThreshold_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.recall_ = recall_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.precision_ = precision_;
        }
        if (((from_bitField0_ & 0x00000010) != 0)) {
          result.falsePositiveRate_ = falsePositiveRate_;
        }
        if (((from_bitField0_ & 0x00000020) != 0)) {
          result.f1Score_ = f1Score_;
        }
        if (((from_bitField0_ & 0x00000040) != 0)) {
          result.recallAt1_ = recallAt1_;
        }
        if (((from_bitField0_ & 0x00000080) != 0)) {
          result.precisionAt1_ = precisionAt1_;
        }
        if (((from_bitField0_ & 0x00000100) != 0)) {
          result.falsePositiveRateAt1_ = falsePositiveRateAt1_;
        }
        if (((from_bitField0_ & 0x00000200) != 0)) {
          result.f1ScoreAt1_ = f1ScoreAt1_;
        }
        if (((from_bitField0_ & 0x00000400) != 0)) {
          result.truePositiveCount_ = truePositiveCount_;
        }
        if (((from_bitField0_ & 0x00000800) != 0)) {
          result.falsePositiveCount_ = falsePositiveCount_;
        }
        if (((from_bitField0_ & 0x00001000) != 0)) {
          result.falseNegativeCount_ = falseNegativeCount_;
        }
        if (((from_bitField0_ & 0x00002000) != 0)) {
          result.trueNegativeCount_ = trueNegativeCount_;
        }
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other
            instanceof
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry) {
          return mergeFrom(
              (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
                  other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry other) {
        if (other
            == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                .getDefaultInstance()) return this;
        if (other.getConfidenceThreshold() != 0F) {
          setConfidenceThreshold(other.getConfidenceThreshold());
        }
        if (other.getPositionThreshold() != 0) {
          setPositionThreshold(other.getPositionThreshold());
        }
        if (other.getRecall() != 0F) {
          setRecall(other.getRecall());
        }
        if (other.getPrecision() != 0F) {
          setPrecision(other.getPrecision());
        }
        if (other.getFalsePositiveRate() != 0F) {
          setFalsePositiveRate(other.getFalsePositiveRate());
        }
        if (other.getF1Score() != 0F) {
          setF1Score(other.getF1Score());
        }
        if (other.getRecallAt1() != 0F) {
          setRecallAt1(other.getRecallAt1());
        }
        if (other.getPrecisionAt1() != 0F) {
          setPrecisionAt1(other.getPrecisionAt1());
        }
        if (other.getFalsePositiveRateAt1() != 0F) {
          setFalsePositiveRateAt1(other.getFalsePositiveRateAt1());
        }
        if (other.getF1ScoreAt1() != 0F) {
          setF1ScoreAt1(other.getF1ScoreAt1());
        }
        if (other.getTruePositiveCount() != 0L) {
          setTruePositiveCount(other.getTruePositiveCount());
        }
        if (other.getFalsePositiveCount() != 0L) {
          setFalsePositiveCount(other.getFalsePositiveCount());
        }
        if (other.getFalseNegativeCount() != 0L) {
          setFalseNegativeCount(other.getFalseNegativeCount());
        }
        if (other.getTrueNegativeCount() != 0L) {
          setTrueNegativeCount(other.getTrueNegativeCount());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 13:
                {
                  confidenceThreshold_ = input.readFloat();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 13
              case 21:
                {
                  recall_ = input.readFloat();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 21
              case 29:
                {
                  precision_ = input.readFloat();
                  bitField0_ |= 0x00000008;
                  break;
                } // case 29
              case 37:
                {
                  f1Score_ = input.readFloat();
                  bitField0_ |= 0x00000020;
                  break;
                } // case 37
              case 45:
                {
                  recallAt1_ = input.readFloat();
                  bitField0_ |= 0x00000040;
                  break;
                } // case 45
              case 53:
                {
                  precisionAt1_ = input.readFloat();
                  bitField0_ |= 0x00000080;
                  break;
                } // case 53
              case 61:
                {
                  f1ScoreAt1_ = input.readFloat();
                  bitField0_ |= 0x00000200;
                  break;
                } // case 61
              case 69:
                {
                  falsePositiveRate_ = input.readFloat();
                  bitField0_ |= 0x00000010;
                  break;
                } // case 69
              case 77:
                {
                  falsePositiveRateAt1_ = input.readFloat();
                  bitField0_ |= 0x00000100;
                  break;
                } // case 77
              case 80:
                {
                  truePositiveCount_ = input.readInt64();
                  bitField0_ |= 0x00000400;
                  break;
                } // case 80
              case 88:
                {
                  falsePositiveCount_ = input.readInt64();
                  bitField0_ |= 0x00000800;
                  break;
                } // case 88
              case 96:
                {
                  falseNegativeCount_ = input.readInt64();
                  bitField0_ |= 0x00001000;
                  break;
                } // case 96
              case 104:
                {
                  trueNegativeCount_ = input.readInt64();
                  bitField0_ |= 0x00002000;
                  break;
                } // case 104
              case 112:
                {
                  positionThreshold_ = input.readInt32();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 112
              default:
                {
                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                    done = true; // was an endgroup tag
                  }
                  break;
                } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }

      private int bitField0_;

      private float confidenceThreshold_;
      /**
       *
       *
       * <pre>
       * Output only. Metrics are computed with an assumption that the model
       * never returns predictions with score lower than this value.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       *
       * @return The confidenceThreshold.
       */
      @java.lang.Override
      public float getConfidenceThreshold() {
        return confidenceThreshold_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Metrics are computed with an assumption that the model
       * never returns predictions with score lower than this value.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       *
       * @param value The confidenceThreshold to set.
       * @return This builder for chaining.
       */
      public Builder setConfidenceThreshold(float value) {

        confidenceThreshold_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Metrics are computed with an assumption that the model
       * never returns predictions with score lower than this value.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearConfidenceThreshold() {
        bitField0_ = (bitField0_ & ~0x00000001);
        confidenceThreshold_ = 0F;
        onChanged();
        return this;
      }

      private int positionThreshold_;
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>int32 position_threshold = 14;</code>
       *
       * @return The positionThreshold.
       */
      @java.lang.Override
      public int getPositionThreshold() {
        return positionThreshold_;
      }
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>int32 position_threshold = 14;</code>
       *
       * @param value The positionThreshold to set.
       * @return This builder for chaining.
       */
      public Builder setPositionThreshold(int value) {

        positionThreshold_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>int32 position_threshold = 14;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPositionThreshold() {
        bitField0_ = (bitField0_ & ~0x00000002);
        positionThreshold_ = 0;
        onChanged();
        return this;
      }

      private float recall_;
      /**
       *
       *
       * <pre>
       * Output only. Recall (True Positive Rate) for the given confidence
       * threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       *
       * @return The recall.
       */
      @java.lang.Override
      public float getRecall() {
        return recall_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Recall (True Positive Rate) for the given confidence
       * threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       *
       * @param value The recall to set.
       * @return This builder for chaining.
       */
      public Builder setRecall(float value) {

        recall_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Recall (True Positive Rate) for the given confidence
       * threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRecall() {
        bitField0_ = (bitField0_ & ~0x00000004);
        recall_ = 0F;
        onChanged();
        return this;
      }

      private float precision_;
      /**
       *
       *
       * <pre>
       * Output only. Precision for the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       *
       * @return The precision.
       */
      @java.lang.Override
      public float getPrecision() {
        return precision_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Precision for the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       *
       * @param value The precision to set.
       * @return This builder for chaining.
       */
      public Builder setPrecision(float value) {

        precision_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Precision for the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPrecision() {
        bitField0_ = (bitField0_ & ~0x00000008);
        precision_ = 0F;
        onChanged();
        return this;
      }

      private float falsePositiveRate_;
      /**
       *
       *
       * <pre>
       * Output only. False Positive Rate for the given confidence threshold.
       * </pre>
       *
       * <code>float false_positive_rate = 8;</code>
       *
       * @return The falsePositiveRate.
       */
      @java.lang.Override
      public float getFalsePositiveRate() {
        return falsePositiveRate_;
      }
      /**
       *
       *
       * <pre>
       * Output only. False Positive Rate for the given confidence threshold.
       * </pre>
       *
       * <code>float false_positive_rate = 8;</code>
       *
       * @param value The falsePositiveRate to set.
       * @return This builder for chaining.
       */
      public Builder setFalsePositiveRate(float value) {

        falsePositiveRate_ = value;
        bitField0_ |= 0x00000010;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. False Positive Rate for the given confidence threshold.
       * </pre>
       *
       * <code>float false_positive_rate = 8;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearFalsePositiveRate() {
        bitField0_ = (bitField0_ & ~0x00000010);
        falsePositiveRate_ = 0F;
        onChanged();
        return this;
      }

      private float f1Score_;
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       *
       * @return The f1Score.
       */
      @java.lang.Override
      public float getF1Score() {
        return f1Score_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       *
       * @param value The f1Score to set.
       * @return This builder for chaining.
       */
      public Builder setF1Score(float value) {

        f1Score_ = value;
        bitField0_ |= 0x00000020;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearF1Score() {
        bitField0_ = (bitField0_ & ~0x00000020);
        f1Score_ = 0F;
        onChanged();
        return this;
      }

      private float recallAt1_;
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>float recall_at1 = 5;</code>
       *
       * @return The recallAt1.
       */
      @java.lang.Override
      public float getRecallAt1() {
        return recallAt1_;
      }
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>float recall_at1 = 5;</code>
       *
       * @param value The recallAt1 to set.
       * @return This builder for chaining.
       */
      public Builder setRecallAt1(float value) {

        recallAt1_ = value;
        bitField0_ |= 0x00000040;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. 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.
       * </pre>
       *
       * <code>float recall_at1 = 5;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRecallAt1() {
        bitField0_ = (bitField0_ & ~0x00000040);
        recallAt1_ = 0F;
        onChanged();
        return this;
      }

      private float precisionAt1_;
      /**
       *
       *
       * <pre>
       * Output only. The precision when only considering the label that has the
       * highest prediction score and not below the confidence threshold for each
       * example.
       * </pre>
       *
       * <code>float precision_at1 = 6;</code>
       *
       * @return The precisionAt1.
       */
      @java.lang.Override
      public float getPrecisionAt1() {
        return precisionAt1_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The precision when only considering the label that has the
       * highest prediction score and not below the confidence threshold for each
       * example.
       * </pre>
       *
       * <code>float precision_at1 = 6;</code>
       *
       * @param value The precisionAt1 to set.
       * @return This builder for chaining.
       */
      public Builder setPrecisionAt1(float value) {

        precisionAt1_ = value;
        bitField0_ |= 0x00000080;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The precision when only considering the label that has the
       * highest prediction score and not below the confidence threshold for each
       * example.
       * </pre>
       *
       * <code>float precision_at1 = 6;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPrecisionAt1() {
        bitField0_ = (bitField0_ & ~0x00000080);
        precisionAt1_ = 0F;
        onChanged();
        return this;
      }

      private float falsePositiveRateAt1_;
      /**
       *
       *
       * <pre>
       * Output only. The False Positive Rate when only considering the label that
       * has the highest prediction score and not below the confidence threshold
       * for each example.
       * </pre>
       *
       * <code>float false_positive_rate_at1 = 9;</code>
       *
       * @return The falsePositiveRateAt1.
       */
      @java.lang.Override
      public float getFalsePositiveRateAt1() {
        return falsePositiveRateAt1_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The False Positive Rate when only considering the label that
       * has the highest prediction score and not below the confidence threshold
       * for each example.
       * </pre>
       *
       * <code>float false_positive_rate_at1 = 9;</code>
       *
       * @param value The falsePositiveRateAt1 to set.
       * @return This builder for chaining.
       */
      public Builder setFalsePositiveRateAt1(float value) {

        falsePositiveRateAt1_ = value;
        bitField0_ |= 0x00000100;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The False Positive Rate when only considering the label that
       * has the highest prediction score and not below the confidence threshold
       * for each example.
       * </pre>
       *
       * <code>float false_positive_rate_at1 = 9;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearFalsePositiveRateAt1() {
        bitField0_ = (bitField0_ & ~0x00000100);
        falsePositiveRateAt1_ = 0F;
        onChanged();
        return this;
      }

      private float f1ScoreAt1_;
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
       * </pre>
       *
       * <code>float f1_score_at1 = 7;</code>
       *
       * @return The f1ScoreAt1.
       */
      @java.lang.Override
      public float getF1ScoreAt1() {
        return f1ScoreAt1_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
       * </pre>
       *
       * <code>float f1_score_at1 = 7;</code>
       *
       * @param value The f1ScoreAt1 to set.
       * @return This builder for chaining.
       */
      public Builder setF1ScoreAt1(float value) {

        f1ScoreAt1_ = value;
        bitField0_ |= 0x00000200;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
       * </pre>
       *
       * <code>float f1_score_at1 = 7;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearF1ScoreAt1() {
        bitField0_ = (bitField0_ & ~0x00000200);
        f1ScoreAt1_ = 0F;
        onChanged();
        return this;
      }

      private long truePositiveCount_;
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that match a ground truth
       * label.
       * </pre>
       *
       * <code>int64 true_positive_count = 10;</code>
       *
       * @return The truePositiveCount.
       */
      @java.lang.Override
      public long getTruePositiveCount() {
        return truePositiveCount_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that match a ground truth
       * label.
       * </pre>
       *
       * <code>int64 true_positive_count = 10;</code>
       *
       * @param value The truePositiveCount to set.
       * @return This builder for chaining.
       */
      public Builder setTruePositiveCount(long value) {

        truePositiveCount_ = value;
        bitField0_ |= 0x00000400;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that match a ground truth
       * label.
       * </pre>
       *
       * <code>int64 true_positive_count = 10;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearTruePositiveCount() {
        bitField0_ = (bitField0_ & ~0x00000400);
        truePositiveCount_ = 0L;
        onChanged();
        return this;
      }

      private long falsePositiveCount_;
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that do not match a
       * ground truth label.
       * </pre>
       *
       * <code>int64 false_positive_count = 11;</code>
       *
       * @return The falsePositiveCount.
       */
      @java.lang.Override
      public long getFalsePositiveCount() {
        return falsePositiveCount_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that do not match a
       * ground truth label.
       * </pre>
       *
       * <code>int64 false_positive_count = 11;</code>
       *
       * @param value The falsePositiveCount to set.
       * @return This builder for chaining.
       */
      public Builder setFalsePositiveCount(long value) {

        falsePositiveCount_ = value;
        bitField0_ |= 0x00000800;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of model created labels that do not match a
       * ground truth label.
       * </pre>
       *
       * <code>int64 false_positive_count = 11;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearFalsePositiveCount() {
        bitField0_ = (bitField0_ & ~0x00000800);
        falsePositiveCount_ = 0L;
        onChanged();
        return this;
      }

      private long falseNegativeCount_;
      /**
       *
       *
       * <pre>
       * Output only. The number of ground truth labels that are not matched
       * by a model created label.
       * </pre>
       *
       * <code>int64 false_negative_count = 12;</code>
       *
       * @return The falseNegativeCount.
       */
      @java.lang.Override
      public long getFalseNegativeCount() {
        return falseNegativeCount_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of ground truth labels that are not matched
       * by a model created label.
       * </pre>
       *
       * <code>int64 false_negative_count = 12;</code>
       *
       * @param value The falseNegativeCount to set.
       * @return This builder for chaining.
       */
      public Builder setFalseNegativeCount(long value) {

        falseNegativeCount_ = value;
        bitField0_ |= 0x00001000;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of ground truth labels that are not matched
       * by a model created label.
       * </pre>
       *
       * <code>int64 false_negative_count = 12;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearFalseNegativeCount() {
        bitField0_ = (bitField0_ & ~0x00001000);
        falseNegativeCount_ = 0L;
        onChanged();
        return this;
      }

      private long trueNegativeCount_;
      /**
       *
       *
       * <pre>
       * Output only. The number of labels that were not created by the model,
       * but if they would, they would not match a ground truth label.
       * </pre>
       *
       * <code>int64 true_negative_count = 13;</code>
       *
       * @return The trueNegativeCount.
       */
      @java.lang.Override
      public long getTrueNegativeCount() {
        return trueNegativeCount_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of labels that were not created by the model,
       * but if they would, they would not match a ground truth label.
       * </pre>
       *
       * <code>int64 true_negative_count = 13;</code>
       *
       * @param value The trueNegativeCount to set.
       * @return This builder for chaining.
       */
      public Builder setTrueNegativeCount(long value) {

        trueNegativeCount_ = value;
        bitField0_ |= 0x00002000;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The number of labels that were not created by the model,
       * but if they would, they would not match a ground truth label.
       * </pre>
       *
       * <code>int64 true_negative_count = 13;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearTrueNegativeCount() {
        bitField0_ = (bitField0_ & ~0x00002000);
        trueNegativeCount_ = 0L;
        onChanged();
        return this;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry)
    private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics
            .ConfidenceMetricsEntry
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry();
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ConfidenceMetricsEntry> PARSER =
        new com.google.protobuf.AbstractParser<ConfidenceMetricsEntry>() {
          @java.lang.Override
          public ConfidenceMetricsEntry parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            Builder builder = newBuilder();
            try {
              builder.mergeFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
              throw e.setUnfinishedMessage(builder.buildPartial());
            } catch (com.google.protobuf.UninitializedMessageException e) {
              throw e.asInvalidProtocolBufferException()
                  .setUnfinishedMessage(builder.buildPartial());
            } catch (java.io.IOException e) {
              throw new com.google.protobuf.InvalidProtocolBufferException(e)
                  .setUnfinishedMessage(builder.buildPartial());
            }
            return builder.buildPartial();
          }
        };

    public static com.google.protobuf.Parser<ConfidenceMetricsEntry> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ConfidenceMetricsEntry> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface ConfusionMatrixOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @return A list containing the annotationSpecId.
     */
    java.util.List<java.lang.String> getAnnotationSpecIdList();
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @return The count of annotationSpecId.
     */
    int getAnnotationSpecIdCount();
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The annotationSpecId at the given index.
     */
    java.lang.String getAnnotationSpecId(int index);
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the annotationSpecId at the given index.
     */
    com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index);

    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @return A list containing the displayName.
     */
    java.util.List<java.lang.String> getDisplayNameList();
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @return The count of displayName.
     */
    int getDisplayNameCount();
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The displayName at the given index.
     */
    java.lang.String getDisplayName(int index);
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the displayName at the given index.
     */
    com.google.protobuf.ByteString getDisplayNameBytes(int index);

    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    java.util.List<com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>
        getRowList();
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(
        int index);
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    int getRowCount();
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    java.util.List<
            ? extends
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                    .RowOrBuilder>
        getRowOrBuilderList();
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder
        getRowOrBuilder(int index);
  }
  /**
   *
   *
   * <pre>
   * Confusion matrix of the model running the classification.
   * </pre>
   *
   * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix}
   */
  public static final class ConfusionMatrix extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)
      ConfusionMatrixOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ConfusionMatrix.newBuilder() to construct.
    private ConfusionMatrix(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ConfusionMatrix() {
      annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      row_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
      return new ConfusionMatrix();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.class,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder
                  .class);
    }

    public interface RowOrBuilder
        extends
        // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
        com.google.protobuf.MessageOrBuilder {

      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @return A list containing the exampleCount.
       */
      java.util.List<java.lang.Integer> getExampleCountList();
      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @return The count of exampleCount.
       */
      int getExampleCountCount();
      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @param index The index of the element to return.
       * @return The exampleCount at the given index.
       */
      int getExampleCount(int index);
    }
    /**
     *
     *
     * <pre>
     * Output only. A row in the confusion matrix.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row}
     */
    public static final class Row extends com.google.protobuf.GeneratedMessageV3
        implements
        // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
        RowOrBuilder {
      private static final long serialVersionUID = 0L;
      // Use Row.newBuilder() to construct.
      private Row(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }

      private Row() {
        exampleCount_ = emptyIntList();
      }

      @java.lang.Override
      @SuppressWarnings({"unused"})
      protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
        return new Row();
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
      }

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                    .class,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                    .Builder.class);
      }

      public static final int EXAMPLE_COUNT_FIELD_NUMBER = 1;

      @SuppressWarnings("serial")
      private com.google.protobuf.Internal.IntList exampleCount_;
      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @return A list containing the exampleCount.
       */
      @java.lang.Override
      public java.util.List<java.lang.Integer> getExampleCountList() {
        return exampleCount_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @return The count of exampleCount.
       */
      public int getExampleCountCount() {
        return exampleCount_.size();
      }
      /**
       *
       *
       * <pre>
       * Output only. Value of the specific cell in the confusion matrix.
       * The number of values each row has (i.e. the length of the row) is equal
       * to the length of the `annotation_spec_id` field or, if that one is not
       * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
       * </pre>
       *
       * <code>repeated int32 example_count = 1;</code>
       *
       * @param index The index of the element to return.
       * @return The exampleCount at the given index.
       */
      public int getExampleCount(int index) {
        return exampleCount_.getInt(index);
      }

      private int exampleCountMemoizedSerializedSize = -1;

      private byte memoizedIsInitialized = -1;

      @java.lang.Override
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;

        memoizedIsInitialized = 1;
        return true;
      }

      @java.lang.Override
      public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        getSerializedSize();
        if (getExampleCountList().size() > 0) {
          output.writeUInt32NoTag(10);
          output.writeUInt32NoTag(exampleCountMemoizedSerializedSize);
        }
        for (int i = 0; i < exampleCount_.size(); i++) {
          output.writeInt32NoTag(exampleCount_.getInt(i));
        }
        getUnknownFields().writeTo(output);
      }

      @java.lang.Override
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;

        size = 0;
        {
          int dataSize = 0;
          for (int i = 0; i < exampleCount_.size(); i++) {
            dataSize +=
                com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(
                    exampleCount_.getInt(i));
          }
          size += dataSize;
          if (!getExampleCountList().isEmpty()) {
            size += 1;
            size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
          }
          exampleCountMemoizedSerializedSize = dataSize;
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSize = size;
        return size;
      }

      @java.lang.Override
      public boolean equals(final java.lang.Object obj) {
        if (obj == this) {
          return true;
        }
        if (!(obj
            instanceof
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)) {
          return super.equals(obj);
        }
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row other =
            (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) obj;

        if (!getExampleCountList().equals(other.getExampleCountList())) return false;
        if (!getUnknownFields().equals(other.getUnknownFields())) return false;
        return true;
      }

      @java.lang.Override
      public int hashCode() {
        if (memoizedHashCode != 0) {
          return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        if (getExampleCountCount() > 0) {
          hash = (37 * hash) + EXAMPLE_COUNT_FIELD_NUMBER;
          hash = (53 * hash) + getExampleCountList().hashCode();
        }
        hash = (29 * hash) + getUnknownFields().hashCode();
        memoizedHashCode = hash;
        return hash;
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(java.nio.ByteBuffer data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(
              java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(com.google.protobuf.ByteString data)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(
              com.google.protobuf.ByteString data,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(
              java.io.InputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
            PARSER, input, extensionRegistry);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseDelimitedFrom(
              java.io.InputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
            PARSER, input, extensionRegistry);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          parseFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
            PARSER, input, extensionRegistry);
      }

      @java.lang.Override
      public Builder newBuilderForType() {
        return newBuilder();
      }

      public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
      }

      public static Builder newBuilder(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
              prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }

      @java.lang.Override
      public Builder toBuilder() {
        return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
      }

      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       *
       *
       * <pre>
       * Output only. A row in the confusion matrix.
       * </pre>
       *
       * Protobuf type {@code
       * google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row}
       */
      public static final class Builder
          extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
          implements
          // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          return com.google.cloud.automl.v1.ClassificationProto
              .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor;
        }

        @java.lang.Override
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.google.cloud.automl.v1.ClassificationProto
              .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                      .class,
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                      .Builder.class);
        }

        // Construct using
        // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.newBuilder()
        private Builder() {}

        private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
        }

        @java.lang.Override
        public Builder clear() {
          super.clear();
          bitField0_ = 0;
          exampleCount_ = emptyIntList();
          return this;
        }

        @java.lang.Override
        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
          return com.google.cloud.automl.v1.ClassificationProto
              .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_Row_descriptor;
        }

        @java.lang.Override
        public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
            getDefaultInstanceForType() {
          return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
              .getDefaultInstance();
        }

        @java.lang.Override
        public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
            build() {
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result =
              buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        @java.lang.Override
        public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
            buildPartial() {
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result =
              new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row(
                  this);
          buildPartialRepeatedFields(result);
          if (bitField0_ != 0) {
            buildPartial0(result);
          }
          onBuilt();
          return result;
        }

        private void buildPartialRepeatedFields(
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result) {
          if (((bitField0_ & 0x00000001) != 0)) {
            exampleCount_.makeImmutable();
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.exampleCount_ = exampleCount_;
        }

        private void buildPartial0(
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row result) {
          int from_bitField0_ = bitField0_;
        }

        @java.lang.Override
        public Builder clone() {
          return super.clone();
        }

        @java.lang.Override
        public Builder setField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.setField(field, value);
        }

        @java.lang.Override
        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
          return super.clearField(field);
        }

        @java.lang.Override
        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
          return super.clearOneof(oneof);
        }

        @java.lang.Override
        public Builder setRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field,
            int index,
            java.lang.Object value) {
          return super.setRepeatedField(field, index, value);
        }

        @java.lang.Override
        public Builder addRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
          return super.addRepeatedField(field, value);
        }

        @java.lang.Override
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other
              instanceof
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row) {
            return mergeFrom(
                (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
                    other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row other) {
          if (other
              == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                  .getDefaultInstance()) return this;
          if (!other.exampleCount_.isEmpty()) {
            if (exampleCount_.isEmpty()) {
              exampleCount_ = other.exampleCount_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureExampleCountIsMutable();
              exampleCount_.addAll(other.exampleCount_);
            }
            onChanged();
          }
          this.mergeUnknownFields(other.getUnknownFields());
          onChanged();
          return this;
        }

        @java.lang.Override
        public final boolean isInitialized() {
          return true;
        }

        @java.lang.Override
        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          if (extensionRegistry == null) {
            throw new java.lang.NullPointerException();
          }
          try {
            boolean done = false;
            while (!done) {
              int tag = input.readTag();
              switch (tag) {
                case 0:
                  done = true;
                  break;
                case 8:
                  {
                    int v = input.readInt32();
                    ensureExampleCountIsMutable();
                    exampleCount_.addInt(v);
                    break;
                  } // case 8
                case 10:
                  {
                    int length = input.readRawVarint32();
                    int limit = input.pushLimit(length);
                    ensureExampleCountIsMutable();
                    while (input.getBytesUntilLimit() > 0) {
                      exampleCount_.addInt(input.readInt32());
                    }
                    input.popLimit(limit);
                    break;
                  } // case 10
                default:
                  {
                    if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                      done = true; // was an endgroup tag
                    }
                    break;
                  } // default:
              } // switch (tag)
            } // while (!done)
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.unwrapIOException();
          } finally {
            onChanged();
          } // finally
          return this;
        }

        private int bitField0_;

        private com.google.protobuf.Internal.IntList exampleCount_ = emptyIntList();

        private void ensureExampleCountIsMutable() {
          if (!((bitField0_ & 0x00000001) != 0)) {
            exampleCount_ = mutableCopy(exampleCount_);
            bitField0_ |= 0x00000001;
          }
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @return A list containing the exampleCount.
         */
        public java.util.List<java.lang.Integer> getExampleCountList() {
          return ((bitField0_ & 0x00000001) != 0)
              ? java.util.Collections.unmodifiableList(exampleCount_)
              : exampleCount_;
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @return The count of exampleCount.
         */
        public int getExampleCountCount() {
          return exampleCount_.size();
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @param index The index of the element to return.
         * @return The exampleCount at the given index.
         */
        public int getExampleCount(int index) {
          return exampleCount_.getInt(index);
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @param index The index to set the value at.
         * @param value The exampleCount to set.
         * @return This builder for chaining.
         */
        public Builder setExampleCount(int index, int value) {

          ensureExampleCountIsMutable();
          exampleCount_.setInt(index, value);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @param value The exampleCount to add.
         * @return This builder for chaining.
         */
        public Builder addExampleCount(int value) {

          ensureExampleCountIsMutable();
          exampleCount_.addInt(value);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @param values The exampleCount to add.
         * @return This builder for chaining.
         */
        public Builder addAllExampleCount(java.lang.Iterable<? extends java.lang.Integer> values) {
          ensureExampleCountIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exampleCount_);
          onChanged();
          return this;
        }
        /**
         *
         *
         * <pre>
         * Output only. Value of the specific cell in the confusion matrix.
         * The number of values each row has (i.e. the length of the row) is equal
         * to the length of the `annotation_spec_id` field or, if that one is not
         * populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
         * </pre>
         *
         * <code>repeated int32 example_count = 1;</code>
         *
         * @return This builder for chaining.
         */
        public Builder clearExampleCount() {
          exampleCount_ = emptyIntList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
          return this;
        }

        @java.lang.Override
        public final Builder setUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.setUnknownFields(unknownFields);
        }

        @java.lang.Override
        public final Builder mergeUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.mergeUnknownFields(unknownFields);
        }

        // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
      }

      // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row)
      private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics
              .ConfusionMatrix.Row
          DEFAULT_INSTANCE;

      static {
        DEFAULT_INSTANCE =
            new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row();
      }

      public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

      private static final com.google.protobuf.Parser<Row> PARSER =
          new com.google.protobuf.AbstractParser<Row>() {
            @java.lang.Override
            public Row parsePartialFrom(
                com.google.protobuf.CodedInputStream input,
                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                throws com.google.protobuf.InvalidProtocolBufferException {
              Builder builder = newBuilder();
              try {
                builder.mergeFrom(input, extensionRegistry);
              } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                throw e.setUnfinishedMessage(builder.buildPartial());
              } catch (com.google.protobuf.UninitializedMessageException e) {
                throw e.asInvalidProtocolBufferException()
                    .setUnfinishedMessage(builder.buildPartial());
              } catch (java.io.IOException e) {
                throw new com.google.protobuf.InvalidProtocolBufferException(e)
                    .setUnfinishedMessage(builder.buildPartial());
              }
              return builder.buildPartial();
            }
          };

      public static com.google.protobuf.Parser<Row> parser() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.protobuf.Parser<Row> getParserForType() {
        return PARSER;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
          getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
    }

    public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private com.google.protobuf.LazyStringList annotationSpecId_;
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @return A list containing the annotationSpecId.
     */
    public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() {
      return annotationSpecId_;
    }
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @return The count of annotationSpecId.
     */
    public int getAnnotationSpecIdCount() {
      return annotationSpecId_.size();
    }
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The annotationSpecId at the given index.
     */
    public java.lang.String getAnnotationSpecId(int index) {
      return annotationSpecId_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. IDs of the annotation specs used in the confusion matrix.
     * For Tables CLASSIFICATION
     * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
     * only list of [annotation_spec_display_name-s][] is populated.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the annotationSpecId at the given index.
     */
    public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) {
      return annotationSpecId_.getByteString(index);
    }

    public static final int DISPLAY_NAME_FIELD_NUMBER = 3;

    @SuppressWarnings("serial")
    private com.google.protobuf.LazyStringList displayName_;
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @return A list containing the displayName.
     */
    public com.google.protobuf.ProtocolStringList getDisplayNameList() {
      return displayName_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @return The count of displayName.
     */
    public int getDisplayNameCount() {
      return displayName_.size();
    }
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The displayName at the given index.
     */
    public java.lang.String getDisplayName(int index) {
      return displayName_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. Display name of the annotation specs used in the confusion
     * matrix, as they were at the moment of the evaluation. For Tables
     * CLASSIFICATION
     * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
     * distinct values of the target column at the moment of the model
     * evaluation are populated here.
     * </pre>
     *
     * <code>repeated string display_name = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the displayName at the given index.
     */
    public com.google.protobuf.ByteString getDisplayNameBytes(int index) {
      return displayName_.getByteString(index);
    }

    public static final int ROW_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private java.util.List<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>
        row_;
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    @java.lang.Override
    public java.util.List<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>
        getRowList() {
      return row_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    @java.lang.Override
    public java.util.List<
            ? extends
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                    .RowOrBuilder>
        getRowOrBuilderList() {
      return row_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    @java.lang.Override
    public int getRowCount() {
      return row_.size();
    }
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(
        int index) {
      return row_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. Rows in the confusion matrix. The number of rows is equal to
     * the size of `annotation_spec_id`.
     * `row[i].example_count[j]` is the number of examples that have ground
     * truth of the `annotation_spec_id[i]` and are predicted as
     * `annotation_spec_id[j]` by the model being evaluated.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder
        getRowOrBuilder(int index) {
      return row_.get(index);
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      for (int i = 0; i < annotationSpecId_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, annotationSpecId_.getRaw(i));
      }
      for (int i = 0; i < row_.size(); i++) {
        output.writeMessage(2, row_.get(i));
      }
      for (int i = 0; i < displayName_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_.getRaw(i));
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      {
        int dataSize = 0;
        for (int i = 0; i < annotationSpecId_.size(); i++) {
          dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getAnnotationSpecIdList().size();
      }
      for (int i = 0; i < row_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, row_.get(i));
      }
      {
        int dataSize = 0;
        for (int i = 0; i < displayName_.size(); i++) {
          dataSize += computeStringSizeNoTag(displayName_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getDisplayNameList().size();
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj
          instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)) {
        return super.equals(obj);
      }
      com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix other =
          (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) obj;

      if (!getAnnotationSpecIdList().equals(other.getAnnotationSpecIdList())) return false;
      if (!getDisplayNameList().equals(other.getDisplayNameList())) return false;
      if (!getRowList().equals(other.getRowList())) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getAnnotationSpecIdCount() > 0) {
        hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER;
        hash = (53 * hash) + getAnnotationSpecIdList().hashCode();
      }
      if (getDisplayNameCount() > 0) {
        hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
        hash = (53 * hash) + getDisplayNameList().hashCode();
      }
      if (getRowCount() > 0) {
        hash = (37 * hash) + ROW_FIELD_NUMBER;
        hash = (53 * hash) + getRowList().hashCode();
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(
            java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseDelimitedFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Confusion matrix of the model running the classification.
     * </pre>
     *
     * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.class,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.newBuilder()
      private Builder() {}

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        if (rowBuilder_ == null) {
          row_ = java.util.Collections.emptyList();
        } else {
          row_ = null;
          rowBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.automl.v1.ClassificationProto
            .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_ConfusionMatrix_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
          getDefaultInstanceForType() {
        return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix build() {
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
          buildPartial() {
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result =
            new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix(this);
        buildPartialRepeatedFields(result);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartialRepeatedFields(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result) {
        if (((bitField0_ & 0x00000001) != 0)) {
          annotationSpecId_ = annotationSpecId_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.annotationSpecId_ = annotationSpecId_;
        if (((bitField0_ & 0x00000002) != 0)) {
          displayName_ = displayName_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.displayName_ = displayName_;
        if (rowBuilder_ == null) {
          if (((bitField0_ & 0x00000004) != 0)) {
            row_ = java.util.Collections.unmodifiableList(row_);
            bitField0_ = (bitField0_ & ~0x00000004);
          }
          result.row_ = row_;
        } else {
          result.row_ = rowBuilder_.build();
        }
      }

      private void buildPartial0(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix result) {
        int from_bitField0_ = bitField0_;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other
            instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) {
          return mergeFrom(
              (com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix other) {
        if (other
            == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                .getDefaultInstance()) return this;
        if (!other.annotationSpecId_.isEmpty()) {
          if (annotationSpecId_.isEmpty()) {
            annotationSpecId_ = other.annotationSpecId_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureAnnotationSpecIdIsMutable();
            annotationSpecId_.addAll(other.annotationSpecId_);
          }
          onChanged();
        }
        if (!other.displayName_.isEmpty()) {
          if (displayName_.isEmpty()) {
            displayName_ = other.displayName_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureDisplayNameIsMutable();
            displayName_.addAll(other.displayName_);
          }
          onChanged();
        }
        if (rowBuilder_ == null) {
          if (!other.row_.isEmpty()) {
            if (row_.isEmpty()) {
              row_ = other.row_;
              bitField0_ = (bitField0_ & ~0x00000004);
            } else {
              ensureRowIsMutable();
              row_.addAll(other.row_);
            }
            onChanged();
          }
        } else {
          if (!other.row_.isEmpty()) {
            if (rowBuilder_.isEmpty()) {
              rowBuilder_.dispose();
              rowBuilder_ = null;
              row_ = other.row_;
              bitField0_ = (bitField0_ & ~0x00000004);
              rowBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                      ? getRowFieldBuilder()
                      : null;
            } else {
              rowBuilder_.addAllMessages(other.row_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10:
                {
                  java.lang.String s = input.readStringRequireUtf8();
                  ensureAnnotationSpecIdIsMutable();
                  annotationSpecId_.add(s);
                  break;
                } // case 10
              case 18:
                {
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row m =
                      input.readMessage(
                          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                              .Row.parser(),
                          extensionRegistry);
                  if (rowBuilder_ == null) {
                    ensureRowIsMutable();
                    row_.add(m);
                  } else {
                    rowBuilder_.addMessage(m);
                  }
                  break;
                } // case 18
              case 26:
                {
                  java.lang.String s = input.readStringRequireUtf8();
                  ensureDisplayNameIsMutable();
                  displayName_.add(s);
                  break;
                } // case 26
              default:
                {
                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                    done = true; // was an endgroup tag
                  }
                  break;
                } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }

      private int bitField0_;

      private com.google.protobuf.LazyStringList annotationSpecId_ =
          com.google.protobuf.LazyStringArrayList.EMPTY;

      private void ensureAnnotationSpecIdIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_);
          bitField0_ |= 0x00000001;
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @return A list containing the annotationSpecId.
       */
      public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() {
        return annotationSpecId_.getUnmodifiableView();
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @return The count of annotationSpecId.
       */
      public int getAnnotationSpecIdCount() {
        return annotationSpecId_.size();
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param index The index of the element to return.
       * @return The annotationSpecId at the given index.
       */
      public java.lang.String getAnnotationSpecId(int index) {
        return annotationSpecId_.get(index);
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param index The index of the value to return.
       * @return The bytes of the annotationSpecId at the given index.
       */
      public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) {
        return annotationSpecId_.getByteString(index);
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param index The index to set the value at.
       * @param value The annotationSpecId to set.
       * @return This builder for chaining.
       */
      public Builder setAnnotationSpecId(int index, java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureAnnotationSpecIdIsMutable();
        annotationSpecId_.set(index, value);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param value The annotationSpecId to add.
       * @return This builder for chaining.
       */
      public Builder addAnnotationSpecId(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureAnnotationSpecIdIsMutable();
        annotationSpecId_.add(value);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param values The annotationSpecId to add.
       * @return This builder for chaining.
       */
      public Builder addAllAnnotationSpecId(java.lang.Iterable<java.lang.String> values) {
        ensureAnnotationSpecIdIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationSpecId_);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearAnnotationSpecId() {
        annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. IDs of the annotation specs used in the confusion matrix.
       * For Tables CLASSIFICATION
       * [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
       * only list of [annotation_spec_display_name-s][] is populated.
       * </pre>
       *
       * <code>repeated string annotation_spec_id = 1;</code>
       *
       * @param value The bytes of the annotationSpecId to add.
       * @return This builder for chaining.
       */
      public Builder addAnnotationSpecIdBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        ensureAnnotationSpecIdIsMutable();
        annotationSpecId_.add(value);
        onChanged();
        return this;
      }

      private com.google.protobuf.LazyStringList displayName_ =
          com.google.protobuf.LazyStringArrayList.EMPTY;

      private void ensureDisplayNameIsMutable() {
        if (!((bitField0_ & 0x00000002) != 0)) {
          displayName_ = new com.google.protobuf.LazyStringArrayList(displayName_);
          bitField0_ |= 0x00000002;
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @return A list containing the displayName.
       */
      public com.google.protobuf.ProtocolStringList getDisplayNameList() {
        return displayName_.getUnmodifiableView();
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @return The count of displayName.
       */
      public int getDisplayNameCount() {
        return displayName_.size();
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param index The index of the element to return.
       * @return The displayName at the given index.
       */
      public java.lang.String getDisplayName(int index) {
        return displayName_.get(index);
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param index The index of the value to return.
       * @return The bytes of the displayName at the given index.
       */
      public com.google.protobuf.ByteString getDisplayNameBytes(int index) {
        return displayName_.getByteString(index);
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param index The index to set the value at.
       * @param value The displayName to set.
       * @return This builder for chaining.
       */
      public Builder setDisplayName(int index, java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDisplayNameIsMutable();
        displayName_.set(index, value);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param value The displayName to add.
       * @return This builder for chaining.
       */
      public Builder addDisplayName(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureDisplayNameIsMutable();
        displayName_.add(value);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param values The displayName to add.
       * @return This builder for chaining.
       */
      public Builder addAllDisplayName(java.lang.Iterable<java.lang.String> values) {
        ensureDisplayNameIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, displayName_);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearDisplayName() {
        displayName_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Display name of the annotation specs used in the confusion
       * matrix, as they were at the moment of the evaluation. For Tables
       * CLASSIFICATION
       * [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
       * distinct values of the target column at the moment of the model
       * evaluation are populated here.
       * </pre>
       *
       * <code>repeated string display_name = 3;</code>
       *
       * @param value The bytes of the displayName to add.
       * @return This builder for chaining.
       */
      public Builder addDisplayNameBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        ensureDisplayNameIsMutable();
        displayName_.add(value);
        onChanged();
        return this;
      }

      private java.util.List<
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>
          row_ = java.util.Collections.emptyList();

      private void ensureRowIsMutable() {
        if (!((bitField0_ & 0x00000004) != 0)) {
          row_ =
              new java.util.ArrayList<
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>(
                  row_);
          bitField0_ |= 0x00000004;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                  .Builder,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                  .RowOrBuilder>
          rowBuilder_;

      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public java.util.List<
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row>
          getRowList() {
        if (rowBuilder_ == null) {
          return java.util.Collections.unmodifiableList(row_);
        } else {
          return rowBuilder_.getMessageList();
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public int getRowCount() {
        if (rowBuilder_ == null) {
          return row_.size();
        } else {
          return rowBuilder_.getCount();
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row getRow(
          int index) {
        if (rowBuilder_ == null) {
          return row_.get(index);
        } else {
          return rowBuilder_.getMessage(index);
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder setRow(
          int index,
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) {
        if (rowBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureRowIsMutable();
          row_.set(index, value);
          onChanged();
        } else {
          rowBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder setRow(
          int index,
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
              builderForValue) {
        if (rowBuilder_ == null) {
          ensureRowIsMutable();
          row_.set(index, builderForValue.build());
          onChanged();
        } else {
          rowBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder addRow(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) {
        if (rowBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureRowIsMutable();
          row_.add(value);
          onChanged();
        } else {
          rowBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder addRow(
          int index,
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row value) {
        if (rowBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureRowIsMutable();
          row_.add(index, value);
          onChanged();
        } else {
          rowBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder addRow(
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
              builderForValue) {
        if (rowBuilder_ == null) {
          ensureRowIsMutable();
          row_.add(builderForValue.build());
          onChanged();
        } else {
          rowBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder addRow(
          int index,
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
              builderForValue) {
        if (rowBuilder_ == null) {
          ensureRowIsMutable();
          row_.add(index, builderForValue.build());
          onChanged();
        } else {
          rowBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder addAllRow(
          java.lang.Iterable<
                  ? extends
                      com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                          .Row>
              values) {
        if (rowBuilder_ == null) {
          ensureRowIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, row_);
          onChanged();
        } else {
          rowBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder clearRow() {
        if (rowBuilder_ == null) {
          row_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000004);
          onChanged();
        } else {
          rowBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public Builder removeRow(int index) {
        if (rowBuilder_ == null) {
          ensureRowIsMutable();
          row_.remove(index);
          onChanged();
        } else {
          rowBuilder_.remove(index);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
          getRowBuilder(int index) {
        return getRowFieldBuilder().getBuilder(index);
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.RowOrBuilder
          getRowOrBuilder(int index) {
        if (rowBuilder_ == null) {
          return row_.get(index);
        } else {
          return rowBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public java.util.List<
              ? extends
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                      .RowOrBuilder>
          getRowOrBuilderList() {
        if (rowBuilder_ != null) {
          return rowBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(row_);
        }
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
          addRowBuilder() {
        return getRowFieldBuilder()
            .addBuilder(
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                    .getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row.Builder
          addRowBuilder(int index) {
        return getRowFieldBuilder()
            .addBuilder(
                index,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                    .getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * Output only. Rows in the confusion matrix. The number of rows is equal to
       * the size of `annotation_spec_id`.
       * `row[i].example_count[j]` is the number of examples that have ground
       * truth of the `annotation_spec_id[i]` and are predicted as
       * `annotation_spec_id[j]` by the model being evaluated.
       * </pre>
       *
       * <code>
       * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row row = 2;
       * </code>
       */
      public java.util.List<
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                  .Builder>
          getRowBuilderList() {
        return getRowFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                  .Builder,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                  .RowOrBuilder>
          getRowFieldBuilder() {
        if (rowBuilder_ == null) {
          rowBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row,
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Row
                      .Builder,
                  com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                      .RowOrBuilder>(
                  row_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
          row_ = null;
        }
        return rowBuilder_;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix)
    private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix();
    }

    public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ConfusionMatrix> PARSER =
        new com.google.protobuf.AbstractParser<ConfusionMatrix>() {
          @java.lang.Override
          public ConfusionMatrix parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            Builder builder = newBuilder();
            try {
              builder.mergeFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
              throw e.setUnfinishedMessage(builder.buildPartial());
            } catch (com.google.protobuf.UninitializedMessageException e) {
              throw e.asInvalidProtocolBufferException()
                  .setUnfinishedMessage(builder.buildPartial());
            } catch (java.io.IOException e) {
              throw new com.google.protobuf.InvalidProtocolBufferException(e)
                  .setUnfinishedMessage(builder.buildPartial());
            }
            return builder.buildPartial();
          }
        };

    public static com.google.protobuf.Parser<ConfusionMatrix> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ConfusionMatrix> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public static final int AU_PRC_FIELD_NUMBER = 1;
  private float auPrc_ = 0F;
  /**
   *
   *
   * <pre>
   * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
   * for the overall evaluation.
   * </pre>
   *
   * <code>float au_prc = 1;</code>
   *
   * @return The auPrc.
   */
  @java.lang.Override
  public float getAuPrc() {
    return auPrc_;
  }

  public static final int AU_ROC_FIELD_NUMBER = 6;
  private float auRoc_ = 0F;
  /**
   *
   *
   * <pre>
   * Output only. The Area Under Receiver Operating Characteristic curve metric.
   * Micro-averaged for the overall evaluation.
   * </pre>
   *
   * <code>float au_roc = 6;</code>
   *
   * @return The auRoc.
   */
  @java.lang.Override
  public float getAuRoc() {
    return auRoc_;
  }

  public static final int LOG_LOSS_FIELD_NUMBER = 7;
  private float logLoss_ = 0F;
  /**
   *
   *
   * <pre>
   * Output only. The Log Loss metric.
   * </pre>
   *
   * <code>float log_loss = 7;</code>
   *
   * @return The logLoss.
   */
  @java.lang.Override
  public float getLogLoss() {
    return logLoss_;
  }

  public static final int CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private java.util.List<
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>
      confidenceMetricsEntry_;
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each confidence_threshold in
   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
   * position_threshold = INT32_MAX_VALUE.
   * ROC and precision-recall curves, and other aggregated metrics are derived
   * from them. The confidence metrics entries may also be supplied for
   * additional values of position_threshold, but from these no aggregated
   * metrics are computed.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
   * </code>
   */
  @java.lang.Override
  public java.util.List<
          com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>
      getConfidenceMetricsEntryList() {
    return confidenceMetricsEntry_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each confidence_threshold in
   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
   * position_threshold = INT32_MAX_VALUE.
   * ROC and precision-recall curves, and other aggregated metrics are derived
   * from them. The confidence metrics entries may also be supplied for
   * additional values of position_threshold, but from these no aggregated
   * metrics are computed.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
   * </code>
   */
  @java.lang.Override
  public java.util.List<
          ? extends
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                  .ConfidenceMetricsEntryOrBuilder>
      getConfidenceMetricsEntryOrBuilderList() {
    return confidenceMetricsEntry_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each confidence_threshold in
   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
   * position_threshold = INT32_MAX_VALUE.
   * ROC and precision-recall curves, and other aggregated metrics are derived
   * from them. The confidence metrics entries may also be supplied for
   * additional values of position_threshold, but from these no aggregated
   * metrics are computed.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
   * </code>
   */
  @java.lang.Override
  public int getConfidenceMetricsEntryCount() {
    return confidenceMetricsEntry_.size();
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each confidence_threshold in
   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
   * position_threshold = INT32_MAX_VALUE.
   * ROC and precision-recall curves, and other aggregated metrics are derived
   * from them. The confidence metrics entries may also be supplied for
   * additional values of position_threshold, but from these no aggregated
   * metrics are computed.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
      getConfidenceMetricsEntry(int index) {
    return confidenceMetricsEntry_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each confidence_threshold in
   * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
   * position_threshold = INT32_MAX_VALUE.
   * ROC and precision-recall curves, and other aggregated metrics are derived
   * from them. The confidence metrics entries may also be supplied for
   * additional values of position_threshold, but from these no aggregated
   * metrics are computed.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntryOrBuilder
      getConfidenceMetricsEntryOrBuilder(int index) {
    return confidenceMetricsEntry_.get(index);
  }

  public static final int CONFUSION_MATRIX_FIELD_NUMBER = 4;
  private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
      confusionMatrix_;
  /**
   *
   *
   * <pre>
   * Output only. Confusion matrix of the evaluation.
   * Only set for MULTICLASS classification problems where number
   * of labels is no more than 10.
   * Only set for model level evaluation, not for evaluation per label.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
   * </code>
   *
   * @return Whether the confusionMatrix field is set.
   */
  @java.lang.Override
  public boolean hasConfusionMatrix() {
    return confusionMatrix_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. Confusion matrix of the evaluation.
   * Only set for MULTICLASS classification problems where number
   * of labels is no more than 10.
   * Only set for model level evaluation, not for evaluation per label.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
   * </code>
   *
   * @return The confusionMatrix.
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
      getConfusionMatrix() {
    return confusionMatrix_ == null
        ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
            .getDefaultInstance()
        : confusionMatrix_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Confusion matrix of the evaluation.
   * Only set for MULTICLASS classification problems where number
   * of labels is no more than 10.
   * Only set for model level evaluation, not for evaluation per label.
   * </pre>
   *
   * <code>
   * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder
      getConfusionMatrixOrBuilder() {
    return confusionMatrix_ == null
        ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
            .getDefaultInstance()
        : confusionMatrix_;
  }

  public static final int ANNOTATION_SPEC_ID_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList annotationSpecId_;
  /**
   *
   *
   * <pre>
   * Output only. The annotation spec ids used for this evaluation.
   * </pre>
   *
   * <code>repeated string annotation_spec_id = 5;</code>
   *
   * @return A list containing the annotationSpecId.
   */
  public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() {
    return annotationSpecId_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The annotation spec ids used for this evaluation.
   * </pre>
   *
   * <code>repeated string annotation_spec_id = 5;</code>
   *
   * @return The count of annotationSpecId.
   */
  public int getAnnotationSpecIdCount() {
    return annotationSpecId_.size();
  }
  /**
   *
   *
   * <pre>
   * Output only. The annotation spec ids used for this evaluation.
   * </pre>
   *
   * <code>repeated string annotation_spec_id = 5;</code>
   *
   * @param index The index of the element to return.
   * @return The annotationSpecId at the given index.
   */
  public java.lang.String getAnnotationSpecId(int index) {
    return annotationSpecId_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Output only. The annotation spec ids used for this evaluation.
   * </pre>
   *
   * <code>repeated string annotation_spec_id = 5;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the annotationSpecId at the given index.
   */
  public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) {
    return annotationSpecId_.getByteString(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (java.lang.Float.floatToRawIntBits(auPrc_) != 0) {
      output.writeFloat(1, auPrc_);
    }
    for (int i = 0; i < confidenceMetricsEntry_.size(); i++) {
      output.writeMessage(3, confidenceMetricsEntry_.get(i));
    }
    if (confusionMatrix_ != null) {
      output.writeMessage(4, getConfusionMatrix());
    }
    for (int i = 0; i < annotationSpecId_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, annotationSpecId_.getRaw(i));
    }
    if (java.lang.Float.floatToRawIntBits(auRoc_) != 0) {
      output.writeFloat(6, auRoc_);
    }
    if (java.lang.Float.floatToRawIntBits(logLoss_) != 0) {
      output.writeFloat(7, logLoss_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (java.lang.Float.floatToRawIntBits(auPrc_) != 0) {
      size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, auPrc_);
    }
    for (int i = 0; i < confidenceMetricsEntry_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, confidenceMetricsEntry_.get(i));
    }
    if (confusionMatrix_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConfusionMatrix());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < annotationSpecId_.size(); i++) {
        dataSize += computeStringSizeNoTag(annotationSpecId_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getAnnotationSpecIdList().size();
    }
    if (java.lang.Float.floatToRawIntBits(auRoc_) != 0) {
      size += com.google.protobuf.CodedOutputStream.computeFloatSize(6, auRoc_);
    }
    if (java.lang.Float.floatToRawIntBits(logLoss_) != 0) {
      size += com.google.protobuf.CodedOutputStream.computeFloatSize(7, logLoss_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics)) {
      return super.equals(obj);
    }
    com.google.cloud.automl.v1.ClassificationEvaluationMetrics other =
        (com.google.cloud.automl.v1.ClassificationEvaluationMetrics) obj;

    if (java.lang.Float.floatToIntBits(getAuPrc())
        != java.lang.Float.floatToIntBits(other.getAuPrc())) return false;
    if (java.lang.Float.floatToIntBits(getAuRoc())
        != java.lang.Float.floatToIntBits(other.getAuRoc())) return false;
    if (java.lang.Float.floatToIntBits(getLogLoss())
        != java.lang.Float.floatToIntBits(other.getLogLoss())) return false;
    if (!getConfidenceMetricsEntryList().equals(other.getConfidenceMetricsEntryList()))
      return false;
    if (hasConfusionMatrix() != other.hasConfusionMatrix()) return false;
    if (hasConfusionMatrix()) {
      if (!getConfusionMatrix().equals(other.getConfusionMatrix())) return false;
    }
    if (!getAnnotationSpecIdList().equals(other.getAnnotationSpecIdList())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + AU_PRC_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuPrc());
    hash = (37 * hash) + AU_ROC_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(getAuRoc());
    hash = (37 * hash) + LOG_LOSS_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(getLogLoss());
    if (getConfidenceMetricsEntryCount() > 0) {
      hash = (37 * hash) + CONFIDENCE_METRICS_ENTRY_FIELD_NUMBER;
      hash = (53 * hash) + getConfidenceMetricsEntryList().hashCode();
    }
    if (hasConfusionMatrix()) {
      hash = (37 * hash) + CONFUSION_MATRIX_FIELD_NUMBER;
      hash = (53 * hash) + getConfusionMatrix().hashCode();
    }
    if (getAnnotationSpecIdCount() > 0) {
      hash = (37 * hash) + ANNOTATION_SPEC_ID_FIELD_NUMBER;
      hash = (53 * hash) + getAnnotationSpecIdList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.automl.v1.ClassificationEvaluationMetrics prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Model evaluation metrics for classification problems.
   * Note: For Video Classification this metrics only describe quality of the
   * Video Classification predictions of "segment_classification" type.
   * </pre>
   *
   * Protobuf type {@code google.cloud.automl.v1.ClassificationEvaluationMetrics}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.ClassificationEvaluationMetrics)
      com.google.cloud.automl.v1.ClassificationEvaluationMetricsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.class,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.Builder.class);
    }

    // Construct using com.google.cloud.automl.v1.ClassificationEvaluationMetrics.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      auPrc_ = 0F;
      auRoc_ = 0F;
      logLoss_ = 0F;
      if (confidenceMetricsEntryBuilder_ == null) {
        confidenceMetricsEntry_ = java.util.Collections.emptyList();
      } else {
        confidenceMetricsEntry_ = null;
        confidenceMetricsEntryBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000008);
      confusionMatrix_ = null;
      if (confusionMatrixBuilder_ != null) {
        confusionMatrixBuilder_.dispose();
        confusionMatrixBuilder_ = null;
      }
      annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.automl.v1.ClassificationProto
          .internal_static_google_cloud_automl_v1_ClassificationEvaluationMetrics_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstanceForType() {
      return com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics build() {
      com.google.cloud.automl.v1.ClassificationEvaluationMetrics result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics buildPartial() {
      com.google.cloud.automl.v1.ClassificationEvaluationMetrics result =
          new com.google.cloud.automl.v1.ClassificationEvaluationMetrics(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics result) {
      if (confidenceMetricsEntryBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)) {
          confidenceMetricsEntry_ = java.util.Collections.unmodifiableList(confidenceMetricsEntry_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.confidenceMetricsEntry_ = confidenceMetricsEntry_;
      } else {
        result.confidenceMetricsEntry_ = confidenceMetricsEntryBuilder_.build();
      }
      if (((bitField0_ & 0x00000020) != 0)) {
        annotationSpecId_ = annotationSpecId_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000020);
      }
      result.annotationSpecId_ = annotationSpecId_;
    }

    private void buildPartial0(com.google.cloud.automl.v1.ClassificationEvaluationMetrics result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.auPrc_ = auPrc_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.auRoc_ = auRoc_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.logLoss_ = logLoss_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.confusionMatrix_ =
            confusionMatrixBuilder_ == null ? confusionMatrix_ : confusionMatrixBuilder_.build();
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.automl.v1.ClassificationEvaluationMetrics) {
        return mergeFrom((com.google.cloud.automl.v1.ClassificationEvaluationMetrics) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.automl.v1.ClassificationEvaluationMetrics other) {
      if (other == com.google.cloud.automl.v1.ClassificationEvaluationMetrics.getDefaultInstance())
        return this;
      if (other.getAuPrc() != 0F) {
        setAuPrc(other.getAuPrc());
      }
      if (other.getAuRoc() != 0F) {
        setAuRoc(other.getAuRoc());
      }
      if (other.getLogLoss() != 0F) {
        setLogLoss(other.getLogLoss());
      }
      if (confidenceMetricsEntryBuilder_ == null) {
        if (!other.confidenceMetricsEntry_.isEmpty()) {
          if (confidenceMetricsEntry_.isEmpty()) {
            confidenceMetricsEntry_ = other.confidenceMetricsEntry_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureConfidenceMetricsEntryIsMutable();
            confidenceMetricsEntry_.addAll(other.confidenceMetricsEntry_);
          }
          onChanged();
        }
      } else {
        if (!other.confidenceMetricsEntry_.isEmpty()) {
          if (confidenceMetricsEntryBuilder_.isEmpty()) {
            confidenceMetricsEntryBuilder_.dispose();
            confidenceMetricsEntryBuilder_ = null;
            confidenceMetricsEntry_ = other.confidenceMetricsEntry_;
            bitField0_ = (bitField0_ & ~0x00000008);
            confidenceMetricsEntryBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getConfidenceMetricsEntryFieldBuilder()
                    : null;
          } else {
            confidenceMetricsEntryBuilder_.addAllMessages(other.confidenceMetricsEntry_);
          }
        }
      }
      if (other.hasConfusionMatrix()) {
        mergeConfusionMatrix(other.getConfusionMatrix());
      }
      if (!other.annotationSpecId_.isEmpty()) {
        if (annotationSpecId_.isEmpty()) {
          annotationSpecId_ = other.annotationSpecId_;
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          ensureAnnotationSpecIdIsMutable();
          annotationSpecId_.addAll(other.annotationSpecId_);
        }
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 13:
              {
                auPrc_ = input.readFloat();
                bitField0_ |= 0x00000001;
                break;
              } // case 13
            case 26:
              {
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                    m =
                        input.readMessage(
                            com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                                .ConfidenceMetricsEntry.parser(),
                            extensionRegistry);
                if (confidenceMetricsEntryBuilder_ == null) {
                  ensureConfidenceMetricsEntryIsMutable();
                  confidenceMetricsEntry_.add(m);
                } else {
                  confidenceMetricsEntryBuilder_.addMessage(m);
                }
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getConfusionMatrixFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000010;
                break;
              } // case 34
            case 42:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureAnnotationSpecIdIsMutable();
                annotationSpecId_.add(s);
                break;
              } // case 42
            case 53:
              {
                auRoc_ = input.readFloat();
                bitField0_ |= 0x00000002;
                break;
              } // case 53
            case 61:
              {
                logLoss_ = input.readFloat();
                bitField0_ |= 0x00000004;
                break;
              } // case 61
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private float auPrc_;
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
     * for the overall evaluation.
     * </pre>
     *
     * <code>float au_prc = 1;</code>
     *
     * @return The auPrc.
     */
    @java.lang.Override
    public float getAuPrc() {
      return auPrc_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
     * for the overall evaluation.
     * </pre>
     *
     * <code>float au_prc = 1;</code>
     *
     * @param value The auPrc to set.
     * @return This builder for chaining.
     */
    public Builder setAuPrc(float value) {

      auPrc_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
     * for the overall evaluation.
     * </pre>
     *
     * <code>float au_prc = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAuPrc() {
      bitField0_ = (bitField0_ & ~0x00000001);
      auPrc_ = 0F;
      onChanged();
      return this;
    }

    private float auRoc_;
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Receiver Operating Characteristic curve metric.
     * Micro-averaged for the overall evaluation.
     * </pre>
     *
     * <code>float au_roc = 6;</code>
     *
     * @return The auRoc.
     */
    @java.lang.Override
    public float getAuRoc() {
      return auRoc_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Receiver Operating Characteristic curve metric.
     * Micro-averaged for the overall evaluation.
     * </pre>
     *
     * <code>float au_roc = 6;</code>
     *
     * @param value The auRoc to set.
     * @return This builder for chaining.
     */
    public Builder setAuRoc(float value) {

      auRoc_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Area Under Receiver Operating Characteristic curve metric.
     * Micro-averaged for the overall evaluation.
     * </pre>
     *
     * <code>float au_roc = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAuRoc() {
      bitField0_ = (bitField0_ & ~0x00000002);
      auRoc_ = 0F;
      onChanged();
      return this;
    }

    private float logLoss_;
    /**
     *
     *
     * <pre>
     * Output only. The Log Loss metric.
     * </pre>
     *
     * <code>float log_loss = 7;</code>
     *
     * @return The logLoss.
     */
    @java.lang.Override
    public float getLogLoss() {
      return logLoss_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Log Loss metric.
     * </pre>
     *
     * <code>float log_loss = 7;</code>
     *
     * @param value The logLoss to set.
     * @return This builder for chaining.
     */
    public Builder setLogLoss(float value) {

      logLoss_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The Log Loss metric.
     * </pre>
     *
     * <code>float log_loss = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLogLoss() {
      bitField0_ = (bitField0_ & ~0x00000004);
      logLoss_ = 0F;
      onChanged();
      return this;
    }

    private java.util.List<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>
        confidenceMetricsEntry_ = java.util.Collections.emptyList();

    private void ensureConfidenceMetricsEntryIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        confidenceMetricsEntry_ =
            new java.util.ArrayList<
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>(
                confidenceMetricsEntry_);
        bitField0_ |= 0x00000008;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                .Builder,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                .ConfidenceMetricsEntryOrBuilder>
        confidenceMetricsEntryBuilder_;

    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public java.util.List<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry>
        getConfidenceMetricsEntryList() {
      if (confidenceMetricsEntryBuilder_ == null) {
        return java.util.Collections.unmodifiableList(confidenceMetricsEntry_);
      } else {
        return confidenceMetricsEntryBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public int getConfidenceMetricsEntryCount() {
      if (confidenceMetricsEntryBuilder_ == null) {
        return confidenceMetricsEntry_.size();
      } else {
        return confidenceMetricsEntryBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
        getConfidenceMetricsEntry(int index) {
      if (confidenceMetricsEntryBuilder_ == null) {
        return confidenceMetricsEntry_.get(index);
      } else {
        return confidenceMetricsEntryBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder setConfidenceMetricsEntry(
        int index,
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.set(index, value);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder setConfidenceMetricsEntry(
        int index,
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntryBuilder_ == null) {
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.set(index, builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntry(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.add(value);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntry(
        int index,
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.add(index, value);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntry(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntryBuilder_ == null) {
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.add(builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntry(
        int index,
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntryBuilder_ == null) {
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.add(index, builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder addAllConfidenceMetricsEntry(
        java.lang.Iterable<
                ? extends
                    com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                        .ConfidenceMetricsEntry>
            values) {
      if (confidenceMetricsEntryBuilder_ == null) {
        ensureConfidenceMetricsEntryIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceMetricsEntry_);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder clearConfidenceMetricsEntry() {
      if (confidenceMetricsEntryBuilder_ == null) {
        confidenceMetricsEntry_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public Builder removeConfidenceMetricsEntry(int index) {
      if (confidenceMetricsEntryBuilder_ == null) {
        ensureConfidenceMetricsEntryIsMutable();
        confidenceMetricsEntry_.remove(index);
        onChanged();
      } else {
        confidenceMetricsEntryBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
        getConfidenceMetricsEntryBuilder(int index) {
      return getConfidenceMetricsEntryFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics
            .ConfidenceMetricsEntryOrBuilder
        getConfidenceMetricsEntryOrBuilder(int index) {
      if (confidenceMetricsEntryBuilder_ == null) {
        return confidenceMetricsEntry_.get(index);
      } else {
        return confidenceMetricsEntryBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public java.util.List<
            ? extends
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                    .ConfidenceMetricsEntryOrBuilder>
        getConfidenceMetricsEntryOrBuilderList() {
      if (confidenceMetricsEntryBuilder_ != null) {
        return confidenceMetricsEntryBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(confidenceMetricsEntry_);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
        addConfidenceMetricsEntryBuilder() {
      return getConfidenceMetricsEntryFieldBuilder()
          .addBuilder(
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.Builder
        addConfidenceMetricsEntryBuilder(int index) {
      return getConfidenceMetricsEntryFieldBuilder()
          .addBuilder(
              index,
              com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each confidence_threshold in
     * 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
     * position_threshold = INT32_MAX_VALUE.
     * ROC and precision-recall curves, and other aggregated metrics are derived
     * from them. The confidence metrics entries may also be supplied for
     * additional values of position_threshold, but from these no aggregated
     * metrics are computed.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;
     * </code>
     */
    public java.util.List<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                .Builder>
        getConfidenceMetricsEntryBuilderList() {
      return getConfidenceMetricsEntryFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                .Builder,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                .ConfidenceMetricsEntryOrBuilder>
        getConfidenceMetricsEntryFieldBuilder() {
      if (confidenceMetricsEntryBuilder_ == null) {
        confidenceMetricsEntryBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry
                    .Builder,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                    .ConfidenceMetricsEntryOrBuilder>(
                confidenceMetricsEntry_,
                ((bitField0_ & 0x00000008) != 0),
                getParentForChildren(),
                isClean());
        confidenceMetricsEntry_ = null;
      }
      return confidenceMetricsEntryBuilder_;
    }

    private com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        confusionMatrix_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder>
        confusionMatrixBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     *
     * @return Whether the confusionMatrix field is set.
     */
    public boolean hasConfusionMatrix() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     *
     * @return The confusionMatrix.
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
        getConfusionMatrix() {
      if (confusionMatrixBuilder_ == null) {
        return confusionMatrix_ == null
            ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                .getDefaultInstance()
            : confusionMatrix_;
      } else {
        return confusionMatrixBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public Builder setConfusionMatrix(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) {
      if (confusionMatrixBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        confusionMatrix_ = value;
      } else {
        confusionMatrixBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public Builder setConfusionMatrix(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder
            builderForValue) {
      if (confusionMatrixBuilder_ == null) {
        confusionMatrix_ = builderForValue.build();
      } else {
        confusionMatrixBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public Builder mergeConfusionMatrix(
        com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix value) {
      if (confusionMatrixBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)
            && confusionMatrix_ != null
            && confusionMatrix_
                != com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                    .getDefaultInstance()) {
          getConfusionMatrixBuilder().mergeFrom(value);
        } else {
          confusionMatrix_ = value;
        }
      } else {
        confusionMatrixBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public Builder clearConfusionMatrix() {
      bitField0_ = (bitField0_ & ~0x00000010);
      confusionMatrix_ = null;
      if (confusionMatrixBuilder_ != null) {
        confusionMatrixBuilder_.dispose();
        confusionMatrixBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder
        getConfusionMatrixBuilder() {
      bitField0_ |= 0x00000010;
      onChanged();
      return getConfusionMatrixFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    public com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder
        getConfusionMatrixOrBuilder() {
      if (confusionMatrixBuilder_ != null) {
        return confusionMatrixBuilder_.getMessageOrBuilder();
      } else {
        return confusionMatrix_ == null
            ? com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix
                .getDefaultInstance()
            : confusionMatrix_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Confusion matrix of the evaluation.
     * Only set for MULTICLASS classification problems where number
     * of labels is no more than 10.
     * Only set for model level evaluation, not for evaluation per label.
     * </pre>
     *
     * <code>
     * .google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder,
            com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrixOrBuilder>
        getConfusionMatrixFieldBuilder() {
      if (confusionMatrixBuilder_ == null) {
        confusionMatrixBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.Builder,
                com.google.cloud.automl.v1.ClassificationEvaluationMetrics
                    .ConfusionMatrixOrBuilder>(
                getConfusionMatrix(), getParentForChildren(), isClean());
        confusionMatrix_ = null;
      }
      return confusionMatrixBuilder_;
    }

    private com.google.protobuf.LazyStringList annotationSpecId_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureAnnotationSpecIdIsMutable() {
      if (!((bitField0_ & 0x00000020) != 0)) {
        annotationSpecId_ = new com.google.protobuf.LazyStringArrayList(annotationSpecId_);
        bitField0_ |= 0x00000020;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @return A list containing the annotationSpecId.
     */
    public com.google.protobuf.ProtocolStringList getAnnotationSpecIdList() {
      return annotationSpecId_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @return The count of annotationSpecId.
     */
    public int getAnnotationSpecIdCount() {
      return annotationSpecId_.size();
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param index The index of the element to return.
     * @return The annotationSpecId at the given index.
     */
    public java.lang.String getAnnotationSpecId(int index) {
      return annotationSpecId_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the annotationSpecId at the given index.
     */
    public com.google.protobuf.ByteString getAnnotationSpecIdBytes(int index) {
      return annotationSpecId_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param index The index to set the value at.
     * @param value The annotationSpecId to set.
     * @return This builder for chaining.
     */
    public Builder setAnnotationSpecId(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAnnotationSpecIdIsMutable();
      annotationSpecId_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param value The annotationSpecId to add.
     * @return This builder for chaining.
     */
    public Builder addAnnotationSpecId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAnnotationSpecIdIsMutable();
      annotationSpecId_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param values The annotationSpecId to add.
     * @return This builder for chaining.
     */
    public Builder addAllAnnotationSpecId(java.lang.Iterable<java.lang.String> values) {
      ensureAnnotationSpecIdIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationSpecId_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAnnotationSpecId() {
      annotationSpecId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The annotation spec ids used for this evaluation.
     * </pre>
     *
     * <code>repeated string annotation_spec_id = 5;</code>
     *
     * @param value The bytes of the annotationSpecId to add.
     * @return This builder for chaining.
     */
    public Builder addAnnotationSpecIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureAnnotationSpecIdIsMutable();
      annotationSpecId_.add(value);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.ClassificationEvaluationMetrics)
  private static final com.google.cloud.automl.v1.ClassificationEvaluationMetrics DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.automl.v1.ClassificationEvaluationMetrics();
  }

  public static com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ClassificationEvaluationMetrics> PARSER =
      new com.google.protobuf.AbstractParser<ClassificationEvaluationMetrics>() {
        @java.lang.Override
        public ClassificationEvaluationMetrics parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<ClassificationEvaluationMetrics> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ClassificationEvaluationMetrics> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.automl.v1.ClassificationEvaluationMetrics getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
