tables.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.automl.v1beta1;
  16. import "google/cloud/automl/v1beta1/classification.proto";
  17. import "google/cloud/automl/v1beta1/column_spec.proto";
  18. import "google/cloud/automl/v1beta1/data_items.proto";
  19. import "google/cloud/automl/v1beta1/data_stats.proto";
  20. import "google/cloud/automl/v1beta1/ranges.proto";
  21. import "google/cloud/automl/v1beta1/regression.proto";
  22. import "google/cloud/automl/v1beta1/temporal.proto";
  23. import "google/protobuf/struct.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1beta1;automl";
  26. option java_multiple_files = true;
  27. option java_package = "com.google.cloud.automl.v1beta1";
  28. option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1";
  29. option ruby_package = "Google::Cloud::AutoML::V1beta1";
  30. // Metadata for a dataset used for AutoML Tables.
  31. message TablesDatasetMetadata {
  32. // Output only. The table_spec_id of the primary table of this dataset.
  33. string primary_table_spec_id = 1;
  34. // column_spec_id of the primary table's column that should be used as the
  35. // training & prediction target.
  36. // This column must be non-nullable and have one of following data types
  37. // (otherwise model creation will error):
  38. //
  39. // * CATEGORY
  40. //
  41. // * FLOAT64
  42. //
  43. // If the type is CATEGORY , only up to
  44. // 100 unique values may exist in that column across all rows.
  45. //
  46. // NOTE: Updates of this field will instantly affect any other users
  47. // concurrently working with the dataset.
  48. string target_column_spec_id = 2;
  49. // column_spec_id of the primary table's column that should be used as the
  50. // weight column, i.e. the higher the value the more important the row will be
  51. // during model training.
  52. // Required type: FLOAT64.
  53. // Allowed values: 0 to 10000, inclusive on both ends; 0 means the row is
  54. // ignored for training.
  55. // If not set all rows are assumed to have equal weight of 1.
  56. // NOTE: Updates of this field will instantly affect any other users
  57. // concurrently working with the dataset.
  58. string weight_column_spec_id = 3;
  59. // column_spec_id of the primary table column which specifies a possible ML
  60. // use of the row, i.e. the column will be used to split the rows into TRAIN,
  61. // VALIDATE and TEST sets.
  62. // Required type: STRING.
  63. // This column, if set, must either have all of `TRAIN`, `VALIDATE`, `TEST`
  64. // among its values, or only have `TEST`, `UNASSIGNED` values. In the latter
  65. // case the rows with `UNASSIGNED` value will be assigned by AutoML. Note
  66. // that if a given ml use distribution makes it impossible to create a "good"
  67. // model, that call will error describing the issue.
  68. // If both this column_spec_id and primary table's time_column_spec_id are not
  69. // set, then all rows are treated as `UNASSIGNED`.
  70. // NOTE: Updates of this field will instantly affect any other users
  71. // concurrently working with the dataset.
  72. string ml_use_column_spec_id = 4;
  73. // Output only. Correlations between
  74. //
  75. // [TablesDatasetMetadata.target_column_spec_id][google.cloud.automl.v1beta1.TablesDatasetMetadata.target_column_spec_id],
  76. // and other columns of the
  77. //
  78. // [TablesDatasetMetadataprimary_table][google.cloud.automl.v1beta1.TablesDatasetMetadata.primary_table_spec_id].
  79. // Only set if the target column is set. Mapping from other column spec id to
  80. // its CorrelationStats with the target column.
  81. // This field may be stale, see the stats_update_time field for
  82. // for the timestamp at which these stats were last updated.
  83. map<string, CorrelationStats> target_column_correlations = 6;
  84. // Output only. The most recent timestamp when target_column_correlations
  85. // field and all descendant ColumnSpec.data_stats and
  86. // ColumnSpec.top_correlated_columns fields were last (re-)generated. Any
  87. // changes that happened to the dataset afterwards are not reflected in these
  88. // fields values. The regeneration happens in the background on a best effort
  89. // basis.
  90. google.protobuf.Timestamp stats_update_time = 7;
  91. }
  92. // Model metadata specific to AutoML Tables.
  93. message TablesModelMetadata {
  94. // Additional optimization objective configuration. Required for
  95. // `MAXIMIZE_PRECISION_AT_RECALL` and `MAXIMIZE_RECALL_AT_PRECISION`,
  96. // otherwise unused.
  97. oneof additional_optimization_objective_config {
  98. // Required when optimization_objective is "MAXIMIZE_PRECISION_AT_RECALL".
  99. // Must be between 0 and 1, inclusive.
  100. float optimization_objective_recall_value = 17;
  101. // Required when optimization_objective is "MAXIMIZE_RECALL_AT_PRECISION".
  102. // Must be between 0 and 1, inclusive.
  103. float optimization_objective_precision_value = 18;
  104. }
  105. // Column spec of the dataset's primary table's column the model is
  106. // predicting. Snapshotted when model creation started.
  107. // Only 3 fields are used:
  108. // name - May be set on CreateModel, if it's not then the ColumnSpec
  109. // corresponding to the current target_column_spec_id of the dataset
  110. // the model is trained from is used.
  111. // If neither is set, CreateModel will error.
  112. // display_name - Output only.
  113. // data_type - Output only.
  114. ColumnSpec target_column_spec = 2;
  115. // Column specs of the dataset's primary table's columns, on which
  116. // the model is trained and which are used as the input for predictions.
  117. // The
  118. //
  119. // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]
  120. // as well as, according to dataset's state upon model creation,
  121. //
  122. // [weight_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.weight_column_spec_id],
  123. // and
  124. //
  125. // [ml_use_column][google.cloud.automl.v1beta1.TablesDatasetMetadata.ml_use_column_spec_id]
  126. // must never be included here.
  127. //
  128. // Only 3 fields are used:
  129. //
  130. // * name - May be set on CreateModel, if set only the columns specified are
  131. // used, otherwise all primary table's columns (except the ones listed
  132. // above) are used for the training and prediction input.
  133. //
  134. // * display_name - Output only.
  135. //
  136. // * data_type - Output only.
  137. repeated ColumnSpec input_feature_column_specs = 3;
  138. // Objective function the model is optimizing towards. The training process
  139. // creates a model that maximizes/minimizes the value of the objective
  140. // function over the validation set.
  141. //
  142. // The supported optimization objectives depend on the prediction type.
  143. // If the field is not set, a default objective function is used.
  144. //
  145. // CLASSIFICATION_BINARY:
  146. // "MAXIMIZE_AU_ROC" (default) - Maximize the area under the receiver
  147. // operating characteristic (ROC) curve.
  148. // "MINIMIZE_LOG_LOSS" - Minimize log loss.
  149. // "MAXIMIZE_AU_PRC" - Maximize the area under the precision-recall curve.
  150. // "MAXIMIZE_PRECISION_AT_RECALL" - Maximize precision for a specified
  151. // recall value.
  152. // "MAXIMIZE_RECALL_AT_PRECISION" - Maximize recall for a specified
  153. // precision value.
  154. //
  155. // CLASSIFICATION_MULTI_CLASS :
  156. // "MINIMIZE_LOG_LOSS" (default) - Minimize log loss.
  157. //
  158. //
  159. // REGRESSION:
  160. // "MINIMIZE_RMSE" (default) - Minimize root-mean-squared error (RMSE).
  161. // "MINIMIZE_MAE" - Minimize mean-absolute error (MAE).
  162. // "MINIMIZE_RMSLE" - Minimize root-mean-squared log error (RMSLE).
  163. string optimization_objective = 4;
  164. // Output only. Auxiliary information for each of the
  165. // input_feature_column_specs with respect to this particular model.
  166. repeated TablesModelColumnInfo tables_model_column_info = 5;
  167. // Required. The train budget of creating this model, expressed in milli node
  168. // hours i.e. 1,000 value in this field means 1 node hour.
  169. //
  170. // The training cost of the model will not exceed this budget. The final cost
  171. // will be attempted to be close to the budget, though may end up being (even)
  172. // noticeably smaller - at the backend's discretion. This especially may
  173. // happen when further model training ceases to provide any improvements.
  174. //
  175. // If the budget is set to a value known to be insufficient to train a
  176. // model for the given dataset, the training won't be attempted and
  177. // will error.
  178. //
  179. // The train budget must be between 1,000 and 72,000 milli node hours,
  180. // inclusive.
  181. int64 train_budget_milli_node_hours = 6;
  182. // Output only. The actual training cost of the model, expressed in milli
  183. // node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed
  184. // to not exceed the train budget.
  185. int64 train_cost_milli_node_hours = 7;
  186. // Use the entire training budget. This disables the early stopping feature.
  187. // By default, the early stopping feature is enabled, which means that AutoML
  188. // Tables might stop training before the entire training budget has been used.
  189. bool disable_early_stopping = 12;
  190. }
  191. // Contains annotation details specific to Tables.
  192. message TablesAnnotation {
  193. // Output only. A confidence estimate between 0.0 and 1.0, inclusive. A higher
  194. // value means greater confidence in the returned value.
  195. // For
  196. //
  197. // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]
  198. // of FLOAT64 data type the score is not populated.
  199. float score = 1;
  200. // Output only. Only populated when
  201. //
  202. // [target_column_spec][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec]
  203. // has FLOAT64 data type. An interval in which the exactly correct target
  204. // value has 95% chance to be in.
  205. DoubleRange prediction_interval = 4;
  206. // The predicted value of the row's
  207. //
  208. // [target_column][google.cloud.automl.v1beta1.TablesModelMetadata.target_column_spec].
  209. // The value depends on the column's DataType:
  210. //
  211. // * CATEGORY - the predicted (with the above confidence `score`) CATEGORY
  212. // value.
  213. //
  214. // * FLOAT64 - the predicted (with above `prediction_interval`) FLOAT64 value.
  215. google.protobuf.Value value = 2;
  216. // Output only. Auxiliary information for each of the model's
  217. //
  218. // [input_feature_column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs]
  219. // with respect to this particular prediction.
  220. // If no other fields than
  221. //
  222. // [column_spec_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_spec_name]
  223. // and
  224. //
  225. // [column_display_name][google.cloud.automl.v1beta1.TablesModelColumnInfo.column_display_name]
  226. // would be populated, then this whole field is not.
  227. repeated TablesModelColumnInfo tables_model_column_info = 3;
  228. // Output only. Stores the prediction score for the baseline example, which
  229. // is defined as the example with all values set to their baseline values.
  230. // This is used as part of the Sampled Shapley explanation of the model's
  231. // prediction. This field is populated only when feature importance is
  232. // requested. For regression models, this holds the baseline prediction for
  233. // the baseline example. For classification models, this holds the baseline
  234. // prediction for the baseline example for the argmax class.
  235. float baseline_score = 5;
  236. }
  237. // An information specific to given column and Tables Model, in context
  238. // of the Model and the predictions created by it.
  239. message TablesModelColumnInfo {
  240. // Output only. The name of the ColumnSpec describing the column. Not
  241. // populated when this proto is outputted to BigQuery.
  242. string column_spec_name = 1;
  243. // Output only. The display name of the column (same as the display_name of
  244. // its ColumnSpec).
  245. string column_display_name = 2;
  246. // Output only. When given as part of a Model (always populated):
  247. // Measurement of how much model predictions correctness on the TEST data
  248. // depend on values in this column. A value between 0 and 1, higher means
  249. // higher influence. These values are normalized - for all input feature
  250. // columns of a given model they add to 1.
  251. //
  252. // When given back by Predict (populated iff
  253. // [feature_importance
  254. // param][google.cloud.automl.v1beta1.PredictRequest.params] is set) or Batch
  255. // Predict (populated iff
  256. // [feature_importance][google.cloud.automl.v1beta1.PredictRequest.params]
  257. // param is set):
  258. // Measurement of how impactful for the prediction returned for the given row
  259. // the value in this column was. Specifically, the feature importance
  260. // specifies the marginal contribution that the feature made to the prediction
  261. // score compared to the baseline score. These values are computed using the
  262. // Sampled Shapley method.
  263. float feature_importance = 3;
  264. }