-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathmodel.proto
More file actions
2128 lines (1612 loc) · 69.2 KB
/
model.proto
File metadata and controls
2128 lines (1612 loc) · 69.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.bigquery.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/cloud/bigquery/v2/encryption_config.proto";
import "google/cloud/bigquery/v2/model_reference.proto";
import "google/cloud/bigquery/v2/standard_sql.proto";
import "google/cloud/bigquery/v2/table_reference.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option go_package = "cloud.google.com/go/bigquery/v2/apiv2/bigquerypb;bigquerypb";
option java_outer_classname = "ModelProto";
option java_package = "com.google.cloud.bigquery.v2";
// Model Service for BigQuery ML
service ModelService {
option (google.api.default_host) = "bigquery.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/bigquery,"
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/cloud-platform.read-only";
// Gets the specified model resource by model ID.
rpc GetModel(GetModelRequest) returns (Model) {
option (google.api.http) = {
get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}"
};
option (google.api.method_signature) = "project_id,dataset_id,model_id";
}
// Lists all models in the specified dataset. Requires the READER dataset
// role. After retrieving the list of models, you can get information about a
// particular model by calling the models.get method.
rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {
option (google.api.http) = {
get: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models"
};
option (google.api.method_signature) = "project_id,dataset_id,max_results";
}
// Patch specific fields in the specified model.
rpc PatchModel(PatchModelRequest) returns (Model) {
option (google.api.http) = {
patch: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}"
body: "model"
};
option (google.api.method_signature) =
"project_id,dataset_id,model_id,model";
}
// Deletes the model specified by modelId from the dataset.
rpc DeleteModel(DeleteModelRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/bigquery/v2/projects/{project_id=*}/datasets/{dataset_id=*}/models/{model_id=*}"
};
option (google.api.method_signature) = "project_id,dataset_id,model_id";
}
}
// Remote Model Info
message RemoteModelInfo {
// Supported service type for remote model.
enum RemoteServiceType {
// Unspecified remote service type.
REMOTE_SERVICE_TYPE_UNSPECIFIED = 0;
// V3 Cloud AI Translation API. See more details at [Cloud Translation API]
// (https://cloud.google.com/translate/docs/reference/rest).
CLOUD_AI_TRANSLATE_V3 = 1;
// V1 Cloud AI Vision API See more details at [Cloud Vision API]
// (https://cloud.google.com/vision/docs/reference/rest).
CLOUD_AI_VISION_V1 = 2;
// V1 Cloud AI Natural Language API. See more details at [REST Resource:
// documents](https://cloud.google.com/natural-language/docs/reference/rest/v1/documents).
CLOUD_AI_NATURAL_LANGUAGE_V1 = 3;
// V2 Speech-to-Text API. See more details at [Google Cloud Speech-to-Text
// V2 API](https://cloud.google.com/speech-to-text/v2/docs)
CLOUD_AI_SPEECH_TO_TEXT_V2 = 7;
}
// Remote services are services outside of BigQuery used by remote models for
// predictions. A remote service is backed by either an arbitrary endpoint or
// a selected remote service type, but not both.
oneof remote_service {
// Output only. The endpoint for remote model.
string endpoint = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The remote service type for remote model.
RemoteServiceType remote_service_type = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Output only. Fully qualified name of the user-provided connection object of
// the remote model. Format:
// ```"projects/{project_id}/locations/{location_id}/connections/{connection_id}"```
string connection = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Max number of rows in each batch sent to the remote service.
// If unset, the number of rows in each batch is set dynamically.
int64 max_batching_rows = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The model version for LLM.
string remote_model_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The name of the speech recognizer to use for speech
// recognition. The expected format is
// `projects/{project}/locations/{location}/recognizers/{recognizer}`.
// Customers can specify this field at model creation. If not specified, a
// default recognizer `projects/{model
// project}/locations/global/recognizers/_` will be used. See more details at
// [recognizers](https://cloud.google.com/speech-to-text/v2/docs/reference/rest/v2/projects.locations.recognizers)
string speech_recognizer = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Information about a single transform column.
message TransformColumn {
// Output only. Name of the column.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Data type of the column after the transform.
StandardSqlDataType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The SQL expression used in the column transform.
string transform_sql = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}
message Model {
// Indicates the type of the Model.
enum ModelType {
// Default value.
MODEL_TYPE_UNSPECIFIED = 0;
// Linear regression model.
LINEAR_REGRESSION = 1;
// Logistic regression based classification model.
LOGISTIC_REGRESSION = 2;
// K-means clustering model.
KMEANS = 3;
// Matrix factorization model.
MATRIX_FACTORIZATION = 4;
// DNN classifier model.
DNN_CLASSIFIER = 5;
// An imported TensorFlow model.
TENSORFLOW = 6;
// DNN regressor model.
DNN_REGRESSOR = 7;
// An imported XGBoost model.
XGBOOST = 8;
// Boosted tree regressor model.
BOOSTED_TREE_REGRESSOR = 9;
// Boosted tree classifier model.
BOOSTED_TREE_CLASSIFIER = 10;
// ARIMA model.
ARIMA = 11;
// AutoML Tables regression model.
AUTOML_REGRESSOR = 12;
// AutoML Tables classification model.
AUTOML_CLASSIFIER = 13;
// Prinpical Component Analysis model.
PCA = 14;
// Wide-and-deep classifier model.
DNN_LINEAR_COMBINED_CLASSIFIER = 16;
// Wide-and-deep regressor model.
DNN_LINEAR_COMBINED_REGRESSOR = 17;
// Autoencoder model.
AUTOENCODER = 18;
// New name for the ARIMA model.
ARIMA_PLUS = 19;
// ARIMA with external regressors.
ARIMA_PLUS_XREG = 23;
// Random forest regressor model.
RANDOM_FOREST_REGRESSOR = 24;
// Random forest classifier model.
RANDOM_FOREST_CLASSIFIER = 25;
// An imported TensorFlow Lite model.
TENSORFLOW_LITE = 26;
// An imported ONNX model.
ONNX = 28;
// Model to capture the columns and logic in the TRANSFORM clause along with
// statistics useful for ML analytic functions.
TRANSFORM_ONLY = 29;
// The contribution analysis model.
CONTRIBUTION_ANALYSIS = 37;
}
// Loss metric to evaluate model training performance.
enum LossType {
// Default value.
LOSS_TYPE_UNSPECIFIED = 0;
// Mean squared loss, used for linear regression.
MEAN_SQUARED_LOSS = 1;
// Mean log loss, used for logistic regression.
MEAN_LOG_LOSS = 2;
}
// Distance metric used to compute the distance between two points.
enum DistanceType {
// Default value.
DISTANCE_TYPE_UNSPECIFIED = 0;
// Eculidean distance.
EUCLIDEAN = 1;
// Cosine distance.
COSINE = 2;
}
// Indicates the method to split input data into multiple tables.
enum DataSplitMethod {
// Default value.
DATA_SPLIT_METHOD_UNSPECIFIED = 0;
// Splits data randomly.
RANDOM = 1;
// Splits data with the user provided tags.
CUSTOM = 2;
// Splits data sequentially.
SEQUENTIAL = 3;
// Data split will be skipped.
NO_SPLIT = 4;
// Splits data automatically: Uses NO_SPLIT if the data size is small.
// Otherwise uses RANDOM.
AUTO_SPLIT = 5;
}
// Type of supported data frequency for time series forecasting models.
enum DataFrequency {
// Default value.
DATA_FREQUENCY_UNSPECIFIED = 0;
// Automatically inferred from timestamps.
AUTO_FREQUENCY = 1;
// Yearly data.
YEARLY = 2;
// Quarterly data.
QUARTERLY = 3;
// Monthly data.
MONTHLY = 4;
// Weekly data.
WEEKLY = 5;
// Daily data.
DAILY = 6;
// Hourly data.
HOURLY = 7;
// Per-minute data.
PER_MINUTE = 8;
}
// Type of supported holiday regions for time series forecasting models.
enum HolidayRegion {
// Holiday region unspecified.
HOLIDAY_REGION_UNSPECIFIED = 0;
// Global.
GLOBAL = 1;
// North America.
NA = 2;
// Japan and Asia Pacific: Korea, Greater China, India, Australia, and New
// Zealand.
JAPAC = 3;
// Europe, the Middle East and Africa.
EMEA = 4;
// Latin America and the Caribbean.
LAC = 5;
// United Arab Emirates
AE = 6;
// Argentina
AR = 7;
// Austria
AT = 8;
// Australia
AU = 9;
// Belgium
BE = 10;
// Brazil
BR = 11;
// Canada
CA = 12;
// Switzerland
CH = 13;
// Chile
CL = 14;
// China
CN = 15;
// Colombia
CO = 16;
// Czechoslovakia
CS = 17;
// Czech Republic
CZ = 18;
// Germany
DE = 19;
// Denmark
DK = 20;
// Algeria
DZ = 21;
// Ecuador
EC = 22;
// Estonia
EE = 23;
// Egypt
EG = 24;
// Spain
ES = 25;
// Finland
FI = 26;
// France
FR = 27;
// Great Britain (United Kingdom)
GB = 28;
// Greece
GR = 29;
// Hong Kong
HK = 30;
// Hungary
HU = 31;
// Indonesia
ID = 32;
// Ireland
IE = 33;
// Israel
IL = 34;
// India
IN = 35;
// Iran
IR = 36;
// Italy
IT = 37;
// Japan
JP = 38;
// Korea (South)
KR = 39;
// Latvia
LV = 40;
// Morocco
MA = 41;
// Mexico
MX = 42;
// Malaysia
MY = 43;
// Nigeria
NG = 44;
// Netherlands
NL = 45;
// Norway
NO = 46;
// New Zealand
NZ = 47;
// Peru
PE = 48;
// Philippines
PH = 49;
// Pakistan
PK = 50;
// Poland
PL = 51;
// Portugal
PT = 52;
// Romania
RO = 53;
// Serbia
RS = 54;
// Russian Federation
RU = 55;
// Saudi Arabia
SA = 56;
// Sweden
SE = 57;
// Singapore
SG = 58;
// Slovenia
SI = 59;
// Slovakia
SK = 60;
// Thailand
TH = 61;
// Turkey
TR = 62;
// Taiwan
TW = 63;
// Ukraine
UA = 64;
// United States
US = 65;
// Venezuela
VE = 66;
// Vietnam
VN = 67;
// South Africa
ZA = 68;
}
// Enums for seasonal period.
message SeasonalPeriod {
// Seasonal period type.
enum SeasonalPeriodType {
// Unspecified seasonal period.
SEASONAL_PERIOD_TYPE_UNSPECIFIED = 0;
// No seasonality
NO_SEASONALITY = 1;
// Daily period, 24 hours.
DAILY = 2;
// Weekly period, 7 days.
WEEKLY = 3;
// Monthly period, 30 days or irregular.
MONTHLY = 4;
// Quarterly period, 90 days or irregular.
QUARTERLY = 5;
// Yearly period, 365 days or irregular.
YEARLY = 6;
// Hourly period, 1 hour.
HOURLY = 7;
}
}
// Enums for color space, used for processing images in Object Table.
// See more details at
// https://www.tensorflow.org/io/tutorials/colorspace.
enum ColorSpace {
// Unspecified color space
COLOR_SPACE_UNSPECIFIED = 0;
// RGB
RGB = 1;
// HSV
HSV = 2;
// YIQ
YIQ = 3;
// YUV
YUV = 4;
// GRAYSCALE
GRAYSCALE = 5;
}
// Enums for kmeans model type.
message KmeansEnums {
// Indicates the method used to initialize the centroids for KMeans
// clustering algorithm.
enum KmeansInitializationMethod {
// Unspecified initialization method.
KMEANS_INITIALIZATION_METHOD_UNSPECIFIED = 0;
// Initializes the centroids randomly.
RANDOM = 1;
// Initializes the centroids using data specified in
// kmeans_initialization_column.
CUSTOM = 2;
// Initializes with kmeans++.
KMEANS_PLUS_PLUS = 3;
}
}
// Enums for XGBoost model type.
message BoostedTreeOptionEnums {
// Booster types supported. Refer to booster parameter in XGBoost.
enum BoosterType {
// Unspecified booster type.
BOOSTER_TYPE_UNSPECIFIED = 0;
// Gbtree booster.
GBTREE = 1;
// Dart booster.
DART = 2;
}
// Type of normalization algorithm for boosted tree models using dart
// booster. Refer to normalize_type in XGBoost.
enum DartNormalizeType {
// Unspecified dart normalize type.
DART_NORMALIZE_TYPE_UNSPECIFIED = 0;
// New trees have the same weight of each of dropped trees.
TREE = 1;
// New trees have the same weight of sum of dropped trees.
FOREST = 2;
}
// Tree construction algorithm used in boosted tree models.
// Refer to tree_method in XGBoost.
enum TreeMethod {
// Unspecified tree method.
TREE_METHOD_UNSPECIFIED = 0;
// Use heuristic to choose the fastest method.
AUTO = 1;
// Exact greedy algorithm.
EXACT = 2;
// Approximate greedy algorithm using quantile sketch and gradient
// histogram.
APPROX = 3;
// Fast histogram optimized approximate greedy algorithm.
HIST = 4;
}
}
// Enums for hyperparameter tuning.
message HparamTuningEnums {
// Available evaluation metrics used as hyperparameter tuning objectives.
enum HparamTuningObjective {
// Unspecified evaluation metric.
HPARAM_TUNING_OBJECTIVE_UNSPECIFIED = 0;
// Mean absolute error.
// mean_absolute_error = AVG(ABS(label - predicted))
MEAN_ABSOLUTE_ERROR = 1;
// Mean squared error.
// mean_squared_error = AVG(POW(label - predicted, 2))
MEAN_SQUARED_ERROR = 2;
// Mean squared log error.
// mean_squared_log_error = AVG(POW(LN(1 + label) - LN(1 + predicted), 2))
MEAN_SQUARED_LOG_ERROR = 3;
// Mean absolute error.
// median_absolute_error = APPROX_QUANTILES(absolute_error, 2)[OFFSET(1)]
MEDIAN_ABSOLUTE_ERROR = 4;
// R^2 score. This corresponds to r2_score in ML.EVALUATE.
// r_squared = 1 - SUM(squared_error)/(COUNT(label)*VAR_POP(label))
R_SQUARED = 5;
// Explained variance.
// explained_variance = 1 - VAR_POP(label_error)/VAR_POP(label)
EXPLAINED_VARIANCE = 6;
// Precision is the fraction of actual positive predictions that had
// positive actual labels. For multiclass this is a macro-averaged metric
// treating each class as a binary classifier.
PRECISION = 7;
// Recall is the fraction of actual positive labels that were given a
// positive prediction. For multiclass this is a macro-averaged metric.
RECALL = 8;
// Accuracy is the fraction of predictions given the correct label. For
// multiclass this is a globally micro-averaged metric.
ACCURACY = 9;
// The F1 score is an average of recall and precision. For multiclass this
// is a macro-averaged metric.
F1_SCORE = 10;
// Logarithmic Loss. For multiclass this is a macro-averaged metric.
LOG_LOSS = 11;
// Area Under an ROC Curve. For multiclass this is a macro-averaged
// metric.
ROC_AUC = 12;
// Davies-Bouldin Index.
DAVIES_BOULDIN_INDEX = 13;
// Mean Average Precision.
MEAN_AVERAGE_PRECISION = 14;
// Normalized Discounted Cumulative Gain.
NORMALIZED_DISCOUNTED_CUMULATIVE_GAIN = 15;
// Average Rank.
AVERAGE_RANK = 16;
}
}
// Indicates the learning rate optimization strategy to use.
enum LearnRateStrategy {
// Default value.
LEARN_RATE_STRATEGY_UNSPECIFIED = 0;
// Use line search to determine learning rate.
LINE_SEARCH = 1;
// Use a constant learning rate.
CONSTANT = 2;
}
// Indicates the optimization strategy used for training.
enum OptimizationStrategy {
// Default value.
OPTIMIZATION_STRATEGY_UNSPECIFIED = 0;
// Uses an iterative batch gradient descent algorithm.
BATCH_GRADIENT_DESCENT = 1;
// Uses a normal equation to solve linear regression problem.
NORMAL_EQUATION = 2;
}
// Indicates the training algorithm to use for matrix factorization models.
enum FeedbackType {
// Default value.
FEEDBACK_TYPE_UNSPECIFIED = 0;
// Use weighted-als for implicit feedback problems.
IMPLICIT = 1;
// Use nonweighted-als for explicit feedback problems.
EXPLICIT = 2;
}
// Evaluation metrics for regression and explicit feedback type matrix
// factorization models.
message RegressionMetrics {
// Mean absolute error.
google.protobuf.DoubleValue mean_absolute_error = 1;
// Mean squared error.
google.protobuf.DoubleValue mean_squared_error = 2;
// Mean squared log error.
google.protobuf.DoubleValue mean_squared_log_error = 3;
// Median absolute error.
google.protobuf.DoubleValue median_absolute_error = 4;
// R^2 score. This corresponds to r2_score in ML.EVALUATE.
google.protobuf.DoubleValue r_squared = 5;
}
// Aggregate metrics for classification/classifier models. For multi-class
// models, the metrics are either macro-averaged or micro-averaged. When
// macro-averaged, the metrics are calculated for each label and then an
// unweighted average is taken of those values. When micro-averaged, the
// metric is calculated globally by counting the total number of correctly
// predicted rows.
message AggregateClassificationMetrics {
// Precision is the fraction of actual positive predictions that had
// positive actual labels. For multiclass this is a macro-averaged
// metric treating each class as a binary classifier.
google.protobuf.DoubleValue precision = 1;
// Recall is the fraction of actual positive labels that were given a
// positive prediction. For multiclass this is a macro-averaged metric.
google.protobuf.DoubleValue recall = 2;
// Accuracy is the fraction of predictions given the correct label. For
// multiclass this is a micro-averaged metric.
google.protobuf.DoubleValue accuracy = 3;
// Threshold at which the metrics are computed. For binary
// classification models this is the positive class threshold.
// For multi-class classification models this is the confidence
// threshold.
google.protobuf.DoubleValue threshold = 4;
// The F1 score is an average of recall and precision. For multiclass
// this is a macro-averaged metric.
google.protobuf.DoubleValue f1_score = 5;
// Logarithmic Loss. For multiclass this is a macro-averaged metric.
google.protobuf.DoubleValue log_loss = 6;
// Area Under a ROC Curve. For multiclass this is a macro-averaged
// metric.
google.protobuf.DoubleValue roc_auc = 7;
}
// Evaluation metrics for binary classification/classifier models.
message BinaryClassificationMetrics {
// Confusion matrix for binary classification models.
message BinaryConfusionMatrix {
// Threshold value used when computing each of the following metric.
google.protobuf.DoubleValue positive_class_threshold = 1;
// Number of true samples predicted as true.
google.protobuf.Int64Value true_positives = 2;
// Number of false samples predicted as true.
google.protobuf.Int64Value false_positives = 3;
// Number of true samples predicted as false.
google.protobuf.Int64Value true_negatives = 4;
// Number of false samples predicted as false.
google.protobuf.Int64Value false_negatives = 5;
// The fraction of actual positive predictions that had positive actual
// labels.
google.protobuf.DoubleValue precision = 6;
// The fraction of actual positive labels that were given a positive
// prediction.
google.protobuf.DoubleValue recall = 7;
// The equally weighted average of recall and precision.
google.protobuf.DoubleValue f1_score = 8;
// The fraction of predictions given the correct label.
google.protobuf.DoubleValue accuracy = 9;
}
// Aggregate classification metrics.
AggregateClassificationMetrics aggregate_classification_metrics = 1;
// Binary confusion matrix at multiple thresholds.
repeated BinaryConfusionMatrix binary_confusion_matrix_list = 2;
// Label representing the positive class.
string positive_label = 3;
// Label representing the negative class.
string negative_label = 4;
}
// Evaluation metrics for multi-class classification/classifier models.
message MultiClassClassificationMetrics {
// Confusion matrix for multi-class classification models.
message ConfusionMatrix {
// A single entry in the confusion matrix.
message Entry {
// The predicted label. For confidence_threshold > 0, we will
// also add an entry indicating the number of items under the
// confidence threshold.
string predicted_label = 1;
// Number of items being predicted as this label.
google.protobuf.Int64Value item_count = 2;
}
// A single row in the confusion matrix.
message Row {
// The original label of this row.
string actual_label = 1;
// Info describing predicted label distribution.
repeated Entry entries = 2;
}
// Confidence threshold used when computing the entries of the
// confusion matrix.
google.protobuf.DoubleValue confidence_threshold = 1;
// One row per actual label.
repeated Row rows = 2;
}
// Aggregate classification metrics.
AggregateClassificationMetrics aggregate_classification_metrics = 1;
// Confusion matrix at different thresholds.
repeated ConfusionMatrix confusion_matrix_list = 2;
}
// Evaluation metrics for clustering models.
message ClusteringMetrics {
// Message containing the information about one cluster.
message Cluster {
// Representative value of a single feature within the cluster.
message FeatureValue {
// Representative value of a categorical feature.
message CategoricalValue {
// Represents the count of a single category within the cluster.
message CategoryCount {
// The name of category.
string category = 1;
// The count of training samples matching the category within the
// cluster.
google.protobuf.Int64Value count = 2;
}
// Counts of all categories for the categorical feature. If there are
// more than ten categories, we return top ten (by count) and return
// one more CategoryCount with category "_OTHER_" and count as
// aggregate counts of remaining categories.
repeated CategoryCount category_counts = 1;
}
// The feature column name.
string feature_column = 1;
// Value.
oneof value {
// The numerical feature value. This is the centroid value for this
// feature.
google.protobuf.DoubleValue numerical_value = 2;
// The categorical feature value.
CategoricalValue categorical_value = 3;
}
}
// Centroid id.
int64 centroid_id = 1;
// Values of highly variant features for this cluster.
repeated FeatureValue feature_values = 2;
// Count of training data rows that were assigned to this cluster.
google.protobuf.Int64Value count = 3;
}
// Davies-Bouldin index.
google.protobuf.DoubleValue davies_bouldin_index = 1;
// Mean of squared distances between each sample to its cluster centroid.
google.protobuf.DoubleValue mean_squared_distance = 2;
// Information for all clusters.
repeated Cluster clusters = 3;
}
// Evaluation metrics used by weighted-ALS models specified by
// feedback_type=implicit.
message RankingMetrics {
// Calculates a precision per user for all the items by ranking them and
// then averages all the precisions across all the users.
google.protobuf.DoubleValue mean_average_precision = 1;
// Similar to the mean squared error computed in regression and explicit
// recommendation models except instead of computing the rating directly,
// the output from evaluate is computed against a preference which is 1 or 0
// depending on if the rating exists or not.
google.protobuf.DoubleValue mean_squared_error = 2;
// A metric to determine the goodness of a ranking calculated from the
// predicted confidence by comparing it to an ideal rank measured by the
// original ratings.
google.protobuf.DoubleValue normalized_discounted_cumulative_gain = 3;
// Determines the goodness of a ranking by computing the percentile rank
// from the predicted confidence and dividing it by the original rank.
google.protobuf.DoubleValue average_rank = 4;
}
// Model evaluation metrics for ARIMA forecasting models.
message ArimaForecastingMetrics {
// Model evaluation metrics for a single ARIMA forecasting model.
message ArimaSingleModelForecastingMetrics {
// Non-seasonal order.
ArimaOrder non_seasonal_order = 1;
// Arima fitting metrics.
ArimaFittingMetrics arima_fitting_metrics = 2;
// Is arima model fitted with drift or not. It is always false when d
// is not 1.
google.protobuf.BoolValue has_drift = 3;
// The time_series_id value for this time series. It will be one of
// the unique values from the time_series_id_column specified during
// ARIMA model training. Only present when time_series_id_column
// training option was used.
string time_series_id = 4;
// The tuple of time_series_ids identifying this time series. It will
// be one of the unique tuples of values present in the
// time_series_id_columns specified during ARIMA model training. Only
// present when time_series_id_columns training option was used and
// the order of values here are same as the order of
// time_series_id_columns.
repeated string time_series_ids = 9;
// Seasonal periods. Repeated because multiple periods are supported
// for one time series.