blob: 91fc1e696c61e552947a617d7332df2d8bba0aec [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">
84 <code><a href="#list">list(projectId, datasetId, pageToken=None, maxResults=None)</a></code></p>
85<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 # ]}}
145 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
146 &quot;fields&quot;: [
147 # Object with schema name: StandardSqlField
148 ],
149 },
150 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
151 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
152 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
153 },
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 # ]}}
172 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
173 &quot;fields&quot;: [
174 # Object with schema name: StandardSqlField
175 ],
176 },
177 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
178 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
179 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
180 },
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.
193 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
194 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
195 &quot;index&quot;: 42, # Index of the iteration, 0 based.
196 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
197 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
198 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
199 # refactoring if we want to use model-specific iteration results.
200 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
201 # fitted in auto-arima. For non-auto-arima model, its size is one.
202 { # Arima model information.
203 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
204 &quot;aic&quot;: 3.14, # AIC.
205 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
206 &quot;variance&quot;: 3.14, # Variance.
207 },
208 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
209 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
210 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
211 3.14,
212 ],
213 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
214 3.14,
215 ],
216 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
217 },
218 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
219 # when d is not 1.
220 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
221 # for one time series.
222 &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700223 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
225 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
226 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
227 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
228 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700229 },
230 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700231 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
232 # one time series.
233 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 ],
235 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700236 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
237 { # Information about a single cluster for clustering model.
238 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
239 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
240 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
241 # to each point assigned to the cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 ],
244 },
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.
250 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary 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;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
275 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
276 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
277 { # Confusion matrix for binary classification models.
278 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
279 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
280 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
281 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
282 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
283 # labels.
284 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
285 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
286 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
287 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
288 # prediction.
289 },
290 ],
291 },
292 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
293 # factorization models.
294 # factorization models.
295 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
296 &quot;rSquared&quot;: 3.14, # R^2 score.
297 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
298 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
299 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
300 },
301 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
302 # models.
303 # feedback_type=implicit.
304 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
305 # then averages all the precisions across all the users.
306 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
307 # predicted confidence by comparing it to an ideal rank measured by the
308 # original ratings.
309 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
310 # from the predicted confidence and dividing it by the original rank.
311 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
312 # recommendation models except instead of computing the rating directly,
313 # the output from evaluate is computed against a preference which is 1 or 0
314 # depending on if the rating exists or not.
315 },
316 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
317 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
318 # models, the metrics are either macro-averaged or micro-averaged. When
319 # macro-averaged, the metrics are calculated for each label and then an
320 # unweighted average is taken of those values. When micro-averaged, the
321 # metric is calculated globally by counting the total number of correctly
322 # predicted rows.
323 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
324 # positive prediction. For multiclass this is a macro-averaged metric.
325 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
326 # classification models this is the positive class threshold.
327 # For multi-class classfication models this is the confidence
328 # threshold.
329 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
330 # metric.
331 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
332 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
333 # this is a macro-averaged metric.
334 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
335 # positive actual labels. For multiclass this is a macro-averaged
336 # metric treating each class as a binary classifier.
337 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
338 # multiclass this is a micro-averaged metric.
339 },
340 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
341 { # Confusion matrix for multi-class classification models.
342 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
343 # confusion matrix.
344 &quot;rows&quot;: [ # One row per actual label.
345 { # A single row in the confusion matrix.
346 &quot;entries&quot;: [ # Info describing predicted label distribution.
347 { # A single entry in the confusion matrix.
348 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
349 # also add an entry indicating the number of items under the
350 # confidence threshold.
351 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
352 },
353 ],
354 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
355 },
356 ],
357 },
358 ],
359 },
360 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
361 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
362 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
363 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
364 { # Message containing the information about one cluster.
365 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
366 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
367 { # Representative value of a single feature within the cluster.
368 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
369 # feature.
370 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
371 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
372 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
373 # more than ten categories, we return top ten (by count) and return
374 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
375 # aggregate counts of remaining categories.
376 { # Represents the count of a single category within the cluster.
377 &quot;category&quot;: &quot;A String&quot;, # The name of category.
378 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
379 # cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700380 },
381 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700382 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700383 },
384 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700385 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700386 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700387 ],
388 },
389 },
390 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
391 # user specified and default options that were used.
392 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
393 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
394 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
395 # training data. Only applicable for classification models.
396 &quot;a_key&quot;: 3.14,
397 },
398 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
399 # overfitting for boosted tree models.
400 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
401 # any more (compared to min_relative_progress). Used only for iterative
402 # training algorithms.
403 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
404 # of data will be used as training data. The format should be double.
405 # Accurate to two decimal places.
406 # Default value is 0.2.
407 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
408 # strategy.
409 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
410 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
411 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700412 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700413 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
414 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
415 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
416 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
417 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
418 &quot;A String&quot;,
419 ],
420 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
421 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
422 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
423 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
424 # specified.
425 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
426 # factorization.
427 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
428 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
429 # feature.
430 # 1. When data_split_method is CUSTOM, the corresponding column should
431 # be boolean. The rows with true value tag are eval data, and the false
432 # are training data.
433 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
434 # rows (from smallest to largest) in the corresponding column are used
435 # as training data, and the rest are eval data. It respects the order
436 # in Orderable data types:
437 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
438 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
439 # training algorithms.
440 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
441 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
442 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
443 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
444 # applicable for imported models.
445 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
446 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
447 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
448 # algorithms.
449 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
450 # when kmeans_initialization_method is CUSTOM.
451 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
452 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
453 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
454 },
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.
459 &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.
460 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
461 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
462 },
463 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
464 &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.
465 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
466 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
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.
472 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
473 &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.
474 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
475 },
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">
489 <code class="details" id="list">list(projectId, datasetId, pageToken=None, maxResults=None)</code>
490 <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)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700496 pageToken: string, Page token, returned by a previous call to request the next page of
497results
Dan O'Mearadd494642020-05-01 07:42:23 -0700498 maxResults: integer, The maximum number of results to return in a single response page.
499Leverage the page tokens to iterate through the entire collection.
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 # ]}}
538 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
539 &quot;fields&quot;: [
540 # Object with schema name: StandardSqlField
541 ],
542 },
543 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
544 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
545 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
546 },
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 # ]}}
565 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
566 &quot;fields&quot;: [
567 # Object with schema name: StandardSqlField
568 ],
569 },
570 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
571 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
572 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
573 },
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.
586 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
587 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
588 &quot;index&quot;: 42, # Index of the iteration, 0 based.
589 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
590 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
591 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
592 # refactoring if we want to use model-specific iteration results.
593 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
594 # fitted in auto-arima. For non-auto-arima model, its size is one.
595 { # Arima model information.
596 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
597 &quot;aic&quot;: 3.14, # AIC.
598 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
599 &quot;variance&quot;: 3.14, # Variance.
600 },
601 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
602 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
603 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
604 3.14,
605 ],
606 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
607 3.14,
608 ],
609 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
610 },
611 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
612 # when d is not 1.
613 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
614 # for one time series.
615 &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700616 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700617 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
618 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
619 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
620 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
621 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700622 },
623 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700624 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
625 # one time series.
626 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 ],
628 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700629 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
630 { # Information about a single cluster for clustering model.
631 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
632 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
633 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
634 # to each point assigned to the cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700636 ],
637 },
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.
643 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary 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;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
668 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
669 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
670 { # Confusion matrix for binary classification models.
671 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
672 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
673 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
674 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
675 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
676 # labels.
677 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
678 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
679 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
680 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
681 # prediction.
682 },
683 ],
684 },
685 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
686 # factorization models.
687 # factorization models.
688 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
689 &quot;rSquared&quot;: 3.14, # R^2 score.
690 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
691 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
692 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
693 },
694 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
695 # models.
696 # feedback_type=implicit.
697 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
698 # then averages all the precisions across all the users.
699 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
700 # predicted confidence by comparing it to an ideal rank measured by the
701 # original ratings.
702 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
703 # from the predicted confidence and dividing it by the original rank.
704 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
705 # recommendation models except instead of computing the rating directly,
706 # the output from evaluate is computed against a preference which is 1 or 0
707 # depending on if the rating exists or not.
708 },
709 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
710 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
711 # models, the metrics are either macro-averaged or micro-averaged. When
712 # macro-averaged, the metrics are calculated for each label and then an
713 # unweighted average is taken of those values. When micro-averaged, the
714 # metric is calculated globally by counting the total number of correctly
715 # predicted rows.
716 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
717 # positive prediction. For multiclass this is a macro-averaged metric.
718 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
719 # classification models this is the positive class threshold.
720 # For multi-class classfication models this is the confidence
721 # threshold.
722 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
723 # metric.
724 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
725 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
726 # this is a macro-averaged metric.
727 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
728 # positive actual labels. For multiclass this is a macro-averaged
729 # metric treating each class as a binary classifier.
730 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
731 # multiclass this is a micro-averaged metric.
732 },
733 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
734 { # Confusion matrix for multi-class classification models.
735 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
736 # confusion matrix.
737 &quot;rows&quot;: [ # One row per actual label.
738 { # A single row in the confusion matrix.
739 &quot;entries&quot;: [ # Info describing predicted label distribution.
740 { # A single entry in the confusion matrix.
741 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
742 # also add an entry indicating the number of items under the
743 # confidence threshold.
744 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
745 },
746 ],
747 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
748 },
749 ],
750 },
751 ],
752 },
753 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
754 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
755 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
756 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
757 { # Message containing the information about one cluster.
758 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
759 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
760 { # Representative value of a single feature within the cluster.
761 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
762 # feature.
763 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
764 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
765 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
766 # more than ten categories, we return top ten (by count) and return
767 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
768 # aggregate counts of remaining categories.
769 { # Represents the count of a single category within the cluster.
770 &quot;category&quot;: &quot;A String&quot;, # The name of category.
771 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
772 # cluster.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700773 },
774 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700775 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700776 },
777 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700778 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700779 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700780 ],
781 },
782 },
783 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
784 # user specified and default options that were used.
785 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
786 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
787 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
788 # training data. Only applicable for classification models.
789 &quot;a_key&quot;: 3.14,
790 },
791 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
792 # overfitting for boosted tree models.
793 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
794 # any more (compared to min_relative_progress). Used only for iterative
795 # training algorithms.
796 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
797 # of data will be used as training data. The format should be double.
798 # Accurate to two decimal places.
799 # Default value is 0.2.
800 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
801 # strategy.
802 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
803 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
804 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700805 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700806 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
807 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
808 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
809 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
810 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
811 &quot;A String&quot;,
812 ],
813 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
814 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
815 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
816 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
817 # specified.
818 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
819 # factorization.
820 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
821 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
822 # feature.
823 # 1. When data_split_method is CUSTOM, the corresponding column should
824 # be boolean. The rows with true value tag are eval data, and the false
825 # are training data.
826 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
827 # rows (from smallest to largest) in the corresponding column are used
828 # as training data, and the rest are eval data. It respects the order
829 # in Orderable data types:
830 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
831 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
832 # training algorithms.
833 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
834 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
835 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
836 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
837 # applicable for imported models.
838 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
839 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
840 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
841 # algorithms.
842 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
843 # when kmeans_initialization_method is CUSTOM.
844 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
845 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
846 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
847 },
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.
852 &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.
853 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
854 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
855 },
856 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
857 &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.
858 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
859 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
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.
865 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
866 &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.
867 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
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 # ]}}
937 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
938 &quot;fields&quot;: [
939 # Object with schema name: StandardSqlField
940 ],
941 },
942 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
943 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
944 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
945 },
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 # ]}}
964 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
965 &quot;fields&quot;: [
966 # Object with schema name: StandardSqlField
967 ],
968 },
969 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
970 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
971 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
972 },
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.
985 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
986 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
987 &quot;index&quot;: 42, # Index of the iteration, 0 based.
988 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
989 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
990 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
991 # refactoring if we want to use model-specific iteration results.
992 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
993 # fitted in auto-arima. For non-auto-arima model, its size is one.
994 { # Arima model information.
995 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
996 &quot;aic&quot;: 3.14, # AIC.
997 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
998 &quot;variance&quot;: 3.14, # Variance.
999 },
1000 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
1001 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
1002 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
1003 3.14,
1004 ],
1005 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
1006 3.14,
1007 ],
1008 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
1009 },
1010 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
1011 # when d is not 1.
1012 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
1013 # for one time series.
1014 &quot;A String&quot;,
1015 ],
1016 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
1017 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
1018 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
1019 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
1020 },
1021 },
1022 ],
1023 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
1024 # one time series.
1025 &quot;A String&quot;,
1026 ],
1027 },
1028 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
1029 { # Information about a single cluster for clustering model.
1030 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
1031 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
1032 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
1033 # to each point assigned to the cluster.
1034 },
1035 ],
1036 },
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.
1042 &quot;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary 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;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
1067 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
1068 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
1069 { # Confusion matrix for binary classification models.
1070 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
1071 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
1072 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
1073 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
1074 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
1075 # labels.
1076 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
1077 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
1078 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
1079 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
1080 # prediction.
1081 },
1082 ],
1083 },
1084 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
1085 # factorization models.
1086 # factorization models.
1087 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
1088 &quot;rSquared&quot;: 3.14, # R^2 score.
1089 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
1090 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
1091 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
1092 },
1093 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
1094 # models.
1095 # feedback_type=implicit.
1096 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
1097 # then averages all the precisions across all the users.
1098 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
1099 # predicted confidence by comparing it to an ideal rank measured by the
1100 # original ratings.
1101 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
1102 # from the predicted confidence and dividing it by the original rank.
1103 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
1104 # recommendation models except instead of computing the rating directly,
1105 # the output from evaluate is computed against a preference which is 1 or 0
1106 # depending on if the rating exists or not.
1107 },
1108 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
1109 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1110 # models, the metrics are either macro-averaged or micro-averaged. When
1111 # macro-averaged, the metrics are calculated for each label and then an
1112 # unweighted average is taken of those values. When micro-averaged, the
1113 # metric is calculated globally by counting the total number of correctly
1114 # predicted rows.
1115 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1116 # positive prediction. For multiclass this is a macro-averaged metric.
1117 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1118 # classification models this is the positive class threshold.
1119 # For multi-class classfication models this is the confidence
1120 # threshold.
1121 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1122 # metric.
1123 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1124 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1125 # this is a macro-averaged metric.
1126 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1127 # positive actual labels. For multiclass this is a macro-averaged
1128 # metric treating each class as a binary classifier.
1129 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1130 # multiclass this is a micro-averaged metric.
1131 },
1132 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
1133 { # Confusion matrix for multi-class classification models.
1134 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
1135 # confusion matrix.
1136 &quot;rows&quot;: [ # One row per actual label.
1137 { # A single row in the confusion matrix.
1138 &quot;entries&quot;: [ # Info describing predicted label distribution.
1139 { # A single entry in the confusion matrix.
1140 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
1141 # also add an entry indicating the number of items under the
1142 # confidence threshold.
1143 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
1144 },
1145 ],
1146 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
1147 },
1148 ],
1149 },
1150 ],
1151 },
1152 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
1153 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
1154 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
1155 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
1156 { # Message containing the information about one cluster.
1157 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
1158 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
1159 { # Representative value of a single feature within the cluster.
1160 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
1161 # feature.
1162 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
1163 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
1164 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
1165 # more than ten categories, we return top ten (by count) and return
1166 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
1167 # aggregate counts of remaining categories.
1168 { # Represents the count of a single category within the cluster.
1169 &quot;category&quot;: &quot;A String&quot;, # The name of category.
1170 &quot;count&quot;: &quot;A String&quot;, # The count of training samples matching the category within the
1171 # cluster.
1172 },
1173 ],
1174 },
1175 },
1176 ],
1177 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
1178 },
1179 ],
1180 },
1181 },
1182 &quot;trainingOptions&quot;: { # Options that were used for this training run, includes
1183 # user specified and default options that were used.
1184 &quot;dropout&quot;: 3.14, # Dropout probability for dnn models.
1185 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
1186 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
1187 # training data. Only applicable for classification models.
1188 &quot;a_key&quot;: 3.14,
1189 },
1190 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
1191 # overfitting for boosted tree models.
1192 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
1193 # any more (compared to min_relative_progress). Used only for iterative
1194 # training algorithms.
1195 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
1196 # of data will be used as training data. The format should be double.
1197 # Accurate to two decimal places.
1198 # Default value is 0.2.
1199 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
1200 # strategy.
1201 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
1202 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
1203 &quot;A String&quot;,
1204 ],
1205 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
1206 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
1207 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
1208 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
1209 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
1210 &quot;A String&quot;,
1211 ],
1212 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
1213 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
1214 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
1215 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
1216 # specified.
1217 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
1218 # factorization.
1219 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
1220 &quot;dataSplitColumn&quot;: &quot;A String&quot;, # The column to split data with. This column won&#x27;t be used as a
1221 # feature.
1222 # 1. When data_split_method is CUSTOM, the corresponding column should
1223 # be boolean. The rows with true value tag are eval data, and the false
1224 # are training data.
1225 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
1226 # rows (from smallest to largest) in the corresponding column are used
1227 # as training data, and the rest are eval data. It respects the order
1228 # in Orderable data types:
1229 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
1230 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
1231 # training algorithms.
1232 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
1233 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
1234 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
1235 &quot;modelUri&quot;: &quot;A String&quot;, # [Beta] Google Cloud Storage URI from which the model was imported. Only
1236 # applicable for imported models.
1237 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
1238 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
1239 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
1240 # algorithms.
1241 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
1242 # when kmeans_initialization_method is CUSTOM.
1243 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
1244 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
1245 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree models.
1246 },
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.
1251 &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.
1252 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1253 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
1254 },
1255 &quot;evaluationTable&quot;: { # Table reference of the evaluation data after split.
1256 &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.
1257 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1258 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
1259 },
1260 },
1261 },
1262 ],
1263 &quot;modelReference&quot;: { # Required. Unique identifier for this model.
1264 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
1265 &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.
1266 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
1267 },
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 # ]}}
1312 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
1313 &quot;fields&quot;: [
1314 # Object with schema name: StandardSqlField
1315 ],
1316 },
1317 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
1318 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
1319 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
1320 },
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 # ]}}
1339 &quot;structType&quot;: { # The fields of this struct, in order, if type_kind = &quot;STRUCT&quot;.
1340 &quot;fields&quot;: [
1341 # Object with schema name: StandardSqlField
1342 ],
1343 },
1344 &quot;arrayElementType&quot;: # Object with schema name: StandardSqlDataType # The type of the array&#x27;s elements, if type_kind = &quot;ARRAY&quot;.
1345 &quot;typeKind&quot;: &quot;A String&quot;, # Required. The top level type of this field.
1346 # Can be any standard SQL data type (e.g., &quot;INT64&quot;, &quot;DATE&quot;, &quot;ARRAY&quot;).
1347 },
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.
1360 &quot;trainingLoss&quot;: 3.14, # Loss computed on the training data at the end of iteration.
1361 &quot;evalLoss&quot;: 3.14, # Loss computed on the eval data at the end of iteration.
1362 &quot;index&quot;: 42, # Index of the iteration, 0 based.
1363 &quot;learnRate&quot;: 3.14, # Learn rate used for this iteration.
1364 &quot;durationMs&quot;: &quot;A String&quot;, # Time taken to run the iteration in milliseconds.
1365 &quot;arimaResult&quot;: { # (Auto-)arima fitting result. Wrap everything in ArimaResult for easier
1366 # refactoring if we want to use model-specific iteration results.
1367 &quot;arimaModelInfo&quot;: [ # This message is repeated because there are multiple arima models
1368 # fitted in auto-arima. For non-auto-arima model, its size is one.
1369 { # Arima model information.
1370 &quot;arimaFittingMetrics&quot;: { # ARIMA model fitting metrics. # Arima fitting metrics.
1371 &quot;aic&quot;: 3.14, # AIC.
1372 &quot;logLikelihood&quot;: 3.14, # Log-likelihood.
1373 &quot;variance&quot;: 3.14, # Variance.
1374 },
1375 &quot;timeSeriesId&quot;: &quot;A String&quot;, # The id to indicate different time series.
1376 &quot;arimaCoefficients&quot;: { # Arima coefficients. # Arima coefficients.
1377 &quot;movingAverageCoefficients&quot;: [ # Moving-average coefficients, an array of double.
1378 3.14,
1379 ],
1380 &quot;autoRegressiveCoefficients&quot;: [ # Auto-regressive coefficients, an array of double.
1381 3.14,
1382 ],
1383 &quot;interceptCoefficient&quot;: 3.14, # Intercept coefficient, just a double not an array.
1384 },
1385 &quot;hasDrift&quot;: True or False, # Whether Arima model fitted with drift or not. It is always false
1386 # when d is not 1.
1387 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported
1388 # for one time series.
1389 &quot;A String&quot;,
1390 ],
1391 &quot;nonSeasonalOrder&quot;: { # Arima order, can be used for both non-seasonal and seasonal parts. # Non-seasonal order.
1392 &quot;q&quot;: &quot;A String&quot;, # Order of the moving-average part.
1393 &quot;d&quot;: &quot;A String&quot;, # Order of the differencing part.
1394 &quot;p&quot;: &quot;A String&quot;, # Order of the autoregressive part.
1395 },
1396 },
1397 ],
1398 &quot;seasonalPeriods&quot;: [ # Seasonal periods. Repeated because multiple periods are supported for
1399 # one time series.
1400 &quot;A String&quot;,
1401 ],
1402 },
1403 &quot;clusterInfos&quot;: [ # Information about top clusters for clustering models.
1404 { # Information about a single cluster for clustering model.
1405 &quot;clusterSize&quot;: &quot;A String&quot;, # Cluster size, the total number of points assigned to the cluster.
1406 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
1407 &quot;clusterRadius&quot;: 3.14, # Cluster radius, the average distance from centroid
1408 # to each point assigned to the cluster.
1409 },
1410 ],
1411 },
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;binaryClassificationMetrics&quot;: { # Evaluation metrics for binary classification/classifier models. # Populated for binary 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;negativeLabel&quot;: &quot;A String&quot;, # Label representing the negative class.
1442 &quot;positiveLabel&quot;: &quot;A String&quot;, # Label representing the positive class.
1443 &quot;binaryConfusionMatrixList&quot;: [ # Binary confusion matrix at multiple thresholds.
1444 { # Confusion matrix for binary classification models.
1445 &quot;falseNegatives&quot;: &quot;A String&quot;, # Number of false samples predicted as false.
1446 &quot;falsePositives&quot;: &quot;A String&quot;, # Number of false samples predicted as true.
1447 &quot;trueNegatives&quot;: &quot;A String&quot;, # Number of true samples predicted as false.
1448 &quot;f1Score&quot;: 3.14, # The equally weighted average of recall and precision.
1449 &quot;precision&quot;: 3.14, # The fraction of actual positive predictions that had positive actual
1450 # labels.
1451 &quot;positiveClassThreshold&quot;: 3.14, # Threshold value used when computing each of the following metric.
1452 &quot;accuracy&quot;: 3.14, # The fraction of predictions given the correct label.
1453 &quot;truePositives&quot;: &quot;A String&quot;, # Number of true samples predicted as true.
1454 &quot;recall&quot;: 3.14, # The fraction of actual positive labels that were given a positive
1455 # prediction.
1456 },
1457 ],
1458 },
1459 &quot;regressionMetrics&quot;: { # Evaluation metrics for regression and explicit feedback type matrix # Populated for regression models and explicit feedback type matrix
1460 # factorization models.
1461 # factorization models.
1462 &quot;meanSquaredError&quot;: 3.14, # Mean squared error.
1463 &quot;rSquared&quot;: 3.14, # R^2 score.
1464 &quot;medianAbsoluteError&quot;: 3.14, # Median absolute error.
1465 &quot;meanSquaredLogError&quot;: 3.14, # Mean squared log error.
1466 &quot;meanAbsoluteError&quot;: 3.14, # Mean absolute error.
1467 },
1468 &quot;rankingMetrics&quot;: { # Evaluation metrics used by weighted-ALS models specified by # [Alpha] Populated for implicit feedback type matrix factorization
1469 # models.
1470 # feedback_type=implicit.
1471 &quot;meanAveragePrecision&quot;: 3.14, # Calculates a precision per user for all the items by ranking them and
1472 # then averages all the precisions across all the users.
1473 &quot;normalizedDiscountedCumulativeGain&quot;: 3.14, # A metric to determine the goodness of a ranking calculated from the
1474 # predicted confidence by comparing it to an ideal rank measured by the
1475 # original ratings.
1476 &quot;averageRank&quot;: 3.14, # Determines the goodness of a ranking by computing the percentile rank
1477 # from the predicted confidence and dividing it by the original rank.
1478 &quot;meanSquaredError&quot;: 3.14, # Similar to the mean squared error computed in regression and explicit
1479 # recommendation models except instead of computing the rating directly,
1480 # the output from evaluate is computed against a preference which is 1 or 0
1481 # depending on if the rating exists or not.
1482 },
1483 &quot;multiClassClassificationMetrics&quot;: { # Evaluation metrics for multi-class classification/classifier models. # Populated for multi-class classification/classifier models.
1484 &quot;aggregateClassificationMetrics&quot;: { # Aggregate metrics for classification/classifier models. For multi-class # Aggregate classification metrics.
1485 # models, the metrics are either macro-averaged or micro-averaged. When
1486 # macro-averaged, the metrics are calculated for each label and then an
1487 # unweighted average is taken of those values. When micro-averaged, the
1488 # metric is calculated globally by counting the total number of correctly
1489 # predicted rows.
1490 &quot;recall&quot;: 3.14, # Recall is the fraction of actual positive labels that were given a
1491 # positive prediction. For multiclass this is a macro-averaged metric.
1492 &quot;threshold&quot;: 3.14, # Threshold at which the metrics are computed. For binary
1493 # classification models this is the positive class threshold.
1494 # For multi-class classfication models this is the confidence
1495 # threshold.
1496 &quot;rocAuc&quot;: 3.14, # Area Under a ROC Curve. For multiclass this is a macro-averaged
1497 # metric.
1498 &quot;logLoss&quot;: 3.14, # Logarithmic Loss. For multiclass this is a macro-averaged metric.
1499 &quot;f1Score&quot;: 3.14, # The F1 score is an average of recall and precision. For multiclass
1500 # this is a macro-averaged metric.
1501 &quot;precision&quot;: 3.14, # Precision is the fraction of actual positive predictions that had
1502 # positive actual labels. For multiclass this is a macro-averaged
1503 # metric treating each class as a binary classifier.
1504 &quot;accuracy&quot;: 3.14, # Accuracy is the fraction of predictions given the correct label. For
1505 # multiclass this is a micro-averaged metric.
1506 },
1507 &quot;confusionMatrixList&quot;: [ # Confusion matrix at different thresholds.
1508 { # Confusion matrix for multi-class classification models.
1509 &quot;confidenceThreshold&quot;: 3.14, # Confidence threshold used when computing the entries of the
1510 # confusion matrix.
1511 &quot;rows&quot;: [ # One row per actual label.
1512 { # A single row in the confusion matrix.
1513 &quot;entries&quot;: [ # Info describing predicted label distribution.
1514 { # A single entry in the confusion matrix.
1515 &quot;predictedLabel&quot;: &quot;A String&quot;, # The predicted label. For confidence_threshold &gt; 0, we will
1516 # also add an entry indicating the number of items under the
1517 # confidence threshold.
1518 &quot;itemCount&quot;: &quot;A String&quot;, # Number of items being predicted as this label.
1519 },
1520 ],
1521 &quot;actualLabel&quot;: &quot;A String&quot;, # The original label of this row.
1522 },
1523 ],
1524 },
1525 ],
1526 },
1527 &quot;clusteringMetrics&quot;: { # Evaluation metrics for clustering models. # Populated for clustering models.
1528 &quot;meanSquaredDistance&quot;: 3.14, # Mean of squared distances between each sample to its cluster centroid.
1529 &quot;daviesBouldinIndex&quot;: 3.14, # Davies-Bouldin index.
1530 &quot;clusters&quot;: [ # [Beta] Information for all clusters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001531 { # Message containing the information about one cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001532 &quot;count&quot;: &quot;A String&quot;, # Count of training data rows that were assigned to this cluster.
1533 &quot;featureValues&quot;: [ # Values of highly variant features for this cluster.
Dan O'Mearadd494642020-05-01 07:42:23 -07001534 { # Representative value of a single feature within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001535 &quot;numericalValue&quot;: 3.14, # The numerical feature value. This is the centroid value for this
Dan O'Mearadd494642020-05-01 07:42:23 -07001536 # feature.
Bu Sun Kim65020912020-05-20 12:08:20 -07001537 &quot;featureColumn&quot;: &quot;A String&quot;, # The feature column name.
1538 &quot;categoricalValue&quot;: { # Representative value of a categorical feature. # The categorical feature value.
1539 &quot;categoryCounts&quot;: [ # Counts of all categories for the categorical feature. If there are
Dan O'Mearadd494642020-05-01 07:42:23 -07001540 # more than ten categories, we return top ten (by count) and return
Bu Sun Kim65020912020-05-20 12:08:20 -07001541 # one more CategoryCount with category &quot;_OTHER_&quot; and count as
Dan O'Mearadd494642020-05-01 07:42:23 -07001542 # aggregate counts of remaining categories.
1543 { # Represents the count of a single category within the cluster.
Bu Sun Kim65020912020-05-20 12:08:20 -07001544 &quot;category&quot;: &quot;A String&quot;, # The name of category.
1545 &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 -07001546 # cluster.
1547 },
1548 ],
1549 },
1550 },
1551 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001552 &quot;centroidId&quot;: &quot;A String&quot;, # Centroid id.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001553 },
1554 ],
1555 },
1556 },
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;dropout&quot;: 3.14, # Dropout probability for dnn models.
1560 &quot;learnRate&quot;: 3.14, # Learning rate in training. Used only for iterative training algorithms.
1561 &quot;labelClassWeights&quot;: { # Weights associated with each label class, for rebalancing the
1562 # training data. Only applicable for classification models.
1563 &quot;a_key&quot;: 3.14,
1564 },
1565 &quot;subsample&quot;: 3.14, # Subsample fraction of the training data to grow tree to prevent
1566 # overfitting for boosted tree models.
1567 &quot;earlyStop&quot;: True or False, # Whether to stop early when the loss doesn&#x27;t improve significantly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001568 # any more (compared to min_relative_progress). Used only for iterative
1569 # training algorithms.
Bu Sun Kim65020912020-05-20 12:08:20 -07001570 &quot;dataSplitEvalFraction&quot;: 3.14, # The fraction of evaluation data over the whole input data. The rest
1571 # of data will be used as training data. The format should be double.
1572 # Accurate to two decimal places.
1573 # Default value is 0.2.
1574 &quot;initialLearnRate&quot;: 3.14, # Specifies the initial learning rate for the line search learn rate
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001575 # strategy.
Bu Sun Kim65020912020-05-20 12:08:20 -07001576 &quot;itemColumn&quot;: &quot;A String&quot;, # Item column specified for matrix factorization models.
1577 &quot;inputLabelColumns&quot;: [ # Name of input label columns in training data.
1578 &quot;A String&quot;,
1579 ],
1580 &quot;warmStart&quot;: True or False, # Whether to train a model from the last checkpoint.
1581 &quot;learnRateStrategy&quot;: &quot;A String&quot;, # The strategy to determine learn rate for the current iteration.
1582 &quot;numFactors&quot;: &quot;A String&quot;, # Num factors specified for matrix factorization models.
1583 &quot;lossType&quot;: &quot;A String&quot;, # Type of loss function used during training run.
1584 &quot;hiddenUnits&quot;: [ # Hidden units for dnn models.
1585 &quot;A String&quot;,
1586 ],
1587 &quot;kmeansInitializationMethod&quot;: &quot;A String&quot;, # The method used to initialize the centroids for kmeans algorithm.
1588 &quot;l1Regularization&quot;: 3.14, # L1 regularization coefficient.
1589 &quot;distanceType&quot;: &quot;A String&quot;, # Distance type for clustering models.
1590 &quot;walsAlpha&quot;: 3.14, # Hyperparameter for matrix factoration when implicit feedback type is
1591 # specified.
1592 &quot;feedbackType&quot;: &quot;A String&quot;, # Feedback type that specifies which algorithm to run for matrix
1593 # factorization.
1594 &quot;optimizationStrategy&quot;: &quot;A String&quot;, # Optimization strategy for training linear regression models.
1595 &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 -07001596 # feature.
1597 # 1. When data_split_method is CUSTOM, the corresponding column should
1598 # be boolean. The rows with true value tag are eval data, and the false
1599 # are training data.
1600 # 2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION
1601 # rows (from smallest to largest) in the corresponding column are used
1602 # as training data, and the rest are eval data. It respects the order
1603 # in Orderable data types:
1604 # https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
Bu Sun Kim65020912020-05-20 12:08:20 -07001605 &quot;maxIterations&quot;: &quot;A String&quot;, # The maximum number of iterations in training. Used only for iterative
1606 # training algorithms.
1607 &quot;userColumn&quot;: &quot;A String&quot;, # User column specified for matrix factorization models.
1608 &quot;maxTreeDepth&quot;: &quot;A String&quot;, # Maximum depth of a tree for boosted tree models.
1609 &quot;l2Regularization&quot;: 3.14, # L2 regularization coefficient.
1610 &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 -07001611 # applicable for imported models.
Bu Sun Kim65020912020-05-20 12:08:20 -07001612 &quot;batchSize&quot;: &quot;A String&quot;, # Batch size for dnn models.
1613 &quot;minRelativeProgress&quot;: 3.14, # When early_stop is true, stops training when accuracy improvement is
1614 # less than &#x27;min_relative_progress&#x27;. Used only for iterative training
1615 # algorithms.
1616 &quot;kmeansInitializationColumn&quot;: &quot;A String&quot;, # The column used to provide the initial centroids for kmeans algorithm
1617 # when kmeans_initialization_method is CUSTOM.
1618 &quot;numClusters&quot;: &quot;A String&quot;, # Number of clusters for clustering models.
1619 &quot;dataSplitMethod&quot;: &quot;A String&quot;, # The data split type for training and evaluation, e.g. RANDOM.
1620 &quot;minSplitLoss&quot;: 3.14, # Minimum split loss for boosted tree 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.
1626 &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.
1627 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1628 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
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.
1631 &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.
1632 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
1633 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
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.
1639 &quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this model.
1640 &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.
1641 &quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this model.
1642 },
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>