• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="prediction_v1_3.html">Prediction API</a> . <a href="prediction_v1_3.training.html">training</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#delete">delete(data)</a></code></p>
79<p class="firstline">Delete a trained model</p>
80<p class="toc_element">
81  <code><a href="#get">get(data)</a></code></p>
82<p class="firstline">Check training status of your model</p>
83<p class="toc_element">
84  <code><a href="#insert">insert(body)</a></code></p>
85<p class="firstline">Begin training your model</p>
86<p class="toc_element">
87  <code><a href="#predict">predict(data, body)</a></code></p>
88<p class="firstline">Submit data and request a prediction</p>
89<p class="toc_element">
90  <code><a href="#update">update(data, body)</a></code></p>
91<p class="firstline">Add new data to a trained model</p>
92<h3>Method Details</h3>
93<div class="method">
94    <code class="details" id="delete">delete(data)</code>
95  <pre>Delete a trained model
96
97Args:
98  data: string, mybucket/mydata resource in Google Storage (required)
99</pre>
100</div>
101
102<div class="method">
103    <code class="details" id="get">get(data)</code>
104  <pre>Check training status of your model
105
106Args:
107  data: string, mybucket/mydata resource in Google Storage (required)
108
109Returns:
110  An object of the form:
111
112    {
113      "kind": "prediction#training", # What kind of resource this is.
114      "trainingStatus": "A String", # The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND
115      "modelInfo": { # Model metadata.
116        "confusionMatrixRowTotals": { # A list of the confusion matrix row totals
117          "a_key": 3.14, # The true class associated with how many instances it had
118        },
119        "confusionMatrix": { # An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].
120          "a_key": { # The true class label.
121            "a_key": 3.14, # The pair {predicted_label, count}.
122          },
123        },
124        "meanSquaredError": 3.14, # An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].
125        "modelType": "A String", # Type of predictive model (CLASSIFICATION or REGRESSION)
126        "numberInstances": "A String", # Number of valid data instances used in the trained model.
127        "numberClasses": "A String", # Number of classes in the trained model [Categorical models only].
128        "classWeightedAccuracy": 3.14, # Estimated accuracy of model taking utility weights into account [Categorical models only].
129        "classificationAccuracy": 3.14, # 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 [Categorical models only].
130      },
131      "id": "A String", # The unique name for the predictive model.
132      "selfLink": "A String", # A URL to re-request this resource.
133      "utility": [ # A class weighting function, which allows the importance weights for classes to be specified [Categorical models only].
134        { # Class label (string).
135          "a_key": 3.14,
136        },
137      ],
138    }</pre>
139</div>
140
141<div class="method">
142    <code class="details" id="insert">insert(body)</code>
143  <pre>Begin training your model
144
145Args:
146  body: object, The request body. (required)
147    The object takes the form of:
148
149{
150    "kind": "prediction#training", # What kind of resource this is.
151    "trainingStatus": "A String", # The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND
152    "modelInfo": { # Model metadata.
153      "confusionMatrixRowTotals": { # A list of the confusion matrix row totals
154        "a_key": 3.14, # The true class associated with how many instances it had
155      },
156      "confusionMatrix": { # An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].
157        "a_key": { # The true class label.
158          "a_key": 3.14, # The pair {predicted_label, count}.
159        },
160      },
161      "meanSquaredError": 3.14, # An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].
162      "modelType": "A String", # Type of predictive model (CLASSIFICATION or REGRESSION)
163      "numberInstances": "A String", # Number of valid data instances used in the trained model.
164      "numberClasses": "A String", # Number of classes in the trained model [Categorical models only].
165      "classWeightedAccuracy": 3.14, # Estimated accuracy of model taking utility weights into account [Categorical models only].
166      "classificationAccuracy": 3.14, # 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 [Categorical models only].
167    },
168    "id": "A String", # The unique name for the predictive model.
169    "selfLink": "A String", # A URL to re-request this resource.
170    "utility": [ # A class weighting function, which allows the importance weights for classes to be specified [Categorical models only].
171      { # Class label (string).
172        "a_key": 3.14,
173      },
174    ],
175  }
176
177
178Returns:
179  An object of the form:
180
181    {
182      "kind": "prediction#training", # What kind of resource this is.
183      "trainingStatus": "A String", # The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND
184      "modelInfo": { # Model metadata.
185        "confusionMatrixRowTotals": { # A list of the confusion matrix row totals
186          "a_key": 3.14, # The true class associated with how many instances it had
187        },
188        "confusionMatrix": { # An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].
189          "a_key": { # The true class label.
190            "a_key": 3.14, # The pair {predicted_label, count}.
191          },
192        },
193        "meanSquaredError": 3.14, # An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].
194        "modelType": "A String", # Type of predictive model (CLASSIFICATION or REGRESSION)
195        "numberInstances": "A String", # Number of valid data instances used in the trained model.
196        "numberClasses": "A String", # Number of classes in the trained model [Categorical models only].
197        "classWeightedAccuracy": 3.14, # Estimated accuracy of model taking utility weights into account [Categorical models only].
198        "classificationAccuracy": 3.14, # 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 [Categorical models only].
199      },
200      "id": "A String", # The unique name for the predictive model.
201      "selfLink": "A String", # A URL to re-request this resource.
202      "utility": [ # A class weighting function, which allows the importance weights for classes to be specified [Categorical models only].
203        { # Class label (string).
204          "a_key": 3.14,
205        },
206      ],
207    }</pre>
208</div>
209
210<div class="method">
211    <code class="details" id="predict">predict(data, body)</code>
212  <pre>Submit data and request a prediction
213
214Args:
215  data: string, mybucket/mydata resource in Google Storage (required)
216  body: object, The request body. (required)
217    The object takes the form of:
218
219{
220    "input": { # Input to the model for a prediction
221      "csvInstance": [ # A list of input features, these can be strings or doubles.
222        "",
223      ],
224    },
225  }
226
227
228Returns:
229  An object of the form:
230
231    {
232    "kind": "prediction#output", # What kind of resource this is.
233    "outputLabel": "A String", # The most likely class [Categorical models only].
234    "id": "A String", # The unique name for the predictive model.
235    "outputMulti": [ # A list of classes with their estimated probabilities [Categorical models only].
236      {
237        "score": 3.14, # The probability of the class.
238        "label": "A String", # The class label.
239      },
240    ],
241    "outputValue": 3.14, # The estimated regression value [Regression models only].
242    "selfLink": "A String", # A URL to re-request this resource.
243  }</pre>
244</div>
245
246<div class="method">
247    <code class="details" id="update">update(data, body)</code>
248  <pre>Add new data to a trained model
249
250Args:
251  data: string, mybucket/mydata resource in Google Storage (required)
252  body: object, The request body. (required)
253    The object takes the form of:
254
255{
256    "classLabel": "A String", # The true class label of this instance
257    "csvInstance": [ # The input features for this instance
258      "",
259    ],
260  }
261
262
263Returns:
264  An object of the form:
265
266    {
267      "kind": "prediction#training", # What kind of resource this is.
268      "trainingStatus": "A String", # The current status of the training job. This can be one of following: RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND
269      "modelInfo": { # Model metadata.
270        "confusionMatrixRowTotals": { # A list of the confusion matrix row totals
271          "a_key": 3.14, # The true class associated with how many instances it had
272        },
273        "confusionMatrix": { # An output confusion matrix. This shows an estimate for how this model will do in predictions. This is first indexed by the true class label. For each true class label, this provides a pair {predicted_label, count}, where count is the estimated number of times the model will predict the predicted label given the true label. Will not output if more then 100 classes [Categorical models only].
274          "a_key": { # The true class label.
275            "a_key": 3.14, # The pair {predicted_label, count}.
276          },
277        },
278        "meanSquaredError": 3.14, # An estimated mean squared error. The can be used to measure the quality of the predicted model [Regression models only].
279        "modelType": "A String", # Type of predictive model (CLASSIFICATION or REGRESSION)
280        "numberInstances": "A String", # Number of valid data instances used in the trained model.
281        "numberClasses": "A String", # Number of classes in the trained model [Categorical models only].
282        "classWeightedAccuracy": 3.14, # Estimated accuracy of model taking utility weights into account [Categorical models only].
283        "classificationAccuracy": 3.14, # 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 [Categorical models only].
284      },
285      "id": "A String", # The unique name for the predictive model.
286      "selfLink": "A String", # A URL to re-request this resource.
287      "utility": [ # A class weighting function, which allows the importance weights for classes to be specified [Categorical models only].
288        { # Class label (string).
289          "a_key": 3.14,
290        },
291      ],
292    }</pre>
293</div>
294
295</body></html>