<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/automl/v1beta1/classification.proto

namespace Google\Cloud\AutoMl\V1beta1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Model evaluation metrics for classification problems.
 * Visible only to v1beta1
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.ClassificationEvaluationMetrics</code>
 */
class ClassificationEvaluationMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The Area under precision recall curve metric.
     *
     * Generated from protobuf field <code>float au_prc = 1;</code>
     */
    private $au_prc = 0.0;
    /**
     * Output only. The Area under precision recall curve metric based on priors.
     *
     * Generated from protobuf field <code>float base_au_prc = 2;</code>
     */
    private $base_au_prc = 0.0;
    /**
     * Output only. Metrics that have confidence thresholds.
     * Precision-recall curve can be derived from it.
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;</code>
     */
    private $confidence_metrics_entry;
    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;</code>
     */
    private $confusion_matrix = null;
    /**
     * Output only. The annotation spec ids used for this evaluation.
     *
     * Generated from protobuf field <code>repeated string annotation_spec_id = 5;</code>
     */
    private $annotation_spec_id;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $au_prc
     *           Output only. The Area under precision recall curve metric.
     *     @type float $base_au_prc
     *           Output only. The Area under precision recall curve metric based on priors.
     *     @type \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry[]|\Google\Protobuf\Internal\RepeatedField $confidence_metrics_entry
     *           Output only. Metrics that have confidence thresholds.
     *           Precision-recall curve can be derived from it.
     *     @type \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfusionMatrix $confusion_matrix
     *           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.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $annotation_spec_id
     *           Output only. The annotation spec ids used for this evaluation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\Classification::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The Area under precision recall curve metric.
     *
     * Generated from protobuf field <code>float au_prc = 1;</code>
     * @return float
     */
    public function getAuPrc()
    {
        return $this->au_prc;
    }

    /**
     * Output only. The Area under precision recall curve metric.
     *
     * Generated from protobuf field <code>float au_prc = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setAuPrc($var)
    {
        GPBUtil::checkFloat($var);
        $this->au_prc = $var;

        return $this;
    }

    /**
     * Output only. The Area under precision recall curve metric based on priors.
     *
     * Generated from protobuf field <code>float base_au_prc = 2;</code>
     * @return float
     */
    public function getBaseAuPrc()
    {
        return $this->base_au_prc;
    }

    /**
     * Output only. The Area under precision recall curve metric based on priors.
     *
     * Generated from protobuf field <code>float base_au_prc = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setBaseAuPrc($var)
    {
        GPBUtil::checkFloat($var);
        $this->base_au_prc = $var;

        return $this;
    }

    /**
     * Output only. Metrics that have confidence thresholds.
     * Precision-recall curve can be derived from it.
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getConfidenceMetricsEntry()
    {
        return $this->confidence_metrics_entry;
    }

    /**
     * Output only. Metrics that have confidence thresholds.
     * Precision-recall curve can be derived from it.
     *
     * Generated from protobuf field <code>repeated .google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry confidence_metrics_entry = 3;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setConfidenceMetricsEntry($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfidenceMetricsEntry::class);
        $this->confidence_metrics_entry = $arr;

        return $this;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfusionMatrix
     */
    public function getConfusionMatrix()
    {
        return $this->confusion_matrix;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 4;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics\ConfusionMatrix $var
     * @return $this
     */
    public function setConfusionMatrix($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ClassificationEvaluationMetrics_ConfusionMatrix::class);
        $this->confusion_matrix = $var;

        return $this;
    }

    /**
     * Output only. The annotation spec ids used for this evaluation.
     *
     * Generated from protobuf field <code>repeated string annotation_spec_id = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAnnotationSpecId()
    {
        return $this->annotation_spec_id;
    }

    /**
     * Output only. The annotation spec ids used for this evaluation.
     *
     * Generated from protobuf field <code>repeated string annotation_spec_id = 5;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAnnotationSpecId($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->annotation_spec_id = $arr;

        return $this;
    }

}

