The Google Cloud Prediction API has been deprecated and will be shut down on April 30, 2018.

Trainedmodels: insert

Requires authorization

Train a Prediction API model. Try it now.

If you train a model that already exists in a project, the model will be overwritten.

Request

HTTP request

POST https://www.googleapis.com/prediction/v1.6/projects/project/trainedmodels

Parameters

Parameter name Value Description
Required parameters
project string The project associated with the model.

Authorization

This request requires authorization with at least one of the following scopes (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/prediction
https://www.googleapis.com/auth/devstorage.read_write (optional)
https://www.googleapis.com/auth/devstorage.full_control (optional)
https://www.googleapis.com/auth/devstorage.read_only (optional)

Request body

In the request body, supply data with the following structure:

{
  "id": string,
  "sourceModel": string,
  "storageDataLocation": string,
  "storagePMMLLocation": string,
  "modelType": string,
  "trainingInstances": [
    {
      "output": string,
      "csvInstance": [
        (value)
      ]
    }
  ],
  "utility": [
    {
      (key): double
    }
  ]
}
Property name Value Description Notes
id string The unique name for the predictive model. If this model already exists in the project, it will be overwritten.
sourceModel string The Id of the model to be copied over.
storageDataLocation string Google storage location of the training data file.
storagePMMLLocation string Google storage location of the preprocessing pmml file.
modelType string Type of predictive model (CLASSIFICATION or REGRESSION)
trainingInstances[] list Instances to train model on.
trainingInstances[].output string The generic output value - could be regression or class label.
trainingInstances[].csvInstance[] list The input features for this instance.
utility[] list A class weighting function, which allows the importance weights for class labels to be specified (Categorical models only).
utility[].(key) double

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "prediction#training",
  "id": string,
  "selfLink": string,
  "storageDataLocation": string,
  "storagePMMLLocation": string,
  "modelType": string
}
Property name Value Description Notes
kind string What kind of resource this is.
id string The unique name for the predictive model.
storageDataLocation string Google storage location of the training data file.
storagePMMLLocation string Google storage location of the preprocessing pmml file.
modelType string Type of predictive model (CLASSIFICATION or REGRESSION).

Try it!

Use the APIs Explorer below to call this method on live data and see the response. Alternatively, try the standalone Explorer.

Send feedback about...

Prediction API Documentation