REST Resource: projects.locations.models

Resource: Model

API proto representing a trained machine learning model.

JSON representation
{
  "name": string,
  "displayName": string,
  "datasetId": string,
  "createTime": string,
  "updateTime": string,
  "deploymentState": enum (DeploymentState),
  "tablesModelMetadata": {
    object (TablesModelMetadata)
  }
}
Fields
name

string

Output only. Resource name of the model. Format: projects/{project_id}/locations/{locationId}/models/{modelId}

displayName

string

Required. The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. It must start with a letter.

datasetId

string

Required. The resource ID of the dataset used to create the model. The dataset must come from the same ancestor project and location.

createTime

string (Timestamp format)

Output only. Timestamp when the model training finished and can be used for prediction.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Timestamp when this model was last updated.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

deploymentState

enum (DeploymentState)

Output only. Deployment state of the model. A model can only serve prediction requests after it gets deployed.

tablesModelMetadata

object (TablesModelMetadata)

Metadata for Tables models.

TablesModelMetadata

Model metadata specific to AutoML Tables.

JSON representation
{
  "predictionType": enum (PredictionType),
  "targetColumnSpec": {
    object (ColumnSpec)
  },
  "inputFeatureColumnSpecs": [
    {
      object (ColumnSpec)
    }
  ],
  "excludedFeatureColumnSpecs": [
    {
      object (ColumnSpec)
    }
  ],
  "optimizationObjective": string,
  "tablesModelColumnInfo": [
    {
      object (TablesModelColumnInfo)
    }
  ],
  "trainBudgetMilliNodeHours": string,
  "trainCostMilliNodeHours": string,
  "disableEarlyStopping": boolean,
  "timeColumnSpecId": string,
  "forecastingConfig": {
    object (ForecastingConfig)
  },

  // Union field data_split_strategy can be only one of the following:
  "mlUseColumnSpecId": string,
  "splitPercentageConfig": {
    object (SplitPercentageConfig)
  }
  // End of list of possible types for union field data_split_strategy.
}
Fields
predictionType

enum (PredictionType)

The type of prediction this model is providing.

targetColumnSpec

object (ColumnSpec)

Column spec of the dataset's primary table's column the model is predicting. Snapshotted when model creation started. Only 3 fields are used: name - May be set on models.create, if it's not then the ColumnSpec corresponding to the current targetColumnSpecId of the dataset the model is trained from is used. If neither is set, models.create will error. displayName - Output only. dataType - Output only.

inputFeatureColumnSpecs[]

object (ColumnSpec)

Column specs of the dataset's primary table's columns, on which the model is trained and which are used as the input for predictions. The

target_column as well as, according to dataset's state upon model creation,

weight_column, and

ml_use_column must never be included here.

Only 3 fields are used:

  • name - May be set on models.create, if set only the columns specified are used, otherwise all primary table's columns (except the ones listed above) are used for the training and prediction input.

  • displayName - Output only.

  • dataType - Output only.

excludedFeatureColumnSpecs[]

object (ColumnSpec)

Output only. Column specs of the dataset's primary table's columns that were excluded from training. Derived from the input feature column specs. The

target_column,

weight_column, and

ml_use_column are not included in this list because they are automatically excluded as prediction inputs. Only 3 fields are used: name, displayName, and dataType

optimizationObjective

string

Objective function the model is optimizing towards. The training process creates a model that maximizes/minimizes the value of the objective function over the validation set.

The supported optimization objectives depend on the prediction type. If the field is not set, a default objective function is used.

CLASSIFICATION_BINARY: "MAXIMIZE_AU_ROC" (default) - Maximize the area under the receiver operating characteristic (ROC) curve. "MINIMIZE_LOG_LOSS" - Minimize log loss. "MAXIMIZE_AU_PRC" - Maximize the area under the precision-recall curve.

CLASSIFICATION_MULTI_CLASS : "MINIMIZE_LOG_LOSS" (default) - Minimize log loss.

REGRESSION: "MINIMIZE_RMSE" (default) - Minimize root-mean-squared error (RMSE). "MINIMIZE_MAE" - Minimize mean-absolute error (MAE). "MINIMIZE_RMSLE" - Minimize root-mean-squared log error (RMSLE).

tablesModelColumnInfo[]

object (TablesModelColumnInfo)

Output only. Auxiliary information for each of the inputFeatureColumnSpecs with respect to this particular model.

trainBudgetMilliNodeHours

string (int64 format)

Required. The train budget of creating this model, expressed in milli node hours i.e. 1,000 value in this field means 1 node hour.

The training cost of the model will not exceed this budget. The final cost will be attempted to be close to the budget, though may end up being (even) noticeably smaller - at the backend's discretion. This especially may happen when further model training ceases to provide any improvements.

If the budget is set to a value known to be insufficient to train a model for the given dataset, the training won't be attempted and will error.

The train budget must be between 1,000 and 72,000 milli node hours, inclusive.

trainCostMilliNodeHours

string (int64 format)

Output only. The actual training cost of the model, expressed in milli node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed to not exceed the train budget.

disableEarlyStopping

boolean

Use the entire training budget. This disables the early stopping feature. By default, the early stopping feature is enabled, which means that AutoML Tables might stop training before the entire training budget has been used.

timeColumnSpecId

string

ID of the time column. If set, then this overrides

timeColumnSpecId. If unset, then

timeColumnSpecId will be used. Only used if

ml_use_column is not set.

forecastingConfig

object (ForecastingConfig)

Additional model configuration specific to FORECASTING.

Union field data_split_strategy. The strategy used to split the data between training, validation, and test sets. If set at model creation time, then it overrides

ml_use_column. Otherwise, then the dataset properties will be used to determine a strategy. If no strategy is set, then the dataset will be split using SplitPercentageConfig with 80% to train set, 10% to validation set, and 10% to test set. data_split_strategy can be only one of the following:

mlUseColumnSpecId

string

ID of the column use to split the table.

splitPercentageConfig

object (SplitPercentageConfig)

A data split strategy using percentage configuration.

ForecastingConfig

An additional configuration needed for FORECASTING prediction type. By key, the union of the

[key][forecastingMetadata]google.cloud.automl.v1beta1.ColumnSpec.ForecastingMetadata.ColumnType.KEY column(s) is meant. The table's rows are the data points of the time series, and their timestamps are the values in the

primary_table's time_column

JSON representation
{
  "granularity": {
    object (TimeGranularity)
  },
  "horizonPeriods": string
}
Fields
granularity

object (TimeGranularity)

Required. Describes the granularity of the time series. E.g. is a row for each key given per hour, per 3 months or per year? For each key the rows' timestamps should be spaced approximately by this granularity period. Missing rows are allowed i.e. there may be periods for which data for a given key is missing, also data for a key may start late or end early. On the other hand within a single granularity period no more than one row per key is allowed. The time column must be at least as precise as this granularity requires.

horizonPeriods

string (int64 format)

Required. The number of periods the model is able to predict into the future, where each period is one unit of granularity as defined by the granularity field above. Forecasting only supports batch predictions and when such a one is requested both historical data rows, as well as to-be-predicted rows must be provided. Prediction for a row fails if, for its key, the time difference between its timestamp and timestamp of key's latest historical row is larger than the horizon. If the asked to be predicted row's key is not present in the historical data then its prediction fails if the time difference between its timestamp and timestamp of latest historical row for any key is over the horizon.

TimeGranularity

A duration of time expressed in time granularity units.

JSON representation
{
  "unit": enum (TimeGranularityUnit),
  "quantity": string
}
Fields
unit

enum (TimeGranularityUnit)

The unit of this time period.

quantity

string (int64 format)

The number of units per period, e.g. 3 weeks or 2 months.

TimeGranularityUnit

Represents a unit of time granularity.

Enums
TIME_GRANULARITY_UNIT_UNSPECIFIED Should not be used.
HOUR A period of 60 minutes.
DAY A period of 24 hours.
WEEK A period of 7 days.
MONTH A period of one calendar month.
YEAR A period of 12 calendar months.

SplitPercentageConfig

An additional configuration for a data split by percentages. trainSetPercentage, validationSetPercentage, and testSetPercentage must all add up to 100.

JSON representation
{
  "trainSetPercentage": number,
  "validationSetPercentage": number,
  "testSetPercentage": number
}
Fields
trainSetPercentage

number

Required. The percentage of data to reserve for the training set.

validationSetPercentage

number

Required. The percentage of data to reserve for the validation set.

testSetPercentage

number

Required. The percentage of data to reserve for the test set.

PredictionType

The type of prediction this model is providing.

The available and default prediction types depend on

target_column's

dataType and, possibly, number of distinct values in that column:

  • CATEGORY, two distinct values: CLASSIFICATION_BINARY (default)

  • CATEGORY, more than two distinct values: CLASSIFICATION_MULTI_CLASS (default)

  • ARRAY(CATEGORY): CLASSIFICATION_MULTI_LABEL (default)

  • FLOAT64: REGRESSION (default) FORECASTING

Enums
PREDICTION_TYPE_UNSPECIFIED An un-set value of this enum, must not be used.
CLASSIFICATION_BINARY One out of two target values is picked per example.
CLASSIFICATION_MULTI_CLASS One out of multiple target values is picked per example.
CLASSIFICATION_MULTI_LABEL Multiple values are picked per example.
REGRESSION A value is chosen based on its relation to other values.
FORECASTING

A value for a new timestamp is chosen, based on the historical time series data. Time series for multiple entities, which are identified by

key, column(s) may be forecast by a single model. The use of this prediction type has following requirements: * primary_table_spec's'

timeColumnSpecId must be set, and must be not nullable. * Each

input_feature_column_spec, except for time_column_spec must have

forecastingMetadata set (note that

targetColumnSpec is separate and needs not this information). * The

forecastingConfig must be set.

TablesModelColumnInfo

An information specific to given column and Tables Model, in context of the Model and the predictions created by it.

JSON representation
{
  "columnSpecName": string,
  "columnDisplayName": string,
  "featureImportance": number
}
Fields
columnSpecName

string

Output only. The name of the ColumnSpec describing the column. Not populated when this proto is outputted to BigQuery.

columnDisplayName

string

Output only. The display name of the column (same as the displayName of its ColumnSpec).

featureImportance

number

Output only. When given as part of a Model (always populated): Measurement of how much model predictions correctness on the TEST data depend on values in this column. A value between 0 and 1, higher means higher influence. These values are normalized - for all input feature columns of a given model they add to 1.

When given back by models.predict (populated iff featureImportance param is set) or Batch models.predict (populated iff featureImportance param is set): Measurement of how impactful for the prediction returned for the given row the value in this column was. A value between 0 and 1, higher means larger impact. These values are normalized - for all input feature columns of a single predicted row they add to 1.

DeploymentState

Deployment state of the model.

Enums
DEPLOYMENT_STATE_UNSPECIFIED Should not be used, an un-set enum has this value by default.
DEPLOYED Model is deployed.
UNDEPLOYED Model is not deployed.

Methods

batchPredict

Perform a batch prediction and return the id of a long-running operation.

create

Creates a model.

delete

Deletes a model.

deploy

Deploys a model.

exportEvaluatedExamples

Exports examples on which the model was evaluated (i.e.

get

Gets a model.

getIamPolicy

Gets the access control policy for a resource.

list

Lists models.

predict

Perform an online prediction.

setIamPolicy

Sets the access control policy on the specified resource.

undeploy

Removes a deployed model.
このページは役立ちましたか?評価をお願いいたします。

フィードバックを送信...