1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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;
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Model {
/// The best trial_id across all training runs.
#[serde(rename = "bestTrialId", skip_serializing_if = "Option::is_none")]
pub best_trial_id: Option<String>,
/// Output only. The time when this model was created, in millisecs since the epoch.
#[serde(rename = "creationTime", skip_serializing_if = "Option::is_none")]
pub creation_time: Option<String>,
/// Output only. The default trial_id to use in TVFs when the trial_id is not passed in. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the best trial ID. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, this is the smallest trial ID among all Pareto optimal trials.
#[serde(rename = "defaultTrialId", skip_serializing_if = "Option::is_none")]
pub default_trial_id: Option<String>,
/// Optional. A user-friendly description of this model.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(
rename = "encryptionConfiguration",
skip_serializing_if = "Option::is_none"
)]
pub encryption_configuration: Option<Box<models::EncryptionConfiguration>>,
/// Output only. A hash of this resource.
#[serde(rename = "etag", skip_serializing_if = "Option::is_none")]
pub etag: Option<String>,
/// Optional. The time when this model expires, in milliseconds since the epoch. If not present, the model will persist indefinitely. Expired models will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default expirationTime on newly created models.
#[serde(rename = "expirationTime", skip_serializing_if = "Option::is_none")]
pub expiration_time: Option<String>,
/// Output only. Input feature columns that were used to train this model.
#[serde(rename = "featureColumns", skip_serializing_if = "Option::is_none")]
pub feature_columns: Option<Vec<models::StandardSqlField>>,
/// Optional. A descriptive name for this model.
#[serde(rename = "friendlyName", skip_serializing_if = "Option::is_none")]
pub friendly_name: Option<String>,
#[serde(rename = "hparamSearchSpaces", skip_serializing_if = "Option::is_none")]
pub hparam_search_spaces: Option<Box<models::HparamSearchSpaces>>,
/// Output only. Trials of a [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) model sorted by trial_id.
#[serde(rename = "hparamTrials", skip_serializing_if = "Option::is_none")]
pub hparam_trials: Option<Vec<models::HparamTuningTrial>>,
/// Output only. Label columns that were used to train this model. The output of the model will have a \"predicted_\" prefix to these columns.
#[serde(rename = "labelColumns", skip_serializing_if = "Option::is_none")]
pub label_columns: Option<Vec<models::StandardSqlField>>,
/// The labels associated with this model. You can use these to organize and group your models. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key.
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<std::collections::HashMap<String, String>>,
/// Output only. The time when this model was last modified, in millisecs since the epoch.
#[serde(rename = "lastModifiedTime", skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<String>,
/// Output only. The geographic location where the model resides. This value is inherited from the dataset.
#[serde(rename = "location", skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(rename = "modelReference", skip_serializing_if = "Option::is_none")]
pub model_reference: Option<Box<models::ModelReference>>,
/// Output only. Type of the model resource.
#[serde(rename = "modelType", skip_serializing_if = "Option::is_none")]
pub model_type: Option<ModelType>,
/// Output only. For single-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it only contains the best trial. For multi-objective [hyperparameter tuning](/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-hp-tuning-overview) models, it contains all Pareto optimal trials sorted by trial_id.
#[serde(rename = "optimalTrialIds", skip_serializing_if = "Option::is_none")]
pub optimal_trial_ids: Option<Vec<String>>,
/// Information for all training runs in increasing order of start_time.
#[serde(rename = "trainingRuns", skip_serializing_if = "Option::is_none")]
pub training_runs: Option<Vec<models::TrainingRun>>,
}
impl Model {
pub fn new() -> Model {
Model {
best_trial_id: None,
creation_time: None,
default_trial_id: None,
description: None,
encryption_configuration: None,
etag: None,
expiration_time: None,
feature_columns: None,
friendly_name: None,
hparam_search_spaces: None,
hparam_trials: None,
label_columns: None,
labels: None,
last_modified_time: None,
location: None,
model_reference: None,
model_type: None,
optimal_trial_ids: None,
training_runs: None,
}
}
}
/// Output only. Type of the model resource.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ModelType {
#[serde(rename = "MODEL_TYPE_UNSPECIFIED")]
ModelTypeUnspecified,
#[serde(rename = "LINEAR_REGRESSION")]
LinearRegression,
#[serde(rename = "LOGISTIC_REGRESSION")]
LogisticRegression,
#[serde(rename = "KMEANS")]
Kmeans,
#[serde(rename = "MATRIX_FACTORIZATION")]
MatrixFactorization,
#[serde(rename = "DNN_CLASSIFIER")]
DnnClassifier,
#[serde(rename = "TENSORFLOW")]
Tensorflow,
#[serde(rename = "DNN_REGRESSOR")]
DnnRegressor,
#[serde(rename = "BOOSTED_TREE_REGRESSOR")]
BoostedTreeRegressor,
#[serde(rename = "BOOSTED_TREE_CLASSIFIER")]
BoostedTreeClassifier,
#[serde(rename = "ARIMA")]
Arima,
#[serde(rename = "AUTOML_REGRESSOR")]
AutomlRegressor,
#[serde(rename = "AUTOML_CLASSIFIER")]
AutomlClassifier,
#[serde(rename = "PCA")]
Pca,
#[serde(rename = "DNN_LINEAR_COMBINED_CLASSIFIER")]
DnnLinearCombinedClassifier,
#[serde(rename = "DNN_LINEAR_COMBINED_REGRESSOR")]
DnnLinearCombinedRegressor,
#[serde(rename = "AUTOENCODER")]
Autoencoder,
#[serde(rename = "ARIMA_PLUS")]
ArimaPlus,
}
impl Default for ModelType {
fn default() -> ModelType {
Self::ModelTypeUnspecified
}
}