Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Trainedmodels: insert

Requires authorization

Train a Prediction API model. Try it now .

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,
  "storagePMMLModelLocation": 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.
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.
storagePMMLModelLocation string Google storage location of the pmml model 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,
  "storagePMMLModelLocation": 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.
storagePMMLModelLocation string Google storage location of the pmml model 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 .

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.