blob: 6d1b63ca6bb54e2a7d9bad621ad6d0c7b50a0913 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="bigquery_v2.html">BigQuery API</a> . <a href="bigquery_v2.models.html">models</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(projectId, datasetId, modelId)</a></code></p>
79<p class="firstline">Deletes the model specified by modelId from the dataset.</p>
80<p class="toc_element">
81 <code><a href="#get">get(projectId, datasetId, modelId)</a></code></p>
82<p class="firstline">Gets the specified model resource by model ID.</p>
83<p class="toc_element">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070084 <code><a href="#list">list(projectId, datasetId, maxResults=None, pageToken=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Lists all models in the specified dataset. Requires the READER dataset</p>
86<p class="toc_element">
87 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
88<p class="firstline">Retrieves the next page of results.</p>
89<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#patch">patch(projectId, datasetId, modelId, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Patch specific fields in the specified model.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="delete">delete(projectId, datasetId, modelId)</code>
95 <pre>Deletes the model specified by modelId from the dataset.
96
97Args:
Dan O'Mearadd494642020-05-01 07:42:23 -070098 projectId: string, Required. Project ID of the model to delete. (required)
99 datasetId: string, Required. Dataset ID of the model to delete. (required)
100 modelId: string, Required. Model ID of the model to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101</pre>
102</div>
103
104<div class="method">
105 <code class="details" id="get">get(projectId, datasetId, modelId)</code>
106 <pre>Gets the specified model resource by model ID.
107
108Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 projectId: string, Required. Project ID of the requested model. (required)
110 datasetId: string, Required. Dataset ID of the requested model. (required)
111 modelId: string, Required. Model ID of the requested model. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112
113Returns:
114 An object of the form:
115
116 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700117 &quot;location&quot;: &quot;A String&quot;, # Output only. The geographic location where the model resides. This value
118 # is inherited from the dataset.
119 &quot;friendlyName&quot;: &quot;A String&quot;, # Optional. A descriptive name for this model.
120 &quot;lastModifiedTime&quot;: &quot;A String&quot;, # Output only. The time when this model was last modified, in millisecs since the epoch.
121 &quot;labels&quot;: { # The labels associated with this model. You can use these to organize
122 # and group your models. Label keys and values can be no longer
123 # than 63 characters, can only contain lowercase letters, numeric
124 # characters, underscores and dashes. International characters are allowed.
125 # Label values are optional. Label keys must start with a letter and each
126 # label in the list must have a different key.
127 &quot;a_key&quot;: &quot;A String&quot;,
128 },
129 &quot;labelColumns&quot;: [ # Output only. Label columns that were used to train this model.
130 # The output of the model will have a &quot;predicted_&quot; prefix to these columns.
131 { # A field or a column.
132 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
133 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
134 # specified (e.g., CREATE FUNCTION statement can omit the return type;
135 # in this case the output parameter does not have this &quot;type&quot; field).
136 # Examples:
137 # INT64: {type_kind=&quot;INT64&quot;}
138 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
139 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
140 # {type_kind=&quot;STRUCT&quot;,
141 # struct_type={fields=[
142 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
143 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
144 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700145 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
146 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
147 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700148 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
149 &quot;fields&quot;: [
150 # Object with schema name: StandardSqlField
151 ],
152 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700154 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 ],
156 &quot;modelType&quot;: &quot;A String&quot;, # Output only. Type of the model resource.
157 &quot;featureColumns&quot;: [ # Output only. Input feature columns that were used to train this model.
158 { # A field or a column.
159 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
160 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
161 # specified (e.g., CREATE FUNCTION statement can omit the return type;
162 # in this case the output parameter does not have this &quot;type&quot; field).
163 # Examples:
164 # INT64: {type_kind=&quot;INT64&quot;}
165 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
166 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
167 # {type_kind=&quot;STRUCT&quot;,
168 # struct_type={fields=[
169 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
170 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
171 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700172 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
173 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
174 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700175 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
176 &quot;fields&quot;: [
177 # Object with schema name: StandardSqlField
178 ],
179 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700180 },
181 },
182 ],
183 &quot;expirationTime&quot;: &quot;A String&quot;, # Optional. The time when this model expires, in milliseconds since the epoch.
184 # If not present, the model will persist indefinitely. Expired models
185 # will be deleted and their storage reclaimed. The defaultTableExpirationMs
186 # property of the encapsulating dataset can be used to set a default
187 # expirationTime on newly created models.
188 &quot;trainingRuns&quot;: [ # Output only. Information for all training runs in increasing order of start_time.
189 { # Information about a single training query run for the model.
190 &quot;startTime&quot;: &quot;A String&quot;, # The start time of this training run.
191 &quot;results&quot;: [ # Output of each iteration run, results.size() &lt;= max_iterations.
192 { # Information about a single iteration of the training run.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700193 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
194 { # Information about a single cluster for clustering model.
195 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
196 # to each point assigned to the cluster.
197 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
198 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
199 },
200 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700201 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
202 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
203 &quot;index&quot;: 42, # Index of the iteration, 0 based.
204 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
205 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
206 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
207 # refactoring if we want to use model-specific iteration results.
208 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
209 # fitted in auto-arima. For non-auto-arima model, its size is one.
210 { # Arima model information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
212 # for one time series.
213 &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700214 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700215 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
Bu Sun Kim65020912020-05-20 12:08:20 -0700216 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
217 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700218 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
219 },
220 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
221 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
222 &quot;variance&quot;: 3.14, # Variance.
223 &quot;aic&quot;: 3.14, # AIC.
224 },
225 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
226 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
227 # when d is not 1.
228 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
229 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
230 3.14,
231 ],
232 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
233 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
234 3.14,
235 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700236 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700237 },
238 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
240 # one time series.
241 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 ],
243 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 },
245 ],
246 &quot;evaluationMetrics&quot;: { # Evaluation metrics of a model. These are either computed on all training # The evaluation metrics over training/eval data that were computed at the
247 # end of training.
248 # data or just the eval data based on whether eval data was used during
249 # training. These are not present for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
251 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
252 # models, the metrics are either macro-averaged or micro-averaged. When
253 # macro-averaged, the metrics are calculated for each label and then an
254 # unweighted average is taken of those values. When micro-averaged, the
255 # metric is calculated globally by counting the total number of correctly
256 # predicted rows.
257 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
258 # positive prediction. For multiclass this is a macro-averaged metric.
259 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
260 # classification models this is the positive class threshold.
261 # For multi-class classfication models this is the confidence
262 # threshold.
263 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
264 # metric.
265 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
266 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
267 # this is a macro-averaged metric.
268 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
269 # positive actual labels. For multiclass this is a macro-averaged
270 # metric treating each class as a binary classifier.
271 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
272 # multiclass this is a micro-averaged metric.
273 },
274 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
275 { # Confusion matrix for multi-class classification models.
276 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
277 # confusion matrix.
278 &quot;rows&quot;: [ # One row per actual label.
279 { # A single row in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700280 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
Bu Sun Kim65020912020-05-20 12:08:20 -0700281 &quot;entries&quot;: [ # Info describing predicted label distribution.
282 { # A single entry in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700283 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
Bu Sun Kim65020912020-05-20 12:08:20 -0700284 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
285 # also add an entry indicating the number of items under the
286 # confidence threshold.
Bu Sun Kim65020912020-05-20 12:08:20 -0700287 },
288 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700289 },
290 ],
291 },
292 ],
293 },
294 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
295 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
296 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
297 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
298 { # Message containing the information about one cluster.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700299 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Bu Sun Kim65020912020-05-20 12:08:20 -0700300 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
301 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
302 { # Representative value of a single feature within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
304 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
305 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
306 # more than ten categories, we return top ten (by count) and return
307 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
308 # aggregate counts of remaining categories.
309 { # Represents the count of a single category within the cluster.
310 &quot;category&quot;: &quot;A String&quot;, # The name of category.
311 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
312 # cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313 },
314 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700315 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700316 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
317 # feature.
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 },
319 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700320 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700321 ],
322 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700323 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary classification/classifier models.
324 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
325 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
326 { # Confusion matrix for binary classification models.
327 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
328 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
329 # labels.
330 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
331 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
332 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
333 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
334 # prediction.
335 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
336 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
337 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
338 },
339 ],
340 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
341 # models, the metrics are either macro-averaged or micro-averaged. When
342 # macro-averaged, the metrics are calculated for each label and then an
343 # unweighted average is taken of those values. When micro-averaged, the
344 # metric is calculated globally by counting the total number of correctly
345 # predicted rows.
346 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
347 # positive prediction. For multiclass this is a macro-averaged metric.
348 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
349 # classification models this is the positive class threshold.
350 # For multi-class classfication models this is the confidence
351 # threshold.
352 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
353 # metric.
354 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
355 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
356 # this is a macro-averaged metric.
357 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
358 # positive actual labels. For multiclass this is a macro-averaged
359 # metric treating each class as a binary classifier.
360 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
361 # multiclass this is a micro-averaged metric.
362 },
363 &quot;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
364 },
365 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
366 # factorization models.
367 # factorization models.
368 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
369 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
370 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
371 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
372 &quot;rSquared&quot;: 3.14, # R^2 score.
373 },
374 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
375 # models.
376 # feedback_type=implicit.
377 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
378 # then averages all the precisions across all the users.
379 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
380 # predicted confidence by comparing it to an ideal rank measured by the
381 # original ratings.
382 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
383 # from the predicted confidence and dividing it by the original rank.
384 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
385 # recommendation models except instead of computing the rating directly,
386 # the output from evaluate is computed against a preference which is 1 or 0
387 # depending on if the rating exists or not.
388 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700389 },
390 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
391 # user specified and default options that were used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700392 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
393 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700394 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700395 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
396 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
397 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
398 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
399 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
400 &quot;A String&quot;,
401 ],
402 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
403 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
404 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
405 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
406 # specified.
407 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
408 # factorization.
409 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
410 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
411 # feature.
412 # 1. When data_split_method is CUSTOM, the corresponding column should
413 # be boolean. The rows with true value tag are eval data, and the false
414 # are training data.
415 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
416 # rows (from smallest to largest) in the corresponding column are used
417 # as training data, and the rest are eval data. It respects the order
418 # in Orderable data types:
419 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
420 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
421 # training algorithms.
422 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
423 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
424 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
425 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
426 # applicable for imported models.
427 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
428 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
429 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
430 # algorithms.
431 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
432 # when kmeans_initialization_method is CUSTOM.
433 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
434 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
435 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700436 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
437 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
438 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
439 # training data. Only applicable for classification models.
440 &quot;a_key&quot;: 3.14,
441 },
442 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
443 # overfitting for boosted tree models.
444 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
445 # any more (compared to min_relative_progress). Used only for iterative
446 # training algorithms.
447 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
448 # of data will be used as training data. The format should be double.
449 # Accurate to two decimal places.
450 # Default value is 0.2.
451 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
452 # strategy.
453 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
Bu Sun Kim65020912020-05-20 12:08:20 -0700454 },
455 &quot;dataSplitResult&quot;: { # Data split result. This contains references to the training and evaluation # Data split result of the training run. Only set when the input data is
456 # actually split.
457 # data tables that were used to train the model.
458 &quot;trainingTable&quot;: { # Table reference of the training data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
460 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700461 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700462 },
463 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
465 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700466 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700467 },
468 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700469 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700470 ],
471 &quot;modelReference&quot;: { # Required. Unique identifier for this model.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700472 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
Bu Sun Kim65020912020-05-20 12:08:20 -0700473 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
474 &quot;modelId&quot;: &quot;A String&quot;, # [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700475 },
476 &quot;description&quot;: &quot;A String&quot;, # Optional. A user-friendly description of this model.
477 &quot;etag&quot;: &quot;A String&quot;, # Output only. A hash of this resource.
478 &quot;creationTime&quot;: &quot;A String&quot;, # Output only. The time when this model was created, in millisecs since the epoch.
479 &quot;encryptionConfiguration&quot;: { # Custom encryption configuration (e.g., Cloud KMS keys). This shows the
480 # encryption configuration of the model data while stored in BigQuery
481 # storage. This field can be used with PatchModel to update encryption key
482 # for an already encrypted model.
483 &quot;kmsKeyName&quot;: &quot;A String&quot;, # [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
484 },
485 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700486</div>
487
488<div class="method">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700489 <code class="details" id="list">list(projectId, datasetId, maxResults=None, pageToken=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700490 <pre>Lists all models in the specified dataset. Requires the READER dataset
491role.
492
493Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700494 projectId: string, Required. Project ID of the models to list. (required)
495 datasetId: string, Required. Dataset ID of the models to list. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700496 maxResults: integer, The maximum number of results to return in a single response page.
497Leverage the page tokens to iterate through the entire collection.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700498 pageToken: string, Page token, returned by a previous call to request the next page of
499results
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700500
501Returns:
502 An object of the form:
503
504 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700505 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to request the next page of results.
506 &quot;models&quot;: [ # Models in the requested dataset. Only the following fields are populated:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700507 # model_reference, model_type, creation_time, last_modified_time and
508 # labels.
509 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700510 &quot;location&quot;: &quot;A String&quot;, # Output only. The geographic location where the model resides. This value
511 # is inherited from the dataset.
512 &quot;friendlyName&quot;: &quot;A String&quot;, # Optional. A descriptive name for this model.
513 &quot;lastModifiedTime&quot;: &quot;A String&quot;, # Output only. The time when this model was last modified, in millisecs since the epoch.
514 &quot;labels&quot;: { # The labels associated with this model. You can use these to organize
515 # and group your models. Label keys and values can be no longer
516 # than 63 characters, can only contain lowercase letters, numeric
517 # characters, underscores and dashes. International characters are allowed.
518 # Label values are optional. Label keys must start with a letter and each
519 # label in the list must have a different key.
520 &quot;a_key&quot;: &quot;A String&quot;,
521 },
522 &quot;labelColumns&quot;: [ # Output only. Label columns that were used to train this model.
523 # The output of the model will have a &quot;predicted_&quot; prefix to these columns.
524 { # A field or a column.
525 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
526 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
527 # specified (e.g., CREATE FUNCTION statement can omit the return type;
528 # in this case the output parameter does not have this &quot;type&quot; field).
529 # Examples:
530 # INT64: {type_kind=&quot;INT64&quot;}
531 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
532 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
533 # {type_kind=&quot;STRUCT&quot;,
534 # struct_type={fields=[
535 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
536 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
537 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700538 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
539 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
540 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700541 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
542 &quot;fields&quot;: [
543 # Object with schema name: StandardSqlField
544 ],
545 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700546 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700548 ],
549 &quot;modelType&quot;: &quot;A String&quot;, # Output only. Type of the model resource.
550 &quot;featureColumns&quot;: [ # Output only. Input feature columns that were used to train this model.
551 { # A field or a column.
552 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
553 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
554 # specified (e.g., CREATE FUNCTION statement can omit the return type;
555 # in this case the output parameter does not have this &quot;type&quot; field).
556 # Examples:
557 # INT64: {type_kind=&quot;INT64&quot;}
558 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
559 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
560 # {type_kind=&quot;STRUCT&quot;,
561 # struct_type={fields=[
562 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
563 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
564 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700565 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
566 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
567 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700568 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
569 &quot;fields&quot;: [
570 # Object with schema name: StandardSqlField
571 ],
572 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700573 },
574 },
575 ],
576 &quot;expirationTime&quot;: &quot;A String&quot;, # Optional. The time when this model expires, in milliseconds since the epoch.
577 # If not present, the model will persist indefinitely. Expired models
578 # will be deleted and their storage reclaimed. The defaultTableExpirationMs
579 # property of the encapsulating dataset can be used to set a default
580 # expirationTime on newly created models.
581 &quot;trainingRuns&quot;: [ # Output only. Information for all training runs in increasing order of start_time.
582 { # Information about a single training query run for the model.
583 &quot;startTime&quot;: &quot;A String&quot;, # The start time of this training run.
584 &quot;results&quot;: [ # Output of each iteration run, results.size() &lt;= max_iterations.
585 { # Information about a single iteration of the training run.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700586 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
587 { # Information about a single cluster for clustering model.
588 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
589 # to each point assigned to the cluster.
590 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
591 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
592 },
593 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700594 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
595 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
596 &quot;index&quot;: 42, # Index of the iteration, 0 based.
597 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
598 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
599 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
600 # refactoring if we want to use model-specific iteration results.
601 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
602 # fitted in auto-arima. For non-auto-arima model, its size is one.
603 { # Arima model information.
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
605 # for one time series.
606 &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700607 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700608 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
Bu Sun Kim65020912020-05-20 12:08:20 -0700609 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
610 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700611 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
612 },
613 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
614 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
615 &quot;variance&quot;: 3.14, # Variance.
616 &quot;aic&quot;: 3.14, # AIC.
617 },
618 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
619 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
620 # when d is not 1.
621 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
622 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
623 3.14,
624 ],
625 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
626 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
627 3.14,
628 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700629 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700630 },
631 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700632 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
633 # one time series.
634 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 ],
636 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700637 },
638 ],
639 &quot;evaluationMetrics&quot;: { # Evaluation metrics of a model. These are either computed on all training # The evaluation metrics over training/eval data that were computed at the
640 # end of training.
641 # data or just the eval data based on whether eval data was used during
642 # training. These are not present for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -0700643 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
644 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
645 # models, the metrics are either macro-averaged or micro-averaged. When
646 # macro-averaged, the metrics are calculated for each label and then an
647 # unweighted average is taken of those values. When micro-averaged, the
648 # metric is calculated globally by counting the total number of correctly
649 # predicted rows.
650 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
651 # positive prediction. For multiclass this is a macro-averaged metric.
652 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
653 # classification models this is the positive class threshold.
654 # For multi-class classfication models this is the confidence
655 # threshold.
656 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
657 # metric.
658 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
659 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
660 # this is a macro-averaged metric.
661 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
662 # positive actual labels. For multiclass this is a macro-averaged
663 # metric treating each class as a binary classifier.
664 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
665 # multiclass this is a micro-averaged metric.
666 },
667 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
668 { # Confusion matrix for multi-class classification models.
669 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
670 # confusion matrix.
671 &quot;rows&quot;: [ # One row per actual label.
672 { # A single row in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700673 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
Bu Sun Kim65020912020-05-20 12:08:20 -0700674 &quot;entries&quot;: [ # Info describing predicted label distribution.
675 { # A single entry in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700676 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
Bu Sun Kim65020912020-05-20 12:08:20 -0700677 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
678 # also add an entry indicating the number of items under the
679 # confidence threshold.
Bu Sun Kim65020912020-05-20 12:08:20 -0700680 },
681 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 },
683 ],
684 },
685 ],
686 },
687 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
688 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
689 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
690 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
691 { # Message containing the information about one cluster.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700692 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Bu Sun Kim65020912020-05-20 12:08:20 -0700693 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
694 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
695 { # Representative value of a single feature within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -0700696 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
697 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
698 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
699 # more than ten categories, we return top ten (by count) and return
700 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
701 # aggregate counts of remaining categories.
702 { # Represents the count of a single category within the cluster.
703 &quot;category&quot;: &quot;A String&quot;, # The name of category.
704 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
705 # cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700706 },
707 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700708 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700709 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
710 # feature.
Dan O'Mearadd494642020-05-01 07:42:23 -0700711 },
712 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700713 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700714 ],
715 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700716 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary classification/classifier models.
717 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
718 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
719 { # Confusion matrix for binary classification models.
720 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
721 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
722 # labels.
723 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
724 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
725 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
726 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
727 # prediction.
728 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
729 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
730 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
731 },
732 ],
733 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
734 # models, the metrics are either macro-averaged or micro-averaged. When
735 # macro-averaged, the metrics are calculated for each label and then an
736 # unweighted average is taken of those values. When micro-averaged, the
737 # metric is calculated globally by counting the total number of correctly
738 # predicted rows.
739 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
740 # positive prediction. For multiclass this is a macro-averaged metric.
741 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
742 # classification models this is the positive class threshold.
743 # For multi-class classfication models this is the confidence
744 # threshold.
745 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
746 # metric.
747 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
748 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
749 # this is a macro-averaged metric.
750 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
751 # positive actual labels. For multiclass this is a macro-averaged
752 # metric treating each class as a binary classifier.
753 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
754 # multiclass this is a micro-averaged metric.
755 },
756 &quot;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
757 },
758 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
759 # factorization models.
760 # factorization models.
761 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
762 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
763 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
764 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
765 &quot;rSquared&quot;: 3.14, # R^2 score.
766 },
767 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
768 # models.
769 # feedback_type=implicit.
770 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
771 # then averages all the precisions across all the users.
772 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
773 # predicted confidence by comparing it to an ideal rank measured by the
774 # original ratings.
775 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
776 # from the predicted confidence and dividing it by the original rank.
777 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
778 # recommendation models except instead of computing the rating directly,
779 # the output from evaluate is computed against a preference which is 1 or 0
780 # depending on if the rating exists or not.
781 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700782 },
783 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
784 # user specified and default options that were used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700785 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
786 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700787 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700788 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
789 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
790 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
791 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
792 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
793 &quot;A String&quot;,
794 ],
795 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
796 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
797 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
798 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
799 # specified.
800 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
801 # factorization.
802 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
803 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
804 # feature.
805 # 1. When data_split_method is CUSTOM, the corresponding column should
806 # be boolean. The rows with true value tag are eval data, and the false
807 # are training data.
808 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
809 # rows (from smallest to largest) in the corresponding column are used
810 # as training data, and the rest are eval data. It respects the order
811 # in Orderable data types:
812 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
813 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
814 # training algorithms.
815 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
816 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
817 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
818 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
819 # applicable for imported models.
820 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
821 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
822 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
823 # algorithms.
824 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
825 # when kmeans_initialization_method is CUSTOM.
826 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
827 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
828 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700829 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
830 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
831 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
832 # training data. Only applicable for classification models.
833 &quot;a_key&quot;: 3.14,
834 },
835 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
836 # overfitting for boosted tree models.
837 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
838 # any more (compared to min_relative_progress). Used only for iterative
839 # training algorithms.
840 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
841 # of data will be used as training data. The format should be double.
842 # Accurate to two decimal places.
843 # Default value is 0.2.
844 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
845 # strategy.
846 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
Bu Sun Kim65020912020-05-20 12:08:20 -0700847 },
848 &quot;dataSplitResult&quot;: { # Data split result. This contains references to the training and evaluation # Data split result of the training run. Only set when the input data is
849 # actually split.
850 # data tables that were used to train the model.
851 &quot;trainingTable&quot;: { # Table reference of the training data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -0700852 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
853 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700854 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700855 },
856 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -0700857 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
858 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700859 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700860 },
861 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700862 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700863 ],
864 &quot;modelReference&quot;: { # Required. Unique identifier for this model.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700865 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
Bu Sun Kim65020912020-05-20 12:08:20 -0700866 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
867 &quot;modelId&quot;: &quot;A String&quot;, # [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700868 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700869 &quot;description&quot;: &quot;A String&quot;, # Optional. A user-friendly description of this model.
870 &quot;etag&quot;: &quot;A String&quot;, # Output only. A hash of this resource.
871 &quot;creationTime&quot;: &quot;A String&quot;, # Output only. The time when this model was created, in millisecs since the epoch.
872 &quot;encryptionConfiguration&quot;: { # Custom encryption configuration (e.g., Cloud KMS keys). This shows the
873 # encryption configuration of the model data while stored in BigQuery
874 # storage. This field can be used with PatchModel to update encryption key
875 # for an already encrypted model.
876 &quot;kmsKeyName&quot;: &quot;A String&quot;, # [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
877 },
878 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700879 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700880 }</pre>
881</div>
882
883<div class="method">
884 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
885 <pre>Retrieves the next page of results.
886
887Args:
888 previous_request: The request for the previous page. (required)
889 previous_response: The response from the request for the previous page. (required)
890
891Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700892 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700893 page. Returns None if there are no more items in the collection.
894 </pre>
895</div>
896
897<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700898 <code class="details" id="patch">patch(projectId, datasetId, modelId, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700899 <pre>Patch specific fields in the specified model.
900
901Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700902 projectId: string, Required. Project ID of the model to patch. (required)
903 datasetId: string, Required. Dataset ID of the model to patch. (required)
904 modelId: string, Required. Model ID of the model to patch. (required)
905 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700906 The object takes the form of:
907
908{
Bu Sun Kim65020912020-05-20 12:08:20 -0700909 &quot;location&quot;: &quot;A String&quot;, # Output only. The geographic location where the model resides. This value
910 # is inherited from the dataset.
911 &quot;friendlyName&quot;: &quot;A String&quot;, # Optional. A descriptive name for this model.
912 &quot;lastModifiedTime&quot;: &quot;A String&quot;, # Output only. The time when this model was last modified, in millisecs since the epoch.
913 &quot;labels&quot;: { # The labels associated with this model. You can use these to organize
914 # and group your models. Label keys and values can be no longer
915 # than 63 characters, can only contain lowercase letters, numeric
916 # characters, underscores and dashes. International characters are allowed.
917 # Label values are optional. Label keys must start with a letter and each
918 # label in the list must have a different key.
919 &quot;a_key&quot;: &quot;A String&quot;,
920 },
921 &quot;labelColumns&quot;: [ # Output only. Label columns that were used to train this model.
922 # The output of the model will have a &quot;predicted_&quot; prefix to these columns.
923 { # A field or a column.
924 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
925 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
926 # specified (e.g., CREATE FUNCTION statement can omit the return type;
927 # in this case the output parameter does not have this &quot;type&quot; field).
928 # Examples:
929 # INT64: {type_kind=&quot;INT64&quot;}
930 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
931 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
932 # {type_kind=&quot;STRUCT&quot;,
933 # struct_type={fields=[
934 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
935 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
936 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700937 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
938 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
939 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700940 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
941 &quot;fields&quot;: [
942 # Object with schema name: StandardSqlField
943 ],
944 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700945 },
946 },
947 ],
948 &quot;modelType&quot;: &quot;A String&quot;, # Output only. Type of the model resource.
949 &quot;featureColumns&quot;: [ # Output only. Input feature columns that were used to train this model.
950 { # A field or a column.
951 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
952 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
953 # specified (e.g., CREATE FUNCTION statement can omit the return type;
954 # in this case the output parameter does not have this &quot;type&quot; field).
955 # Examples:
956 # INT64: {type_kind=&quot;INT64&quot;}
957 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
958 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
959 # {type_kind=&quot;STRUCT&quot;,
960 # struct_type={fields=[
961 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
962 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
963 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700964 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
965 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
966 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -0700967 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
968 &quot;fields&quot;: [
969 # Object with schema name: StandardSqlField
970 ],
971 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700972 },
973 },
974 ],
975 &quot;expirationTime&quot;: &quot;A String&quot;, # Optional. The time when this model expires, in milliseconds since the epoch.
976 # If not present, the model will persist indefinitely. Expired models
977 # will be deleted and their storage reclaimed. The defaultTableExpirationMs
978 # property of the encapsulating dataset can be used to set a default
979 # expirationTime on newly created models.
980 &quot;trainingRuns&quot;: [ # Output only. Information for all training runs in increasing order of start_time.
981 { # Information about a single training query run for the model.
982 &quot;startTime&quot;: &quot;A String&quot;, # The start time of this training run.
983 &quot;results&quot;: [ # Output of each iteration run, results.size() &lt;= max_iterations.
984 { # Information about a single iteration of the training run.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700985 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
986 { # Information about a single cluster for clustering model.
987 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
988 # to each point assigned to the cluster.
989 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
990 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
991 },
992 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700993 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
994 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
995 &quot;index&quot;: 42, # Index of the iteration, 0 based.
996 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
997 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
998 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
999 # refactoring if we want to use model-specific iteration results.
1000 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
1001 # fitted in auto-arima. For non-auto-arima model, its size is one.
1002 { # Arima model information.
Bu Sun Kim65020912020-05-20 12:08:20 -07001003 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
1004 # for one time series.
1005 &quot;A String&quot;,
1006 ],
1007 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
Bu Sun Kim65020912020-05-20 12:08:20 -07001008 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
1009 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001010 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
1011 },
1012 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
1013 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
1014 &quot;variance&quot;: 3.14, # Variance.
1015 &quot;aic&quot;: 3.14, # AIC.
1016 },
1017 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
1018 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
1019 # when d is not 1.
1020 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
1021 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
1022 3.14,
1023 ],
1024 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
1025 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
1026 3.14,
1027 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001028 },
1029 },
1030 ],
1031 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
1032 # one time series.
1033 &quot;A String&quot;,
1034 ],
1035 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001036 },
1037 ],
1038 &quot;evaluationMetrics&quot;: { # Evaluation metrics of a model. These are either computed on all training # The evaluation metrics over training/eval data that were computed at the
1039 # end of training.
1040 # data or just the eval data based on whether eval data was used during
1041 # training. These are not present for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -07001042 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
1043 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1044 # models, the metrics are either macro-averaged or micro-averaged. When
1045 # macro-averaged, the metrics are calculated for each label and then an
1046 # unweighted average is taken of those values. When micro-averaged, the
1047 # metric is calculated globally by counting the total number of correctly
1048 # predicted rows.
1049 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1050 # positive prediction. For multiclass this is a macro-averaged metric.
1051 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1052 # classification models this is the positive class threshold.
1053 # For multi-class classfication models this is the confidence
1054 # threshold.
1055 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1056 # metric.
1057 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1058 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1059 # this is a macro-averaged metric.
1060 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1061 # positive actual labels. For multiclass this is a macro-averaged
1062 # metric treating each class as a binary classifier.
1063 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1064 # multiclass this is a micro-averaged metric.
1065 },
1066 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
1067 { # Confusion matrix for multi-class classification models.
1068 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
1069 # confusion matrix.
1070 &quot;rows&quot;: [ # One row per actual label.
1071 { # A single row in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001072 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
Bu Sun Kim65020912020-05-20 12:08:20 -07001073 &quot;entries&quot;: [ # Info describing predicted label distribution.
1074 { # A single entry in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001075 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
Bu Sun Kim65020912020-05-20 12:08:20 -07001076 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
1077 # also add an entry indicating the number of items under the
1078 # confidence threshold.
Bu Sun Kim65020912020-05-20 12:08:20 -07001079 },
1080 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001081 },
1082 ],
1083 },
1084 ],
1085 },
1086 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
1087 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
1088 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
1089 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
1090 { # Message containing the information about one cluster.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001091 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Bu Sun Kim65020912020-05-20 12:08:20 -07001092 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
1093 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
1094 { # Representative value of a single feature within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001095 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
1096 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
1097 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
1098 # more than ten categories, we return top ten (by count) and return
1099 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
1100 # aggregate counts of remaining categories.
1101 { # Represents the count of a single category within the cluster.
1102 &quot;category&quot;: &quot;A String&quot;, # The name of category.
1103 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
1104 # cluster.
1105 },
1106 ],
1107 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001108 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
1109 # feature.
Bu Sun Kim65020912020-05-20 12:08:20 -07001110 },
1111 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001112 },
1113 ],
1114 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001115 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary classification/classifier models.
1116 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
1117 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
1118 { # Confusion matrix for binary classification models.
1119 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
1120 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
1121 # labels.
1122 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
1123 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
1124 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
1125 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
1126 # prediction.
1127 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
1128 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
1129 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
1130 },
1131 ],
1132 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1133 # models, the metrics are either macro-averaged or micro-averaged. When
1134 # macro-averaged, the metrics are calculated for each label and then an
1135 # unweighted average is taken of those values. When micro-averaged, the
1136 # metric is calculated globally by counting the total number of correctly
1137 # predicted rows.
1138 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1139 # positive prediction. For multiclass this is a macro-averaged metric.
1140 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1141 # classification models this is the positive class threshold.
1142 # For multi-class classfication models this is the confidence
1143 # threshold.
1144 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1145 # metric.
1146 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1147 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1148 # this is a macro-averaged metric.
1149 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1150 # positive actual labels. For multiclass this is a macro-averaged
1151 # metric treating each class as a binary classifier.
1152 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1153 # multiclass this is a micro-averaged metric.
1154 },
1155 &quot;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
1156 },
1157 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
1158 # factorization models.
1159 # factorization models.
1160 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
1161 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
1162 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
1163 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
1164 &quot;rSquared&quot;: 3.14, # R^2 score.
1165 },
1166 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
1167 # models.
1168 # feedback_type=implicit.
1169 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
1170 # then averages all the precisions across all the users.
1171 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
1172 # predicted confidence by comparing it to an ideal rank measured by the
1173 # original ratings.
1174 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
1175 # from the predicted confidence and dividing it by the original rank.
1176 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
1177 # recommendation models except instead of computing the rating directly,
1178 # the output from evaluate is computed against a preference which is 1 or 0
1179 # depending on if the rating exists or not.
1180 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001181 },
1182 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
1183 # user specified and default options that were used.
Bu Sun Kim65020912020-05-20 12:08:20 -07001184 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
1185 &quot;A String&quot;,
1186 ],
1187 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
1188 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
1189 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
1190 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
1191 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
1192 &quot;A String&quot;,
1193 ],
1194 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
1195 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
1196 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
1197 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
1198 # specified.
1199 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
1200 # factorization.
1201 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
1202 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
1203 # feature.
1204 # 1. When data_split_method is CUSTOM, the corresponding column should
1205 # be boolean. The rows with true value tag are eval data, and the false
1206 # are training data.
1207 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
1208 # rows (from smallest to largest) in the corresponding column are used
1209 # as training data, and the rest are eval data. It respects the order
1210 # in Orderable data types:
1211 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
1212 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
1213 # training algorithms.
1214 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
1215 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
1216 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
1217 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
1218 # applicable for imported models.
1219 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
1220 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
1221 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
1222 # algorithms.
1223 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
1224 # when kmeans_initialization_method is CUSTOM.
1225 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
1226 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
1227 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001228 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
1229 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
1230 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
1231 # training data. Only applicable for classification models.
1232 &quot;a_key&quot;: 3.14,
1233 },
1234 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
1235 # overfitting for boosted tree models.
1236 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
1237 # any more (compared to min_relative_progress). Used only for iterative
1238 # training algorithms.
1239 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
1240 # of data will be used as training data. The format should be double.
1241 # Accurate to two decimal places.
1242 # Default value is 0.2.
1243 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
1244 # strategy.
1245 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
Bu Sun Kim65020912020-05-20 12:08:20 -07001246 },
1247 &quot;dataSplitResult&quot;: { # Data split result. This contains references to the training and evaluation # Data split result of the training run. Only set when the input data is
1248 # actually split.
1249 # data tables that were used to train the model.
1250 &quot;trainingTable&quot;: { # Table reference of the training data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -07001251 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1252 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001253 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001254 },
1255 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -07001256 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1257 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001258 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001259 },
1260 },
1261 },
1262 ],
1263 &quot;modelReference&quot;: { # Required. Unique identifier for this model.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001264 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
Bu Sun Kim65020912020-05-20 12:08:20 -07001265 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
1266 &quot;modelId&quot;: &quot;A String&quot;, # [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001267 },
1268 &quot;description&quot;: &quot;A String&quot;, # Optional. A user-friendly description of this model.
1269 &quot;etag&quot;: &quot;A String&quot;, # Output only. A hash of this resource.
1270 &quot;creationTime&quot;: &quot;A String&quot;, # Output only. The time when this model was created, in millisecs since the epoch.
1271 &quot;encryptionConfiguration&quot;: { # Custom encryption configuration (e.g., Cloud KMS keys). This shows the
1272 # encryption configuration of the model data while stored in BigQuery
1273 # storage. This field can be used with PatchModel to update encryption key
1274 # for an already encrypted model.
1275 &quot;kmsKeyName&quot;: &quot;A String&quot;, # [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
1276 },
1277}
1278
1279
1280Returns:
1281 An object of the form:
1282
1283 {
1284 &quot;location&quot;: &quot;A String&quot;, # Output only. The geographic location where the model resides. This value
1285 # is inherited from the dataset.
1286 &quot;friendlyName&quot;: &quot;A String&quot;, # Optional. A descriptive name for this model.
1287 &quot;lastModifiedTime&quot;: &quot;A String&quot;, # Output only. The time when this model was last modified, in millisecs since the epoch.
1288 &quot;labels&quot;: { # The labels associated with this model. You can use these to organize
Dan O'Mearadd494642020-05-01 07:42:23 -07001289 # and group your models. Label keys and values can be no longer
1290 # than 63 characters, can only contain lowercase letters, numeric
1291 # characters, underscores and dashes. International characters are allowed.
1292 # Label values are optional. Label keys must start with a letter and each
1293 # label in the list must have a different key.
Bu Sun Kim65020912020-05-20 12:08:20 -07001294 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001295 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001296 &quot;labelColumns&quot;: [ # Output only. Label columns that were used to train this model.
1297 # The output of the model will have a &quot;predicted_&quot; prefix to these columns.
1298 { # A field or a column.
1299 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
1300 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
1301 # specified (e.g., CREATE FUNCTION statement can omit the return type;
1302 # in this case the output parameter does not have this &quot;type&quot; field).
1303 # Examples:
1304 # INT64: {type_kind=&quot;INT64&quot;}
1305 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
1306 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
1307 # {type_kind=&quot;STRUCT&quot;,
1308 # struct_type={fields=[
1309 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
1310 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
1311 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001312 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
1313 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
1314 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -07001315 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
1316 &quot;fields&quot;: [
1317 # Object with schema name: StandardSqlField
1318 ],
1319 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001320 },
1321 },
1322 ],
1323 &quot;modelType&quot;: &quot;A String&quot;, # Output only. Type of the model resource.
1324 &quot;featureColumns&quot;: [ # Output only. Input feature columns that were used to train this model.
1325 { # A field or a column.
1326 &quot;name&quot;: &quot;A String&quot;, # Optional. The name of this field. Can be absent for struct fields.
1327 &quot;type&quot;: { # The type of a variable, e.g., a function argument. # Optional. The type of this parameter. Absent if not explicitly
1328 # specified (e.g., CREATE FUNCTION statement can omit the return type;
1329 # in this case the output parameter does not have this &quot;type&quot; field).
1330 # Examples:
1331 # INT64: {type_kind=&quot;INT64&quot;}
1332 # ARRAY&lt;STRING&gt;: {type_kind=&quot;ARRAY&quot;, array_element_type=&quot;STRING&quot;}
1333 # STRUCT&lt;x STRING, y ARRAY&lt;DATE&gt;&gt;:
1334 # {type_kind=&quot;STRUCT&quot;,
1335 # struct_type={fields=[
1336 # {name=&quot;x&quot;, type={type_kind=&quot;STRING&quot;}},
1337 # {name=&quot;y&quot;, type={type_kind=&quot;ARRAY&quot;, array_element_type=&quot;DATE&quot;}}
1338 # ]}}
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001339 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
1340 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
1341 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
Bu Sun Kim65020912020-05-20 12:08:20 -07001342 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
1343 &quot;fields&quot;: [
1344 # Object with schema name: StandardSqlField
1345 ],
1346 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001347 },
1348 },
1349 ],
1350 &quot;expirationTime&quot;: &quot;A String&quot;, # Optional. The time when this model expires, in milliseconds since the epoch.
1351 # If not present, the model will persist indefinitely. Expired models
1352 # will be deleted and their storage reclaimed. The defaultTableExpirationMs
1353 # property of the encapsulating dataset can be used to set a default
1354 # expirationTime on newly created models.
1355 &quot;trainingRuns&quot;: [ # Output only. Information for all training runs in increasing order of start_time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001356 { # Information about a single training query run for the model.
Bu Sun Kim65020912020-05-20 12:08:20 -07001357 &quot;startTime&quot;: &quot;A String&quot;, # The start time of this training run.
1358 &quot;results&quot;: [ # Output of each iteration run, results.size() &lt;= max_iterations.
1359 { # Information about a single iteration of the training run.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001360 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
1361 { # Information about a single cluster for clustering model.
1362 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
1363 # to each point assigned to the cluster.
1364 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
1365 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
1366 },
1367 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001368 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
1369 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
1370 &quot;index&quot;: 42, # Index of the iteration, 0 based.
1371 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
1372 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
1373 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
1374 # refactoring if we want to use model-specific iteration results.
1375 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
1376 # fitted in auto-arima. For non-auto-arima model, its size is one.
1377 { # Arima model information.
Bu Sun Kim65020912020-05-20 12:08:20 -07001378 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
1379 # for one time series.
1380 &quot;A String&quot;,
1381 ],
1382 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
Bu Sun Kim65020912020-05-20 12:08:20 -07001383 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
1384 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001385 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
1386 },
1387 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
1388 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
1389 &quot;variance&quot;: 3.14, # Variance.
1390 &quot;aic&quot;: 3.14, # AIC.
1391 },
1392 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
1393 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
1394 # when d is not 1.
1395 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
1396 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
1397 3.14,
1398 ],
1399 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
1400 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
1401 3.14,
1402 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001403 },
1404 },
1405 ],
1406 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
1407 # one time series.
1408 &quot;A String&quot;,
1409 ],
1410 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001411 },
1412 ],
1413 &quot;evaluationMetrics&quot;: { # Evaluation metrics of a model. These are either computed on all training # The evaluation metrics over training/eval data that were computed at the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001414 # end of training.
1415 # data or just the eval data based on whether eval data was used during
1416 # training. These are not present for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -07001417 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
1418 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1419 # models, the metrics are either macro-averaged or micro-averaged. When
1420 # macro-averaged, the metrics are calculated for each label and then an
1421 # unweighted average is taken of those values. When micro-averaged, the
1422 # metric is calculated globally by counting the total number of correctly
1423 # predicted rows.
1424 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1425 # positive prediction. For multiclass this is a macro-averaged metric.
1426 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1427 # classification models this is the positive class threshold.
1428 # For multi-class classfication models this is the confidence
1429 # threshold.
1430 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1431 # metric.
1432 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1433 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1434 # this is a macro-averaged metric.
1435 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1436 # positive actual labels. For multiclass this is a macro-averaged
1437 # metric treating each class as a binary classifier.
1438 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1439 # multiclass this is a micro-averaged metric.
1440 },
1441 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
1442 { # Confusion matrix for multi-class classification models.
1443 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
1444 # confusion matrix.
1445 &quot;rows&quot;: [ # One row per actual label.
1446 { # A single row in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001447 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
Bu Sun Kim65020912020-05-20 12:08:20 -07001448 &quot;entries&quot;: [ # Info describing predicted label distribution.
1449 { # A single entry in the confusion matrix.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001450 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
Bu Sun Kim65020912020-05-20 12:08:20 -07001451 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
1452 # also add an entry indicating the number of items under the
1453 # confidence threshold.
Bu Sun Kim65020912020-05-20 12:08:20 -07001454 },
1455 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001456 },
1457 ],
1458 },
1459 ],
1460 },
1461 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
1462 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
1463 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
1464 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001465 { # Message containing the information about one cluster.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001466 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Bu Sun Kim65020912020-05-20 12:08:20 -07001467 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
1468 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
Dan O'Mearadd494642020-05-01 07:42:23 -07001469 { # Representative value of a single feature within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001470 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
1471 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
1472 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
Dan O'Mearadd494642020-05-01 07:42:23 -07001473 # more than ten categories, we return top ten (by count) and return
Bu Sun Kim65020912020-05-20 12:08:20 -07001474 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
Dan O'Mearadd494642020-05-01 07:42:23 -07001475 # aggregate counts of remaining categories.
1476 { # Represents the count of a single category within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001477 &quot;category&quot;: &quot;A String&quot;, # The name of category.
1478 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
Dan O'Mearadd494642020-05-01 07:42:23 -07001479 # cluster.
1480 },
1481 ],
1482 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001483 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
1484 # feature.
Dan O'Mearadd494642020-05-01 07:42:23 -07001485 },
1486 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001487 },
1488 ],
1489 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001490 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary classification/classifier models.
1491 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
1492 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
1493 { # Confusion matrix for binary classification models.
1494 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
1495 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
1496 # labels.
1497 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
1498 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
1499 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
1500 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
1501 # prediction.
1502 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
1503 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
1504 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
1505 },
1506 ],
1507 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1508 # models, the metrics are either macro-averaged or micro-averaged. When
1509 # macro-averaged, the metrics are calculated for each label and then an
1510 # unweighted average is taken of those values. When micro-averaged, the
1511 # metric is calculated globally by counting the total number of correctly
1512 # predicted rows.
1513 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1514 # positive prediction. For multiclass this is a macro-averaged metric.
1515 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1516 # classification models this is the positive class threshold.
1517 # For multi-class classfication models this is the confidence
1518 # threshold.
1519 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1520 # metric.
1521 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1522 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1523 # this is a macro-averaged metric.
1524 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1525 # positive actual labels. For multiclass this is a macro-averaged
1526 # metric treating each class as a binary classifier.
1527 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1528 # multiclass this is a micro-averaged metric.
1529 },
1530 &quot;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
1531 },
1532 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
1533 # factorization models.
1534 # factorization models.
1535 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
1536 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
1537 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
1538 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
1539 &quot;rSquared&quot;: 3.14, # R^2 score.
1540 },
1541 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
1542 # models.
1543 # feedback_type=implicit.
1544 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
1545 # then averages all the precisions across all the users.
1546 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
1547 # predicted confidence by comparing it to an ideal rank measured by the
1548 # original ratings.
1549 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
1550 # from the predicted confidence and dividing it by the original rank.
1551 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
1552 # recommendation models except instead of computing the rating directly,
1553 # the output from evaluate is computed against a preference which is 1 or 0
1554 # depending on if the rating exists or not.
1555 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001556 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001557 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001558 # user specified and default options that were used.
Bu Sun Kim65020912020-05-20 12:08:20 -07001559 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
1560 &quot;A String&quot;,
1561 ],
1562 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
1563 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
1564 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
1565 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
1566 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
1567 &quot;A String&quot;,
1568 ],
1569 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
1570 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
1571 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
1572 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
1573 # specified.
1574 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
1575 # factorization.
1576 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
1577 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001578 # feature.
1579 # 1. When data_split_method is CUSTOM, the corresponding column should
1580 # be boolean. The rows with true value tag are eval data, and the false
1581 # are training data.
1582 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
1583 # rows (from smallest to largest) in the corresponding column are used
1584 # as training data, and the rest are eval data. It respects the order
1585 # in Orderable data types:
1586 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
Bu Sun Kim65020912020-05-20 12:08:20 -07001587 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
1588 # training algorithms.
1589 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
1590 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
1591 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
1592 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001593 # applicable for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -07001594 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
1595 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
1596 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
1597 # algorithms.
1598 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
1599 # when kmeans_initialization_method is CUSTOM.
1600 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
1601 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
1602 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001603 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
1604 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
1605 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
1606 # training data. Only applicable for classification models.
1607 &quot;a_key&quot;: 3.14,
1608 },
1609 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
1610 # overfitting for boosted tree models.
1611 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
1612 # any more (compared to min_relative_progress). Used only for iterative
1613 # training algorithms.
1614 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
1615 # of data will be used as training data. The format should be double.
1616 # Accurate to two decimal places.
1617 # Default value is 0.2.
1618 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
1619 # strategy.
1620 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001621 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001622 &quot;dataSplitResult&quot;: { # Data split result. This contains references to the training and evaluation # Data split result of the training run. Only set when the input data is
1623 # actually split.
1624 # data tables that were used to train the model.
1625 &quot;trainingTable&quot;: { # Table reference of the training data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -07001626 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1627 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001628 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001629 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001630 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
Bu Sun Kim65020912020-05-20 12:08:20 -07001631 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1632 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001633 &quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001634 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001635 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001636 },
1637 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001638 &quot;modelReference&quot;: { # Required. Unique identifier for this model.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001639 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
Bu Sun Kim65020912020-05-20 12:08:20 -07001640 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
1641 &quot;modelId&quot;: &quot;A String&quot;, # [Required] The ID of the model. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001642 },
1643 &quot;description&quot;: &quot;A String&quot;, # Optional. A user-friendly description of this model.
1644 &quot;etag&quot;: &quot;A String&quot;, # Output only. A hash of this resource.
1645 &quot;creationTime&quot;: &quot;A String&quot;, # Output only. The time when this model was created, in millisecs since the epoch.
1646 &quot;encryptionConfiguration&quot;: { # Custom encryption configuration (e.g., Cloud KMS keys). This shows the
Dan O'Mearadd494642020-05-01 07:42:23 -07001647 # encryption configuration of the model data while stored in BigQuery
1648 # storage. This field can be used with PatchModel to update encryption key
1649 # for an already encrypted model.
Bu Sun Kim65020912020-05-20 12:08:20 -07001650 &quot;kmsKeyName&quot;: &quot;A String&quot;, # [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key.
Dan O'Mearadd494642020-05-01 07:42:23 -07001651 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001652 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001653</div>
1654
1655</body></html>