use serde::{Deserialize, Serialize}; /*
                                      * BigQuery API
                                      *
                                      * A data platform for customers to create, manage, share and query data.
                                      *
                                      * The version of the OpenAPI document: v2
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::bigquery_v2::models;

/// BqmlTrainingRunTrainingOptions : [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BqmlTrainingRunTrainingOptions {
    #[serde(rename = "earlyStop", skip_serializing_if = "Option::is_none")]
    pub early_stop: Option<bool>,
    #[serde(rename = "l1Reg", skip_serializing_if = "Option::is_none")]
    pub l1_reg: Option<f64>,
    #[serde(rename = "l2Reg", skip_serializing_if = "Option::is_none")]
    pub l2_reg: Option<f64>,
    #[serde(rename = "learnRate", skip_serializing_if = "Option::is_none")]
    pub learn_rate: Option<f64>,
    #[serde(rename = "learnRateStrategy", skip_serializing_if = "Option::is_none")]
    pub learn_rate_strategy: Option<String>,
    #[serde(
        rename = "lineSearchInitLearnRate",
        skip_serializing_if = "Option::is_none"
    )]
    pub line_search_init_learn_rate: Option<f64>,
    #[serde(rename = "maxIteration", skip_serializing_if = "Option::is_none")]
    pub max_iteration: Option<String>,
    #[serde(rename = "minRelProgress", skip_serializing_if = "Option::is_none")]
    pub min_rel_progress: Option<f64>,
    #[serde(rename = "warmStart", skip_serializing_if = "Option::is_none")]
    pub warm_start: Option<bool>,
}

impl BqmlTrainingRunTrainingOptions {
    /// [Output-only, Beta] Training options used by this training run. These options are mutable for subsequent training runs. Default values are explicitly stored for options not specified in the input query of the first training run. For subsequent training runs, any option not explicitly specified in the input query will be copied from the previous training run.
    pub fn new() -> BqmlTrainingRunTrainingOptions {
        BqmlTrainingRunTrainingOptions {
            early_stop: None,
            l1_reg: None,
            l2_reg: None,
            learn_rate: None,
            learn_rate_strategy: None,
            line_search_init_learn_rate: None,
            max_iteration: None,
            min_rel_progress: None,
            warm_start: None,
        }
    }
}
