<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/training_pipeline.proto

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Assigns the input data to training, validation, and test sets as per the
 * given fractions. Any of `training_fraction`, `validation_fraction` and
 * `test_fraction` may optionally be provided, they must sum to up to 1. If the
 * provided ones sum to less than 1, the remainder is assigned to sets as
 * decided by Vertex AI. If none of the fractions are set, by default roughly
 * 80% of data is used for training, 10% for validation, and 10% for test.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.FractionSplit</code>
 */
class FractionSplit extends \Google\Protobuf\Internal\Message
{
    /**
     * The fraction of the input data that is to be used to train the Model.
     *
     * Generated from protobuf field <code>double training_fraction = 1;</code>
     */
    private $training_fraction = 0.0;
    /**
     * The fraction of the input data that is to be used to validate the Model.
     *
     * Generated from protobuf field <code>double validation_fraction = 2;</code>
     */
    private $validation_fraction = 0.0;
    /**
     * The fraction of the input data that is to be used to evaluate the Model.
     *
     * Generated from protobuf field <code>double test_fraction = 3;</code>
     */
    private $test_fraction = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $training_fraction
     *           The fraction of the input data that is to be used to train the Model.
     *     @type float $validation_fraction
     *           The fraction of the input data that is to be used to validate the Model.
     *     @type float $test_fraction
     *           The fraction of the input data that is to be used to evaluate the Model.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\TrainingPipeline::initOnce();
        parent::__construct($data);
    }

    /**
     * The fraction of the input data that is to be used to train the Model.
     *
     * Generated from protobuf field <code>double training_fraction = 1;</code>
     * @return float
     */
    public function getTrainingFraction()
    {
        return $this->training_fraction;
    }

    /**
     * The fraction of the input data that is to be used to train the Model.
     *
     * Generated from protobuf field <code>double training_fraction = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setTrainingFraction($var)
    {
        GPBUtil::checkDouble($var);
        $this->training_fraction = $var;

        return $this;
    }

    /**
     * The fraction of the input data that is to be used to validate the Model.
     *
     * Generated from protobuf field <code>double validation_fraction = 2;</code>
     * @return float
     */
    public function getValidationFraction()
    {
        return $this->validation_fraction;
    }

    /**
     * The fraction of the input data that is to be used to validate the Model.
     *
     * Generated from protobuf field <code>double validation_fraction = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setValidationFraction($var)
    {
        GPBUtil::checkDouble($var);
        $this->validation_fraction = $var;

        return $this;
    }

    /**
     * The fraction of the input data that is to be used to evaluate the Model.
     *
     * Generated from protobuf field <code>double test_fraction = 3;</code>
     * @return float
     */
    public function getTestFraction()
    {
        return $this->test_fraction;
    }

    /**
     * The fraction of the input data that is to be used to evaluate the Model.
     *
     * Generated from protobuf field <code>double test_fraction = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setTestFraction($var)
    {
        GPBUtil::checkDouble($var);
        $this->test_fraction = $var;

        return $this;
    }

}

