From 40069fa85a88e040a7315e638ed6227e9e69636f Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Sat, 15 Jun 2019 05:11:48 -0700 Subject: [PATCH] [CHANGE ME] Re-generated bigquery to pick up changes in the API or client library generator. --- .../google/cloud/bigquery_v2/gapic/enums.py | 18 +- .../cloud/bigquery_v2/proto/model.proto | 98 +++-- .../cloud/bigquery_v2/proto/model_pb2.py | 351 +++++++++++++----- .../bigquery_v2/proto/model_reference.proto | 1 - .../bigquery_v2/proto/model_reference_pb2.py | 1 + .../bigquery_v2/proto/standard_sql.proto | 1 - .../bigquery_v2/proto/standard_sql_pb2.py | 1 + bigquery/synth.metadata | 10 +- 8 files changed, 359 insertions(+), 122 deletions(-) diff --git a/bigquery/google/cloud/bigquery_v2/gapic/enums.py b/bigquery/google/cloud/bigquery_v2/gapic/enums.py index ba6c0c721266..e1ce20f9a130 100644 --- a/bigquery/google/cloud/bigquery_v2/gapic/enums.py +++ b/bigquery/google/cloud/bigquery_v2/gapic/enums.py @@ -90,14 +90,30 @@ class ModelType(enum.IntEnum): Attributes: MODEL_TYPE_UNSPECIFIED (int) LINEAR_REGRESSION (int): Linear regression model. - LOGISTIC_REGRESSION (int): Logistic regression model. + LOGISTIC_REGRESSION (int): Logistic regression based classification model. KMEANS (int): [Beta] K-means clustering model. + TENSORFLOW (int): [Beta] An imported TensorFlow model. """ MODEL_TYPE_UNSPECIFIED = 0 LINEAR_REGRESSION = 1 LOGISTIC_REGRESSION = 2 KMEANS = 3 + TENSORFLOW = 6 + + class OptimizationStrategy(enum.IntEnum): + """ + Indicates the optimization strategy used for training. + + Attributes: + OPTIMIZATION_STRATEGY_UNSPECIFIED (int) + BATCH_GRADIENT_DESCENT (int): Uses an iterative batch gradient descent algorithm. + NORMAL_EQUATION (int): Uses a normal equation to solve linear regression problem. + """ + + OPTIMIZATION_STRATEGY_UNSPECIFIED = 0 + BATCH_GRADIENT_DESCENT = 1 + NORMAL_EQUATION = 2 class StandardSqlDataType(object): diff --git a/bigquery/google/cloud/bigquery_v2/proto/model.proto b/bigquery/google/cloud/bigquery_v2/proto/model.proto index b94cb3f5efd5..2b5b6894db5b 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/model.proto +++ b/bigquery/google/cloud/bigquery_v2/proto/model.proto @@ -23,13 +23,19 @@ import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; import "google/api/annotations.proto"; +import "google/api/client.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery"; option java_outer_classname = "ModelProto"; option java_package = "com.google.cloud.bigquery.v2"; - 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) { } @@ -67,11 +73,12 @@ message Model { google.protobuf.DoubleValue r_squared = 5; } - // Aggregate metrics for classification models. For multi-class models, - // the metrics are either macro-averaged: metrics are calculated for each - // label and then an unweighted average is taken of those values or - // micro-averaged: the metric is calculated globally by counting the total - // number of correctly predicted rows. + // 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 @@ -104,7 +111,7 @@ message Model { google.protobuf.DoubleValue roc_auc = 7; } - // Evaluation metrics for binary classification models. + // Evaluation metrics for binary classification/classifier models. message BinaryClassificationMetrics { // Confusion matrix for binary classification models. message BinaryConfusionMatrix { @@ -123,11 +130,19 @@ message Model { // Number of false samples predicted as false. google.protobuf.Int64Value false_negatives = 5; - // Aggregate precision. + // The fraction of actual positive predictions that had positive actual + // labels. google.protobuf.DoubleValue precision = 6; - // Aggregate recall. + // 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. @@ -135,9 +150,15 @@ message Model { // 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 models. + // Evaluation metrics for multi-class classification/classifier models. message MultiClassClassificationMetrics { // Confusion matrix for multi-class classification models. message ConfusionMatrix { @@ -185,18 +206,18 @@ message Model { google.protobuf.DoubleValue mean_squared_distance = 2; } - // Evaluation metrics of a model. These are either computed on all - // training data or just the eval data based on whether eval data was used - // during training. + // Evaluation metrics of a model. These are either computed on all training + // data or just the eval data based on whether eval data was used during + // training. These are not present for imported models. message EvaluationMetrics { oneof metrics { // Populated for regression models. RegressionMetrics regression_metrics = 1; - // Populated for binary classification models. + // Populated for binary classification/classifier models. BinaryClassificationMetrics binary_classification_metrics = 2; - // Populated for multi-class classification models. + // Populated for multi-class classification/classifier models. MultiClassClassificationMetrics multi_class_classification_metrics = 3; // [Beta] Populated for clustering models. @@ -207,13 +228,14 @@ message Model { // Information about a single training query run for the model. message TrainingRun { message TrainingOptions { - // The maximum number of iterations in training. + // The maximum number of iterations in training. Used only for iterative + // training algorithms. int64 max_iterations = 1; // Type of loss function used during training run. LossType loss_type = 2; - // Learning rate in training. + // Learning rate in training. Used only for iterative training algorithms. double learn_rate = 3; // L1 regularization coefficient. @@ -223,14 +245,16 @@ message Model { google.protobuf.DoubleValue l2_regularization = 5; // When early_stop is true, stops training when accuracy improvement is - // less than 'min_relative_progress'. + // less than 'min_relative_progress'. Used only for iterative training + // algorithms. google.protobuf.DoubleValue min_relative_progress = 6; // Whether to train a model from the last checkpoint. google.protobuf.BoolValue warm_start = 7; // Whether to stop early when the loss doesn't improve significantly - // any more (compared to min_relative_progress). + // any more (compared to min_relative_progress). Used only for iterative + // training algorithms. google.protobuf.BoolValue early_stop = 8; // Name of input label columns in training data. @@ -257,14 +281,15 @@ message Model { // https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties string data_split_column = 12; - // The strategy to determine learning rate. + // The strategy to determine learn rate for the current iteration. LearnRateStrategy learn_rate_strategy = 13; - // Specifies the initial learning rate for line search to start at. + // Specifies the initial learning rate for the line search learn rate + // strategy. double initial_learn_rate = 16; // Weights associated with each label class, for rebalancing the - // training data. + // training data. Only applicable for classification models. map label_class_weights = 17; // [Beta] Distance type for clustering models. @@ -272,6 +297,13 @@ message Model { // [Beta] Number of clusters for clustering models. int64 num_clusters = 21; + + // [Beta] Google Cloud Storage URI from which the model was imported. Only + // applicable for imported models. + string model_uri = 22; + + // Optimization strategy for training linear regression models. + OptimizationStrategy optimization_strategy = 23; } // Information about a single iteration of the training run. @@ -330,11 +362,14 @@ message Model { // Linear regression model. LINEAR_REGRESSION = 1; - // Logistic regression model. + // Logistic regression based classification model. LOGISTIC_REGRESSION = 2; // [Beta] K-means clustering model. KMEANS = 3; + + // [Beta] An imported TensorFlow model. + TENSORFLOW = 6; } // Loss metric to evaluate model training performance. @@ -391,6 +426,17 @@ message Model { CONSTANT = 2; } + // Indicates the optimization strategy used for training. + enum OptimizationStrategy { + 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; + } + // Output only. A hash of this resource. string etag = 1; @@ -406,11 +452,9 @@ message Model { int64 last_modified_time = 6; // [Optional] A user-friendly description of this model. - // @mutable bigquery.models.patch string description = 12; // [Optional] A descriptive name for this model. - // @mutable bigquery.models.patch string friendly_name = 14; // [Optional] The labels associated with this model. You can use these to @@ -419,7 +463,6 @@ message Model { // characters, underscores and dashes. International characters are allowed. // Label values are optional. Label keys must start with a letter and each // label in the list must have a different key. - // @mutable bigquery.models.patch map labels = 15; // [Optional] The time when this model expires, in milliseconds since the @@ -427,7 +470,6 @@ message Model { // will be deleted and their storage reclaimed. The defaultTableExpirationMs // property of the encapsulating dataset can be used to set a default // expirationTime on newly created models. - // @mutable bigquery.models.patch int64 expiration_time = 16; // Output only. The geographic location where the model resides. This value @@ -445,7 +487,7 @@ message Model { repeated StandardSqlField feature_columns = 10; // Output only. Label columns that were used to train this model. - // The output of the model will have a “predicted_” prefix to these columns. + // The output of the model will have a "predicted_" prefix to these columns. repeated StandardSqlField label_columns = 11; } diff --git a/bigquery/google/cloud/bigquery_v2/proto/model_pb2.py b/bigquery/google/cloud/bigquery_v2/proto/model_pb2.py index afa3d8cf640d..ed82d8e4e8fd 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/model_pb2.py +++ b/bigquery/google/cloud/bigquery_v2/proto/model_pb2.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/bigquery_v2/proto/model.proto @@ -24,6 +25,7 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -34,7 +36,7 @@ "\n\034com.google.cloud.bigquery.v2B\nModelProtoZ@google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery" ), serialized_pb=_b( - '\n*google/cloud/bigquery_v2/proto/model.proto\x12\x18google.cloud.bigquery.v2\x1a\x34google/cloud/bigquery_v2/proto/model_reference.proto\x1a\x31google/cloud/bigquery_v2/proto/standard_sql.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/api/annotations.proto"\xcc)\n\x05Model\x12\x0c\n\x04\x65tag\x18\x01 \x01(\t\x12\x41\n\x0fmodel_reference\x18\x02 \x01(\x0b\x32(.google.cloud.bigquery.v2.ModelReference\x12\x15\n\rcreation_time\x18\x05 \x01(\x03\x12\x1a\n\x12last_modified_time\x18\x06 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x0c \x01(\t\x12\x15\n\rfriendly_name\x18\x0e \x01(\t\x12;\n\x06labels\x18\x0f \x03(\x0b\x32+.google.cloud.bigquery.v2.Model.LabelsEntry\x12\x17\n\x0f\x65xpiration_time\x18\x10 \x01(\x03\x12\x10\n\x08location\x18\r \x01(\t\x12=\n\nmodel_type\x18\x07 \x01(\x0e\x32).google.cloud.bigquery.v2.Model.ModelType\x12\x42\n\rtraining_runs\x18\t \x03(\x0b\x32+.google.cloud.bigquery.v2.Model.TrainingRun\x12\x43\n\x0f\x66\x65\x61ture_columns\x18\n \x03(\x0b\x32*.google.cloud.bigquery.v2.StandardSqlField\x12\x41\n\rlabel_columns\x18\x0b \x03(\x0b\x32*.google.cloud.bigquery.v2.StandardSqlField\x1a\xb4\x02\n\x11RegressionMetrics\x12\x39\n\x13mean_absolute_error\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x38\n\x12mean_squared_error\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12<\n\x16mean_squared_log_error\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15median_absolute_error\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\tr_squared\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\xef\x02\n\x1e\x41ggregateClassificationMetrics\x12/\n\tprecision\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12,\n\x06recall\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x61\x63\x63uracy\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\tthreshold\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x66\x31_score\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08log_loss\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12-\n\x07roc_auc\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x8f\x05\n\x1b\x42inaryClassificationMetrics\x12h\n aggregate_classification_metrics\x18\x01 \x01(\x0b\x32>.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics\x12w\n\x1c\x62inary_confusion_matrix_list\x18\x02 \x03(\x0b\x32Q.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix\x1a\x8c\x03\n\x15\x42inaryConfusionMatrix\x12>\n\x18positive_class_threshold\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x33\n\x0etrue_positives\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x34\n\x0f\x66\x61lse_positives\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x33\n\x0etrue_negatives\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x34\n\x0f\x66\x61lse_negatives\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12/\n\tprecision\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12,\n\x06recall\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x87\x05\n\x1fMultiClassClassificationMetrics\x12h\n aggregate_classification_metrics\x18\x01 \x01(\x0b\x32>.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics\x12n\n\x15\x63onfusion_matrix_list\x18\x02 \x03(\x0b\x32O.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix\x1a\x89\x03\n\x0f\x43onfusionMatrix\x12:\n\x14\x63onfidence_threshold\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x61\n\x04rows\x18\x02 \x03(\x0b\x32S.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row\x1aQ\n\x05\x45ntry\x12\x17\n\x0fpredicted_label\x18\x01 \x01(\t\x12/\n\nitem_count\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x1a\x83\x01\n\x03Row\x12\x14\n\x0c\x61\x63tual_label\x18\x01 \x01(\t\x12\x66\n\x07\x65ntries\x18\x02 \x03(\x0b\x32U.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry\x1a\x8c\x01\n\x11\x43lusteringMetrics\x12:\n\x14\x64\x61vies_bouldin_index\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15mean_squared_distance\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x95\x03\n\x11\x45valuationMetrics\x12O\n\x12regression_metrics\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.RegressionMetricsH\x00\x12\x64\n\x1d\x62inary_classification_metrics\x18\x02 \x01(\x0b\x32;.google.cloud.bigquery.v2.Model.BinaryClassificationMetricsH\x00\x12m\n"multi_class_classification_metrics\x18\x03 \x01(\x0b\x32?.google.cloud.bigquery.v2.Model.MultiClassClassificationMetricsH\x00\x12O\n\x12\x63lustering_metrics\x18\x04 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.ClusteringMetricsH\x00\x42\t\n\x07metrics\x1a\xaf\r\n\x0bTrainingRun\x12U\n\x10training_options\x18\x01 \x01(\x0b\x32;.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions\x12.\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12L\n\x07results\x18\x06 \x03(\x0b\x32;.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult\x12M\n\x12\x65valuation_metrics\x18\x07 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.EvaluationMetrics\x1a\xa1\x07\n\x0fTrainingOptions\x12\x16\n\x0emax_iterations\x18\x01 \x01(\x03\x12;\n\tloss_type\x18\x02 \x01(\x0e\x32(.google.cloud.bigquery.v2.Model.LossType\x12\x12\n\nlearn_rate\x18\x03 \x01(\x01\x12\x37\n\x11l1_regularization\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x37\n\x11l2_regularization\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15min_relative_progress\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\nwarm_start\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12.\n\nearly_stop\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x1b\n\x13input_label_columns\x18\t \x03(\t\x12J\n\x11\x64\x61ta_split_method\x18\n \x01(\x0e\x32/.google.cloud.bigquery.v2.Model.DataSplitMethod\x12 \n\x18\x64\x61ta_split_eval_fraction\x18\x0b \x01(\x01\x12\x19\n\x11\x64\x61ta_split_column\x18\x0c \x01(\t\x12N\n\x13learn_rate_strategy\x18\r \x01(\x0e\x32\x31.google.cloud.bigquery.v2.Model.LearnRateStrategy\x12\x1a\n\x12initial_learn_rate\x18\x10 \x01(\x01\x12o\n\x13label_class_weights\x18\x11 \x03(\x0b\x32R.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.LabelClassWeightsEntry\x12\x43\n\rdistance_type\x18\x14 \x01(\x0e\x32,.google.cloud.bigquery.v2.Model.DistanceType\x12\x14\n\x0cnum_clusters\x18\x15 \x01(\x03\x1a\x38\n\x16LabelClassWeightsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\xd7\x03\n\x0fIterationResult\x12*\n\x05index\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x30\n\x0b\x64uration_ms\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x33\n\rtraining_loss\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\teval_loss\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x12\n\nlearn_rate\x18\x07 \x01(\x01\x12^\n\rcluster_infos\x18\x08 \x03(\x0b\x32G.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo\x1a\x8b\x01\n\x0b\x43lusterInfo\x12\x13\n\x0b\x63\x65ntroid_id\x18\x01 \x01(\x03\x12\x34\n\x0e\x63luster_radius\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x31\n\x0c\x63luster_size\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"c\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11LINEAR_REGRESSION\x10\x01\x12\x17\n\x13LOGISTIC_REGRESSION\x10\x02\x12\n\n\x06KMEANS\x10\x03"O\n\x08LossType\x12\x19\n\x15LOSS_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11MEAN_SQUARED_LOSS\x10\x01\x12\x11\n\rMEAN_LOG_LOSS\x10\x02"H\n\x0c\x44istanceType\x12\x1d\n\x19\x44ISTANCE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tEUCLIDEAN\x10\x01\x12\n\n\x06\x43OSINE\x10\x02"z\n\x0f\x44\x61taSplitMethod\x12!\n\x1d\x44\x41TA_SPLIT_METHOD_UNSPECIFIED\x10\x00\x12\n\n\x06RANDOM\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\x0e\n\nSEQUENTIAL\x10\x03\x12\x0c\n\x08NO_SPLIT\x10\x04\x12\x0e\n\nAUTO_SPLIT\x10\x05"W\n\x11LearnRateStrategy\x12#\n\x1fLEARN_RATE_STRATEGY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLINE_SEARCH\x10\x01\x12\x0c\n\x08\x43ONSTANT\x10\x02"K\n\x0fGetModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t"}\n\x11PatchModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12.\n\x05model\x18\x04 \x01(\x0b\x32\x1f.google.cloud.bigquery.v2.Model"N\n\x12\x44\x65leteModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t"\x82\x01\n\x11ListModelsRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x31\n\x0bmax_results\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x12\n\npage_token\x18\x04 \x01(\t"^\n\x12ListModelsResponse\x12/\n\x06models\x18\x01 \x03(\x0b\x32\x1f.google.cloud.bigquery.v2.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x88\x03\n\x0cModelService\x12X\n\x08GetModel\x12).google.cloud.bigquery.v2.GetModelRequest\x1a\x1f.google.cloud.bigquery.v2.Model"\x00\x12i\n\nListModels\x12+.google.cloud.bigquery.v2.ListModelsRequest\x1a,.google.cloud.bigquery.v2.ListModelsResponse"\x00\x12\\\n\nPatchModel\x12+.google.cloud.bigquery.v2.PatchModelRequest\x1a\x1f.google.cloud.bigquery.v2.Model"\x00\x12U\n\x0b\x44\x65leteModel\x12,.google.cloud.bigquery.v2.DeleteModelRequest\x1a\x16.google.protobuf.Empty"\x00\x42l\n\x1c\x63om.google.cloud.bigquery.v2B\nModelProtoZ@google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigqueryb\x06proto3' + '\n*google/cloud/bigquery_v2/proto/model.proto\x12\x18google.cloud.bigquery.v2\x1a\x34google/cloud/bigquery_v2/proto/model_reference.proto\x1a\x31google/cloud/bigquery_v2/proto/standard_sql.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto"\xc4,\n\x05Model\x12\x0c\n\x04\x65tag\x18\x01 \x01(\t\x12\x41\n\x0fmodel_reference\x18\x02 \x01(\x0b\x32(.google.cloud.bigquery.v2.ModelReference\x12\x15\n\rcreation_time\x18\x05 \x01(\x03\x12\x1a\n\x12last_modified_time\x18\x06 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x0c \x01(\t\x12\x15\n\rfriendly_name\x18\x0e \x01(\t\x12;\n\x06labels\x18\x0f \x03(\x0b\x32+.google.cloud.bigquery.v2.Model.LabelsEntry\x12\x17\n\x0f\x65xpiration_time\x18\x10 \x01(\x03\x12\x10\n\x08location\x18\r \x01(\t\x12=\n\nmodel_type\x18\x07 \x01(\x0e\x32).google.cloud.bigquery.v2.Model.ModelType\x12\x42\n\rtraining_runs\x18\t \x03(\x0b\x32+.google.cloud.bigquery.v2.Model.TrainingRun\x12\x43\n\x0f\x66\x65\x61ture_columns\x18\n \x03(\x0b\x32*.google.cloud.bigquery.v2.StandardSqlField\x12\x41\n\rlabel_columns\x18\x0b \x03(\x0b\x32*.google.cloud.bigquery.v2.StandardSqlField\x1a\xb4\x02\n\x11RegressionMetrics\x12\x39\n\x13mean_absolute_error\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x38\n\x12mean_squared_error\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12<\n\x16mean_squared_log_error\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15median_absolute_error\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\tr_squared\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\xef\x02\n\x1e\x41ggregateClassificationMetrics\x12/\n\tprecision\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12,\n\x06recall\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x61\x63\x63uracy\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\tthreshold\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x66\x31_score\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08log_loss\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12-\n\x07roc_auc\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x9f\x06\n\x1b\x42inaryClassificationMetrics\x12h\n aggregate_classification_metrics\x18\x01 \x01(\x0b\x32>.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics\x12w\n\x1c\x62inary_confusion_matrix_list\x18\x02 \x03(\x0b\x32Q.google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix\x12\x16\n\x0epositive_label\x18\x03 \x01(\t\x12\x16\n\x0enegative_label\x18\x04 \x01(\t\x1a\xec\x03\n\x15\x42inaryConfusionMatrix\x12>\n\x18positive_class_threshold\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x33\n\x0etrue_positives\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x34\n\x0f\x66\x61lse_positives\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x33\n\x0etrue_negatives\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x34\n\x0f\x66\x61lse_negatives\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12/\n\tprecision\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12,\n\x06recall\x18\x07 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x66\x31_score\x18\x08 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\x08\x61\x63\x63uracy\x18\t \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x87\x05\n\x1fMultiClassClassificationMetrics\x12h\n aggregate_classification_metrics\x18\x01 \x01(\x0b\x32>.google.cloud.bigquery.v2.Model.AggregateClassificationMetrics\x12n\n\x15\x63onfusion_matrix_list\x18\x02 \x03(\x0b\x32O.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix\x1a\x89\x03\n\x0f\x43onfusionMatrix\x12:\n\x14\x63onfidence_threshold\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x61\n\x04rows\x18\x02 \x03(\x0b\x32S.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row\x1aQ\n\x05\x45ntry\x12\x17\n\x0fpredicted_label\x18\x01 \x01(\t\x12/\n\nitem_count\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x1a\x83\x01\n\x03Row\x12\x14\n\x0c\x61\x63tual_label\x18\x01 \x01(\t\x12\x66\n\x07\x65ntries\x18\x02 \x03(\x0b\x32U.google.cloud.bigquery.v2.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry\x1a\x8c\x01\n\x11\x43lusteringMetrics\x12:\n\x14\x64\x61vies_bouldin_index\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15mean_squared_distance\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x1a\x95\x03\n\x11\x45valuationMetrics\x12O\n\x12regression_metrics\x18\x01 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.RegressionMetricsH\x00\x12\x64\n\x1d\x62inary_classification_metrics\x18\x02 \x01(\x0b\x32;.google.cloud.bigquery.v2.Model.BinaryClassificationMetricsH\x00\x12m\n"multi_class_classification_metrics\x18\x03 \x01(\x0b\x32?.google.cloud.bigquery.v2.Model.MultiClassClassificationMetricsH\x00\x12O\n\x12\x63lustering_metrics\x18\x04 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.ClusteringMetricsH\x00\x42\t\n\x07metrics\x1a\x97\x0e\n\x0bTrainingRun\x12U\n\x10training_options\x18\x01 \x01(\x0b\x32;.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions\x12.\n\nstart_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12L\n\x07results\x18\x06 \x03(\x0b\x32;.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult\x12M\n\x12\x65valuation_metrics\x18\x07 \x01(\x0b\x32\x31.google.cloud.bigquery.v2.Model.EvaluationMetrics\x1a\x89\x08\n\x0fTrainingOptions\x12\x16\n\x0emax_iterations\x18\x01 \x01(\x03\x12;\n\tloss_type\x18\x02 \x01(\x0e\x32(.google.cloud.bigquery.v2.Model.LossType\x12\x12\n\nlearn_rate\x18\x03 \x01(\x01\x12\x37\n\x11l1_regularization\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x37\n\x11l2_regularization\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12;\n\x15min_relative_progress\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\nwarm_start\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12.\n\nearly_stop\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x1b\n\x13input_label_columns\x18\t \x03(\t\x12J\n\x11\x64\x61ta_split_method\x18\n \x01(\x0e\x32/.google.cloud.bigquery.v2.Model.DataSplitMethod\x12 \n\x18\x64\x61ta_split_eval_fraction\x18\x0b \x01(\x01\x12\x19\n\x11\x64\x61ta_split_column\x18\x0c \x01(\t\x12N\n\x13learn_rate_strategy\x18\r \x01(\x0e\x32\x31.google.cloud.bigquery.v2.Model.LearnRateStrategy\x12\x1a\n\x12initial_learn_rate\x18\x10 \x01(\x01\x12o\n\x13label_class_weights\x18\x11 \x03(\x0b\x32R.google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.LabelClassWeightsEntry\x12\x43\n\rdistance_type\x18\x14 \x01(\x0e\x32,.google.cloud.bigquery.v2.Model.DistanceType\x12\x14\n\x0cnum_clusters\x18\x15 \x01(\x03\x12\x11\n\tmodel_uri\x18\x16 \x01(\t\x12S\n\x15optimization_strategy\x18\x17 \x01(\x0e\x32\x34.google.cloud.bigquery.v2.Model.OptimizationStrategy\x1a\x38\n\x16LabelClassWeightsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x01:\x02\x38\x01\x1a\xd7\x03\n\x0fIterationResult\x12*\n\x05index\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x30\n\x0b\x64uration_ms\x18\x04 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x33\n\rtraining_loss\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12/\n\teval_loss\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x12\n\nlearn_rate\x18\x07 \x01(\x01\x12^\n\rcluster_infos\x18\x08 \x03(\x0b\x32G.google.cloud.bigquery.v2.Model.TrainingRun.IterationResult.ClusterInfo\x1a\x8b\x01\n\x0b\x43lusterInfo\x12\x13\n\x0b\x63\x65ntroid_id\x18\x01 \x01(\x03\x12\x34\n\x0e\x63luster_radius\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12\x31\n\x0c\x63luster_size\x18\x03 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"s\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11LINEAR_REGRESSION\x10\x01\x12\x17\n\x13LOGISTIC_REGRESSION\x10\x02\x12\n\n\x06KMEANS\x10\x03\x12\x0e\n\nTENSORFLOW\x10\x06"O\n\x08LossType\x12\x19\n\x15LOSS_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11MEAN_SQUARED_LOSS\x10\x01\x12\x11\n\rMEAN_LOG_LOSS\x10\x02"H\n\x0c\x44istanceType\x12\x1d\n\x19\x44ISTANCE_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tEUCLIDEAN\x10\x01\x12\n\n\x06\x43OSINE\x10\x02"z\n\x0f\x44\x61taSplitMethod\x12!\n\x1d\x44\x41TA_SPLIT_METHOD_UNSPECIFIED\x10\x00\x12\n\n\x06RANDOM\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\x0e\n\nSEQUENTIAL\x10\x03\x12\x0c\n\x08NO_SPLIT\x10\x04\x12\x0e\n\nAUTO_SPLIT\x10\x05"W\n\x11LearnRateStrategy\x12#\n\x1fLEARN_RATE_STRATEGY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLINE_SEARCH\x10\x01\x12\x0c\n\x08\x43ONSTANT\x10\x02"n\n\x14OptimizationStrategy\x12%\n!OPTIMIZATION_STRATEGY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x42\x41TCH_GRADIENT_DESCENT\x10\x01\x12\x13\n\x0fNORMAL_EQUATION\x10\x02"K\n\x0fGetModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t"}\n\x11PatchModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12.\n\x05model\x18\x04 \x01(\x0b\x32\x1f.google.cloud.bigquery.v2.Model"N\n\x12\x44\x65leteModelRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x10\n\x08model_id\x18\x03 \x01(\t"\x82\x01\n\x11ListModelsRequest\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x12\n\ndataset_id\x18\x02 \x01(\t\x12\x31\n\x0bmax_results\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x12\n\npage_token\x18\x04 \x01(\t"^\n\x12ListModelsResponse\x12/\n\x06models\x18\x01 \x03(\x0b\x32\x1f.google.cloud.bigquery.v2.Model\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xb9\x04\n\x0cModelService\x12X\n\x08GetModel\x12).google.cloud.bigquery.v2.GetModelRequest\x1a\x1f.google.cloud.bigquery.v2.Model"\x00\x12i\n\nListModels\x12+.google.cloud.bigquery.v2.ListModelsRequest\x1a,.google.cloud.bigquery.v2.ListModelsResponse"\x00\x12\\\n\nPatchModel\x12+.google.cloud.bigquery.v2.PatchModelRequest\x1a\x1f.google.cloud.bigquery.v2.Model"\x00\x12U\n\x0b\x44\x65leteModel\x12,.google.cloud.bigquery.v2.DeleteModelRequest\x1a\x16.google.protobuf.Empty"\x00\x1a\xae\x01\xca\x41\x17\x62igquery.googleapis.com\xd2\x41\x90\x01https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-onlyBl\n\x1c\x63om.google.cloud.bigquery.v2B\nModelProtoZ@google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigqueryb\x06proto3' ), dependencies=[ google_dot_cloud_dot_bigquery__v2_dot_proto_dot_model__reference__pb2.DESCRIPTOR, @@ -43,6 +45,7 @@ google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, ], ) @@ -77,11 +80,14 @@ _descriptor.EnumValueDescriptor( name="KMEANS", index=3, number=3, serialized_options=None, type=None ), + _descriptor.EnumValueDescriptor( + name="TENSORFLOW", index=4, number=6, serialized_options=None, type=None + ), ], containing_type=None, serialized_options=None, - serialized_start=5159, - serialized_end=5258, + serialized_start=5432, + serialized_end=5547, ) _sym_db.RegisterEnumDescriptor(_MODEL_MODELTYPE) @@ -111,8 +117,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=5260, - serialized_end=5339, + serialized_start=5549, + serialized_end=5628, ) _sym_db.RegisterEnumDescriptor(_MODEL_LOSSTYPE) @@ -138,8 +144,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=5341, - serialized_end=5413, + serialized_start=5630, + serialized_end=5702, ) _sym_db.RegisterEnumDescriptor(_MODEL_DISTANCETYPE) @@ -174,8 +180,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=5415, - serialized_end=5537, + serialized_start=5704, + serialized_end=5826, ) _sym_db.RegisterEnumDescriptor(_MODEL_DATASPLITMETHOD) @@ -201,11 +207,46 @@ ], containing_type=None, serialized_options=None, - serialized_start=5539, - serialized_end=5626, + serialized_start=5828, + serialized_end=5915, ) _sym_db.RegisterEnumDescriptor(_MODEL_LEARNRATESTRATEGY) +_MODEL_OPTIMIZATIONSTRATEGY = _descriptor.EnumDescriptor( + name="OptimizationStrategy", + full_name="google.cloud.bigquery.v2.Model.OptimizationStrategy", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="OPTIMIZATION_STRATEGY_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="BATCH_GRADIENT_DESCENT", + index=1, + number=1, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="NORMAL_EQUATION", + index=2, + number=2, + serialized_options=None, + type=None, + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=5917, + serialized_end=6027, +) +_sym_db.RegisterEnumDescriptor(_MODEL_OPTIMIZATIONSTRATEGY) + _MODEL_REGRESSIONMETRICS = _descriptor.Descriptor( name="RegressionMetrics", @@ -313,8 +354,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=859, - serialized_end=1167, + serialized_start=884, + serialized_end=1192, ) _MODEL_AGGREGATECLASSIFICATIONMETRICS = _descriptor.Descriptor( @@ -459,8 +500,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1170, - serialized_end=1537, + serialized_start=1195, + serialized_end=1562, ) _MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX = _descriptor.Descriptor( @@ -596,6 +637,42 @@ serialized_options=None, file=DESCRIPTOR, ), + _descriptor.FieldDescriptor( + name="f1_score", + full_name="google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.f1_score", + index=7, + number=8, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="accuracy", + full_name="google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix.accuracy", + index=8, + number=9, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[], @@ -605,8 +682,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1799, - serialized_end=2195, + serialized_start=1872, + serialized_end=2364, ) _MODEL_BINARYCLASSIFICATIONMETRICS = _descriptor.Descriptor( @@ -652,6 +729,42 @@ serialized_options=None, file=DESCRIPTOR, ), + _descriptor.FieldDescriptor( + name="positive_label", + full_name="google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.positive_label", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="negative_label", + full_name="google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.negative_label", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[_MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX], @@ -661,8 +774,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1540, - serialized_end=2195, + serialized_start=1565, + serialized_end=2364, ) _MODEL_MULTICLASSCLASSIFICATIONMETRICS_CONFUSIONMATRIX_ENTRY = _descriptor.Descriptor( @@ -717,8 +830,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2630, - serialized_end=2711, + serialized_start=2799, + serialized_end=2880, ) _MODEL_MULTICLASSCLASSIFICATIONMETRICS_CONFUSIONMATRIX_ROW = _descriptor.Descriptor( @@ -773,8 +886,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2714, - serialized_end=2845, + serialized_start=2883, + serialized_end=3014, ) _MODEL_MULTICLASSCLASSIFICATIONMETRICS_CONFUSIONMATRIX = _descriptor.Descriptor( @@ -832,8 +945,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2452, - serialized_end=2845, + serialized_start=2621, + serialized_end=3014, ) _MODEL_MULTICLASSCLASSIFICATIONMETRICS = _descriptor.Descriptor( @@ -888,8 +1001,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2198, - serialized_end=2845, + serialized_start=2367, + serialized_end=3014, ) _MODEL_CLUSTERINGMETRICS = _descriptor.Descriptor( @@ -944,8 +1057,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2848, - serialized_end=2988, + serialized_start=3017, + serialized_end=3157, ) _MODEL_EVALUATIONMETRICS = _descriptor.Descriptor( @@ -1044,8 +1157,8 @@ fields=[], ) ], - serialized_start=2991, - serialized_end=3396, + serialized_start=3160, + serialized_end=3565, ) _MODEL_TRAININGRUN_TRAININGOPTIONS_LABELCLASSWEIGHTSENTRY = _descriptor.Descriptor( @@ -1100,8 +1213,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4580, - serialized_end=4636, + serialized_start=4853, + serialized_end=4909, ) _MODEL_TRAININGRUN_TRAININGOPTIONS = _descriptor.Descriptor( @@ -1417,6 +1530,42 @@ serialized_options=None, file=DESCRIPTOR, ), + _descriptor.FieldDescriptor( + name="model_uri", + full_name="google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.model_uri", + index=17, + number=22, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="optimization_strategy", + full_name="google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions.optimization_strategy", + index=18, + number=23, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[_MODEL_TRAININGRUN_TRAININGOPTIONS_LABELCLASSWEIGHTSENTRY], @@ -1426,8 +1575,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3707, - serialized_end=4636, + serialized_start=3876, + serialized_end=4909, ) _MODEL_TRAININGRUN_ITERATIONRESULT_CLUSTERINFO = _descriptor.Descriptor( @@ -1500,8 +1649,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4971, - serialized_end=5110, + serialized_start=5244, + serialized_end=5383, ) _MODEL_TRAININGRUN_ITERATIONRESULT = _descriptor.Descriptor( @@ -1628,8 +1777,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4639, - serialized_end=5110, + serialized_start=4912, + serialized_end=5383, ) _MODEL_TRAININGRUN = _descriptor.Descriptor( @@ -1723,8 +1872,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3399, - serialized_end=5110, + serialized_start=3568, + serialized_end=5383, ) _MODEL_LABELSENTRY = _descriptor.Descriptor( @@ -1779,8 +1928,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5112, - serialized_end=5157, + serialized_start=5385, + serialized_end=5430, ) _MODEL = _descriptor.Descriptor( @@ -2042,14 +2191,15 @@ _MODEL_DISTANCETYPE, _MODEL_DATASPLITMETHOD, _MODEL_LEARNRATESTRATEGY, + _MODEL_OPTIMIZATIONSTRATEGY, ], serialized_options=None, is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=302, - serialized_end=5626, + serialized_start=327, + serialized_end=6027, ) @@ -2123,8 +2273,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5628, - serialized_end=5703, + serialized_start=6029, + serialized_end=6104, ) @@ -2216,8 +2366,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5705, - serialized_end=5830, + serialized_start=6106, + serialized_end=6231, ) @@ -2291,8 +2441,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5832, - serialized_end=5910, + serialized_start=6233, + serialized_end=6311, ) @@ -2384,8 +2534,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5913, - serialized_end=6043, + serialized_start=6314, + serialized_end=6444, ) @@ -2441,8 +2591,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=6045, - serialized_end=6139, + serialized_start=6446, + serialized_end=6540, ) _MODEL_REGRESSIONMETRICS.fields_by_name[ @@ -2504,6 +2654,12 @@ _MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX.fields_by_name[ "recall" ].message_type = google_dot_protobuf_dot_wrappers__pb2._DOUBLEVALUE +_MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX.fields_by_name[ + "f1_score" +].message_type = google_dot_protobuf_dot_wrappers__pb2._DOUBLEVALUE +_MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX.fields_by_name[ + "accuracy" +].message_type = google_dot_protobuf_dot_wrappers__pb2._DOUBLEVALUE _MODEL_BINARYCLASSIFICATIONMETRICS_BINARYCONFUSIONMATRIX.containing_type = ( _MODEL_BINARYCLASSIFICATIONMETRICS ) @@ -2619,6 +2775,9 @@ _MODEL_TRAININGRUN_TRAININGOPTIONS.fields_by_name[ "distance_type" ].enum_type = _MODEL_DISTANCETYPE +_MODEL_TRAININGRUN_TRAININGOPTIONS.fields_by_name[ + "optimization_strategy" +].enum_type = _MODEL_OPTIMIZATIONSTRATEGY _MODEL_TRAININGRUN_TRAININGOPTIONS.containing_type = _MODEL_TRAININGRUN _MODEL_TRAININGRUN_ITERATIONRESULT_CLUSTERINFO.fields_by_name[ "cluster_radius" @@ -2682,6 +2841,7 @@ _MODEL_DISTANCETYPE.containing_type = _MODEL _MODEL_DATASPLITMETHOD.containing_type = _MODEL _MODEL_LEARNRATESTRATEGY.containing_type = _MODEL +_MODEL_OPTIMIZATIONSTRATEGY.containing_type = _MODEL _PATCHMODELREQUEST.fields_by_name["model"].message_type = _MODEL _LISTMODELSREQUEST.fields_by_name[ "max_results" @@ -2729,11 +2889,12 @@ dict( DESCRIPTOR=_MODEL_AGGREGATECLASSIFICATIONMETRICS, __module__="google.cloud.bigquery_v2.proto.model_pb2", - __doc__="""Aggregate metrics for classification models. For multi-class models, the - metrics are either macro-averaged: metrics are calculated for each label - and then an unweighted average is taken of those values or - micro-averaged: the metric is calculated globally by counting the total - number of correctly predicted rows. + __doc__="""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. Attributes: @@ -2792,16 +2953,22 @@ false_negatives: Number of false samples predicted as false. precision: - Aggregate precision. + The fraction of actual positive predictions that had positive + actual labels. recall: - Aggregate recall. + The fraction of actual positive labels that were given a + positive prediction. + f1_score: + The equally weighted average of recall and precision. + accuracy: + The fraction of predictions given the correct label. """, # @@protoc_insertion_point(class_scope:google.cloud.bigquery.v2.Model.BinaryClassificationMetrics.BinaryConfusionMatrix) ), ), DESCRIPTOR=_MODEL_BINARYCLASSIFICATIONMETRICS, __module__="google.cloud.bigquery_v2.proto.model_pb2", - __doc__="""Evaluation metrics for binary classification models. + __doc__="""Evaluation metrics for binary classification/classifier models. Attributes: @@ -2809,6 +2976,10 @@ Aggregate classification metrics. binary_confusion_matrix_list: Binary confusion matrix at multiple thresholds. + positive_label: + Label representing the positive class. + negative_label: + Label representing the negative class. """, # @@protoc_insertion_point(class_scope:google.cloud.bigquery.v2.Model.BinaryClassificationMetrics) ), @@ -2876,7 +3047,7 @@ ), DESCRIPTOR=_MODEL_MULTICLASSCLASSIFICATIONMETRICS, __module__="google.cloud.bigquery_v2.proto.model_pb2", - __doc__="""Evaluation metrics for multi-class classification models. + __doc__="""Evaluation metrics for multi-class classification/classifier models. Attributes: @@ -2915,16 +3086,16 @@ __module__="google.cloud.bigquery_v2.proto.model_pb2", __doc__="""Evaluation metrics of a model. These are either computed on all training data or just the eval data based on whether eval data was used during - training. + training. These are not present for imported models. Attributes: regression_metrics: Populated for regression models. binary_classification_metrics: - Populated for binary classification models. + Populated for binary classification/classifier models. multi_class_classification_metrics: - Populated for multi-class classification models. + Populated for multi-class classification/classifier models. clustering_metrics: [Beta] Populated for clustering models. """, @@ -2954,23 +3125,27 @@ Attributes: max_iterations: - The maximum number of iterations in training. + The maximum number of iterations in training. Used only for + iterative training algorithms. loss_type: Type of loss function used during training run. learn_rate: - Learning rate in training. + Learning rate in training. Used only for iterative training + algorithms. l1_regularization: L1 regularization coefficient. l2_regularization: L2 regularization coefficient. min_relative_progress: When early\_stop is true, stops training when accuracy - improvement is less than 'min\_relative\_progress'. + improvement is less than 'min\_relative\_progress'. Used only + for iterative training algorithms. warm_start: Whether to train a model from the last checkpoint. early_stop: Whether to stop early when the loss doesn't improve significantly any more (compared to min\_relative\_progress). + Used only for iterative training algorithms. input_label_columns: Name of input label columns in training data. data_split_method: @@ -2993,17 +3168,23 @@ https://cloud.google.com/bigquery/docs/reference/standard- sql/data-types#data-type-properties learn_rate_strategy: - The strategy to determine learning rate. + The strategy to determine learn rate for the current + iteration. initial_learn_rate: - Specifies the initial learning rate for line search to start - at. + Specifies the initial learning rate for the line search learn + rate strategy. label_class_weights: Weights associated with each label class, for rebalancing the - training data. + training data. Only applicable for classification models. distance_type: [Beta] Distance type for clustering models. num_clusters: [Beta] Number of clusters for clustering models. + model_uri: + [Beta] Google Cloud Storage URI from which the model was + imported. Only applicable for imported models. + optimization_strategy: + Optimization strategy for training linear regression models. """, # @@protoc_insertion_point(class_scope:google.cloud.bigquery.v2.Model.TrainingRun.TrainingOptions) ), @@ -3102,11 +3283,9 @@ Output only. The time when this model was last modified, in millisecs since the epoch. description: - [Optional] A user-friendly description of this model. @mutable - bigquery.models.patch + [Optional] A user-friendly description of this model. friendly_name: - [Optional] A descriptive name for this model. @mutable - bigquery.models.patch + [Optional] A descriptive name for this model. labels: [Optional] The labels associated with this model. You can use these to organize and group your models. Label keys and values @@ -3114,16 +3293,14 @@ lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label - in the list must have a different key. @mutable - bigquery.models.patch + in the list must have a different key. expiration_time: [Optional] The time when this model expires, in milliseconds since the epoch. If not present, the model will persist indefinitely. Expired models will be deleted and their storage reclaimed. The defaultTableExpirationMs property of the encapsulating dataset can be used to set a default - expirationTime on newly created models. @mutable - bigquery.models.patch + expirationTime on newly created models. location: Output only. The geographic location where the model resides. This value is inherited from the dataset. @@ -3137,7 +3314,7 @@ this model. label_columns: Output only. Label columns that were used to train this model. - The output of the model will have a ``predicted\_`` prefix to + The output of the model will have a "predicted\_" prefix to these columns. """, # @@protoc_insertion_point(class_scope:google.cloud.bigquery.v2.Model) @@ -3282,9 +3459,11 @@ full_name="google.cloud.bigquery.v2.ModelService", file=DESCRIPTOR, index=0, - serialized_options=None, - serialized_start=6142, - serialized_end=6534, + serialized_options=_b( + "\312A\027bigquery.googleapis.com\322A\220\001https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only" + ), + serialized_start=6543, + serialized_end=7112, methods=[ _descriptor.MethodDescriptor( name="GetModel", diff --git a/bigquery/google/cloud/bigquery_v2/proto/model_reference.proto b/bigquery/google/cloud/bigquery_v2/proto/model_reference.proto index 8e1e218f969c..f436659abd4f 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/model_reference.proto +++ b/bigquery/google/cloud/bigquery_v2/proto/model_reference.proto @@ -23,7 +23,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;big option java_outer_classname = "ModelReferenceProto"; option java_package = "com.google.cloud.bigquery.v2"; - // Id path of a model. message ModelReference { // [Required] The ID of the project containing this model. diff --git a/bigquery/google/cloud/bigquery_v2/proto/model_reference_pb2.py b/bigquery/google/cloud/bigquery_v2/proto/model_reference_pb2.py index 3d1b53e44800..94f6116b5a44 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/model_reference_pb2.py +++ b/bigquery/google/cloud/bigquery_v2/proto/model_reference_pb2.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/bigquery_v2/proto/model_reference.proto diff --git a/bigquery/google/cloud/bigquery_v2/proto/standard_sql.proto b/bigquery/google/cloud/bigquery_v2/proto/standard_sql.proto index 82d9960242b3..98173092ff71 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/standard_sql.proto +++ b/bigquery/google/cloud/bigquery_v2/proto/standard_sql.proto @@ -23,7 +23,6 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;big option java_outer_classname = "StandardSqlProto"; option java_package = "com.google.cloud.bigquery.v2"; - // The type of a variable, e.g., a function argument. // Examples: // INT64: {type_kind="INT64"} diff --git a/bigquery/google/cloud/bigquery_v2/proto/standard_sql_pb2.py b/bigquery/google/cloud/bigquery_v2/proto/standard_sql_pb2.py index 5f4a40278140..91f1554f7f80 100644 --- a/bigquery/google/cloud/bigquery_v2/proto/standard_sql_pb2.py +++ b/bigquery/google/cloud/bigquery_v2/proto/standard_sql_pb2.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/bigquery_v2/proto/standard_sql.proto diff --git a/bigquery/synth.metadata b/bigquery/synth.metadata index 3d09d31e5ed8..44837073d6d6 100644 --- a/bigquery/synth.metadata +++ b/bigquery/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-25T12:13:19.608155Z", + "updateTime": "2019-06-15T12:11:48.348952Z", "sources": [ { "generator": { "name": "artman", - "version": "0.21.0", - "dockerImage": "googleapis/artman@sha256:28d4271586772b275cd3bc95cb46bd227a24d3c9048de45dccdb7f3afb0bfba9" + "version": "0.26.0", + "dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7ca19138ccebe219a67be2245200e821b3e32123", - "internalRef": "249916728" + "sha": "7b58b37559f6a5337c4c564518e9573d742df225", + "internalRef": "253322136" } } ],