Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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="ml_v1beta1.html">Google Cloud Machine Learning</a> . <a href="ml_v1beta1.projects.html">projects</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="ml_v1beta1.projects.jobs.html">jobs()</a></code> |
| 79 | </p> |
| 80 | <p class="firstline">Returns the jobs Resource.</p> |
| 81 | |
| 82 | <p class="toc_element"> |
| 83 | <code><a href="ml_v1beta1.projects.models.html">models()</a></code> |
| 84 | </p> |
| 85 | <p class="firstline">Returns the models Resource.</p> |
| 86 | |
| 87 | <p class="toc_element"> |
| 88 | <code><a href="ml_v1beta1.projects.operations.html">operations()</a></code> |
| 89 | </p> |
| 90 | <p class="firstline">Returns the operations Resource.</p> |
| 91 | |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#getConfig">getConfig(name=None, x__xgafv=None)</a></code></p> |
| 94 | <p class="firstline">Get the service account information associated with your project. You need</p> |
| 95 | <p class="toc_element"> |
| 96 | <code><a href="#predict">predict(name=None, body, x__xgafv=None)</a></code></p> |
| 97 | <p class="firstline">Performs prediction on the data in the request.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
| 100 | <code class="details" id="getConfig">getConfig(name=None, x__xgafv=None)</code> |
| 101 | <pre>Get the service account information associated with your project. You need |
| 102 | this information in order to grant the service account persmissions for |
| 103 | the Google Cloud Storage location where you put your model training code |
| 104 | for training the model with Google Cloud Machine Learning. |
| 105 | |
| 106 | Args: |
| 107 | name: string, Required. The project name. |
| 108 | |
| 109 | Authorization: requires `Viewer` role on the specified project. (required) |
| 110 | x__xgafv: string, V1 error format. |
| 111 | Allowed values |
| 112 | 1 - v1 error format |
| 113 | 2 - v2 error format |
| 114 | |
| 115 | Returns: |
| 116 | An object of the form: |
| 117 | |
| 118 | { # Returns service account information associated with a project. |
| 119 | "serviceAccountProject": "A String", # The project number for `service_account`. |
| 120 | "serviceAccount": "A String", # The service account Cloud ML uses to access resources in the project. |
| 121 | }</pre> |
| 122 | </div> |
| 123 | |
| 124 | <div class="method"> |
| 125 | <code class="details" id="predict">predict(name=None, body, x__xgafv=None)</code> |
| 126 | <pre>Performs prediction on the data in the request. |
| 127 | |
| 128 | Responses are very similar to requests. There are two top-level fields, |
| 129 | each of which are JSON lists: |
| 130 | |
| 131 | <dl> |
| 132 | <dt>predictions</dt> |
| 133 | <dd>The list of predictions, one per instance in the request.</dd> |
| 134 | <dt>error</dt> |
| 135 | <dd>An error message returned instead of a prediction list if any |
| 136 | instance produced an error.</dd> |
| 137 | </dl> |
| 138 | |
| 139 | If the call is successful, the response body will contain one prediction |
| 140 | entry per instance in the request body. If prediction fails for any |
| 141 | instance, the response body will contain no predictions and will contian |
| 142 | a single error entry instead. |
| 143 | |
| 144 | Even though there is one prediction per instance, the format of a |
| 145 | prediction is not directly related to the format of an instance. |
| 146 | Predictions take whatever format is specified in the outputs collection |
| 147 | defined in the model. The collection of predictions is returned in a JSON |
| 148 | list. Each member of the list can be a simple value, a list, or a JSON |
| 149 | object of any complexity. If your model has more than one output tensor, |
| 150 | each prediction will be a JSON object containing a name/value pair for each |
| 151 | output. The names identify the output aliases in the graph. |
| 152 | |
| 153 | The following examples show some possible responses: |
| 154 | |
| 155 | A simple set of predictions for three input instances, where each |
| 156 | prediction is an integer value: |
| 157 | <pre> |
| 158 | {"predictions": [5, 4, 3]} |
| 159 | </pre> |
| 160 | A more complex set of predictions, each containing two named values that |
| 161 | correspond to output tensors, named **label** and **scores** respectively. |
| 162 | The value of **label** is the predicted category ("car" or "beach") and |
| 163 | **scores** contains a list of probabilities for that instance across the |
| 164 | possible categories. |
| 165 | <pre> |
| 166 | {"predictions": [{"label": "beach", "scores": [0.1, 0.9]}, |
| 167 | {"label": "car", "scores": [0.75, 0.25]}]} |
| 168 | </pre> |
| 169 | A response when there is an error processing an input instance: |
| 170 | <pre> |
| 171 | {"error": "Divide by zero"} |
| 172 | </pre> |
| 173 | |
| 174 | Args: |
| 175 | name: string, Required. The resource name of a model or a version. |
| 176 | |
| 177 | Authorization: requires `Viewer` role on the parent project. (required) |
| 178 | body: object, The request body. (required) |
| 179 | The object takes the form of: |
| 180 | |
| 181 | { # Request for predictions to be issued against a trained model. |
| 182 | # |
| 183 | # The body of the request is a single JSON object with a single top-level |
| 184 | # field: |
| 185 | # |
| 186 | # <dl> |
| 187 | # <dt>instances</dt> |
| 188 | # <dd>A JSON array containing values representing the instances to use for |
| 189 | # prediction.</dd> |
| 190 | # </dl> |
| 191 | # |
| 192 | # The structure of each element of the instances list is determined by your |
| 193 | # model's input definition. Instances can include named inputs or can contain |
| 194 | # only unlabeled values. |
| 195 | # |
| 196 | # Most data does not include named inputs. Some instances will be simple |
| 197 | # JSON values (boolean, number, or string). However, instances are often lists |
| 198 | # of simple values, or complex nested lists. Here are some examples of request |
| 199 | # bodies: |
| 200 | # |
| 201 | # CSV data with each row encoded as a string value: |
| 202 | # <pre> |
| 203 | # {"instances": ["1.0,true,\\"x\\"", "-2.0,false,\\"y\\""]} |
| 204 | # </pre> |
| 205 | # Plain text: |
| 206 | # <pre> |
| 207 | # {"instances": ["the quick brown fox", "la bruja le dio"]} |
| 208 | # </pre> |
| 209 | # Sentences encoded as lists of words (vectors of strings): |
| 210 | # <pre> |
| 211 | # {"instances": [["the","quick","brown"], ["la","bruja","le"]]} |
| 212 | # </pre> |
| 213 | # Floating point scalar values: |
| 214 | # <pre> |
| 215 | # {"instances": [0.0, 1.1, 2.2]} |
| 216 | # </pre> |
| 217 | # Vectors of integers: |
| 218 | # <pre> |
| 219 | # {"instances": [[0, 1, 2], [3, 4, 5],...]} |
| 220 | # </pre> |
| 221 | # Tensors (in this case, two-dimensional tensors): |
| 222 | # <pre> |
| 223 | # {"instances": [[[0, 1, 2], [3, 4, 5]], ...]} |
| 224 | # </pre> |
| 225 | # Images represented as a three-dimensional list. In this encoding scheme the |
| 226 | # first two dimensions represent the rows and columns of the image, and the |
| 227 | # third contains the R, G, and B values for each pixel. |
| 228 | # <pre> |
| 229 | # {"instances": [[[[138, 30, 66], [130, 20, 56], ...]]]]} |
| 230 | # </pre> |
| 231 | # Data must be encoded as UTF-8. If your data uses another character encoding, |
| 232 | # you must base64 encode the data and mark it as binary. To mark a JSON string |
| 233 | # as binary, replace it with an object with a single attribute named `b`: |
| 234 | # <pre>{"b": "..."} </pre> |
| 235 | # For example: |
| 236 | # |
| 237 | # Two Serialized tf.Examples (fake data, for illustrative purposes only): |
| 238 | # <pre> |
| 239 | # {"instances": [{"b64": "X5ad6u"}, {"b64": "IA9j4nx"}]} |
| 240 | # </pre> |
| 241 | # Two JPEG image byte strings (fake data, for illustrative purposes only): |
| 242 | # <pre> |
| 243 | # {"instances": [{"b64": "ASa8asdf"}, {"b64": "JLK7ljk3"}]} |
| 244 | # </pre> |
| 245 | # If your data includes named references, format each instance as a JSON object |
| 246 | # with the named references as the keys: |
| 247 | # |
| 248 | # JSON input data to be preprocessed: |
| 249 | # <pre> |
| 250 | # {"instances": [{"a": 1.0, "b": true, "c": "x"}, |
| 251 | # {"a": -2.0, "b": false, "c": "y"}]} |
| 252 | # </pre> |
| 253 | # Some models have an underlying TensorFlow graph that accepts multiple input |
| 254 | # tensors. In this case, you should use the names of JSON name/value pairs to |
| 255 | # identify the input tensors, as shown in the following exmaples: |
| 256 | # |
| 257 | # For a graph with input tensor aliases "tag" (string) and "image" |
| 258 | # (base64-encoded string): |
| 259 | # <pre> |
| 260 | # {"instances": [{"tag": "beach", "image": {"b64": "ASa8asdf"}}, |
| 261 | # {"tag": "car", "image": {"b64": "JLK7ljk3"}}]} |
| 262 | # </pre> |
| 263 | # For a graph with input tensor aliases "tag" (string) and "image" |
| 264 | # (3-dimensional array of 8-bit ints): |
| 265 | # <pre> |
| 266 | # {"instances": [{"tag": "beach", "image": [[[263, 1, 10], [262, 2, 11], ...]]}, |
| 267 | # {"tag": "car", "image": [[[10, 11, 24], [23, 10, 15], ...]]}]} |
| 268 | # </pre> |
| 269 | # If the call is successful, the response body will contain one prediction |
| 270 | # entry per instance in the request body. If prediction fails for any |
| 271 | # instance, the response body will contain no predictions and will contian |
| 272 | # a single error entry instead. |
| 273 | "httpBody": { # Message that represents an arbitrary HTTP body. It should only be used for # |
| 274 | # Required. The prediction request body. |
| 275 | # payload formats that can't be represented as JSON, such as raw binary or |
| 276 | # an HTML page. |
| 277 | # |
| 278 | # |
| 279 | # This message can be used both in streaming and non-streaming API methods in |
| 280 | # the request as well as the response. |
| 281 | # |
| 282 | # It can be used as a top-level request field, which is convenient if one |
| 283 | # wants to extract parameters from either the URL or HTTP template into the |
| 284 | # request fields and also want access to the raw HTTP body. |
| 285 | # |
| 286 | # Example: |
| 287 | # |
| 288 | # message GetResourceRequest { |
| 289 | # // A unique request id. |
| 290 | # string request_id = 1; |
| 291 | # |
| 292 | # // The raw HTTP body is bound to this field. |
| 293 | # google.api.HttpBody http_body = 2; |
| 294 | # } |
| 295 | # |
| 296 | # service ResourceService { |
| 297 | # rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); |
| 298 | # rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); |
| 299 | # } |
| 300 | # |
| 301 | # Example with streaming methods: |
| 302 | # |
| 303 | # service CaldavService { |
| 304 | # rpc GetCalendar(stream google.api.HttpBody) |
| 305 | # returns (stream google.api.HttpBody); |
| 306 | # rpc UpdateCalendar(stream google.api.HttpBody) |
| 307 | # returns (stream google.api.HttpBody); |
| 308 | # } |
| 309 | # |
| 310 | # Use of this type only changes how the request and response bodies are |
| 311 | # handled, all other features will continue to work unchanged. |
| 312 | "contentType": "A String", # The HTTP Content-Type string representing the content type of the body. |
| 313 | "data": "A String", # HTTP body binary data. |
| 314 | }, |
| 315 | } |
| 316 | |
| 317 | x__xgafv: string, V1 error format. |
| 318 | Allowed values |
| 319 | 1 - v1 error format |
| 320 | 2 - v2 error format |
| 321 | |
| 322 | Returns: |
| 323 | An object of the form: |
| 324 | |
| 325 | { # Message that represents an arbitrary HTTP body. It should only be used for |
| 326 | # payload formats that can't be represented as JSON, such as raw binary or |
| 327 | # an HTML page. |
| 328 | # |
| 329 | # |
| 330 | # This message can be used both in streaming and non-streaming API methods in |
| 331 | # the request as well as the response. |
| 332 | # |
| 333 | # It can be used as a top-level request field, which is convenient if one |
| 334 | # wants to extract parameters from either the URL or HTTP template into the |
| 335 | # request fields and also want access to the raw HTTP body. |
| 336 | # |
| 337 | # Example: |
| 338 | # |
| 339 | # message GetResourceRequest { |
| 340 | # // A unique request id. |
| 341 | # string request_id = 1; |
| 342 | # |
| 343 | # // The raw HTTP body is bound to this field. |
| 344 | # google.api.HttpBody http_body = 2; |
| 345 | # } |
| 346 | # |
| 347 | # service ResourceService { |
| 348 | # rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); |
| 349 | # rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); |
| 350 | # } |
| 351 | # |
| 352 | # Example with streaming methods: |
| 353 | # |
| 354 | # service CaldavService { |
| 355 | # rpc GetCalendar(stream google.api.HttpBody) |
| 356 | # returns (stream google.api.HttpBody); |
| 357 | # rpc UpdateCalendar(stream google.api.HttpBody) |
| 358 | # returns (stream google.api.HttpBody); |
| 359 | # } |
| 360 | # |
| 361 | # Use of this type only changes how the request and response bodies are |
| 362 | # handled, all other features will continue to work unchanged. |
| 363 | "contentType": "A String", # The HTTP Content-Type string representing the content type of the body. |
| 364 | "data": "A String", # HTTP body binary data. |
| 365 | }</pre> |
| 366 | </div> |
| 367 | |
| 368 | </body></html> |