Google Prediction API

Trainedmodels

Trained models are trained models that you own.

For a list of methods for this resource, see the end of this page.

Resource representations

{
  "kind": "prediction#training",
  "id": string,
  "storageDataLocation": string,
  "storagePMMLLocation": string,
  "storagePMMLModelLocation": string,
  "modelType": string,
  "trainingInstances": [
    {
      "output": string,
      "csvInstance": [
        (value)
      ]
    }
  ],
  "selfLink": string,
  "utility": [
    {
      (key): double
    }
  ],
  "created": datetime,
  "trainingComplete": datetime,
  "modelInfo": {
    "numberInstances": long,
    "modelType": string,
    "numberLabels": long,
    "classificationAccuracy": double,
    "classWeightedAccuracy": double,
    "meanSquaredError": double
  },
  "trainingStatus": string
}
Property name Value Description Notes
kind string What kind of resource this is.
id string The unique name for the predictive model.A name for the predictive model, unique within this user account. Naming restrictions are 1-255 characters long, any mix of digits, lowercase letters, dashes, and underscores: [0-9a-z_\-] 
storageDataLocation string Google storage location of the training data file.
storagePMMLLocation string Google storage location of the pre-processing PMML file. See Importing PMML Models for details. 
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
[Categorical models only] A class label weighting function, which allows the importance weights for class labels to be specified. See prediction.trainedmodels.insert() for details.

The format of this array is: [{'label1':val_1},{'label2':val_2}] where the value is a positive double precision value. Not all labels must be specified; default value for unspecified labels is 1.0. Labels must match example labels exactly. Example: 'utility': [ {'not_spam' : 5}, {'spam' : 1} ]
utility[].(key) double
created datetime Insert time of the model (as a RFC 3339 timestamp).
trainingComplete datetime Training completion time (as a RFC 3339 timestamp).
modelInfo object Model metadata.
modelInfo.numberInstances long Number of valid data instances used in the trained model.
modelInfo.modelType string Type of predictive model (CLASSIFICATION or REGRESSION)
modelInfo.numberLabels long [Categorical models only] Number of class labels in the trained model.
modelInfo.classificationAccuracy double [Categorical models only] A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an estimate, based on the amount and quality of the training data, of the estimated prediction accuracy. You can use this is a guide to decide whether the results are accurate enough for your needs. This estimate will be more reliable if your real input data is similar to your training data.

If you are retraining an existing model, the modelInfo field will show an accuracy value in even if the new training is not complete. This number will be the accuracy of the previously trained model, which is still usable, until the new model has finished training.
modelInfo.classWeightedAccuracy double [Categorical models only] Estimated accuracy of model taking utility weights into account.
modelInfo.meanSquaredError double [Regression models only] An estimated mean squared error. The can be used to measure the quality of the predicted model.
trainingStatus string The current status of the training job. This can be one of following:
  • RUNNING - Only returned when retraining a model; for a new model, a trainedmodels.get call will return HTTP 200 before training is complete.
  • DONE
  • ERROR
  • ERROR: NO VALID DATA INSTANCES
  • ERROR: TRAINING JOB NOT FOUND
  • ERROR: TRAINING TIME LIMIT EXCEEDED
  • ERROR: TRAINING SYSTEM CAPACITY EXCEEDED
  • ERROR: TRAINING DATA FILE SIZE LIMIT ERROR
  • ERROR: STORAGE LOCATION IS INVALID

Methods

analyze
Get analysis of the model and the data the model was trained on.
delete
Delete a trained model.
get
Check training status of your model.
insert
Begin training your model.
list
List available models.
predict
Submit model id and request a prediction.
update
Add new data to a trained model.

Authentication required

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

Signing you in...

Google Developers needs your permission to do that.