Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: class Resource</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | <p> |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 7 | <tr bgcolor="#ffc8d8"> |
| 8 | <td colspan=3 valign=bottom> <br> |
| 9 | <font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 10 | |
| 11 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 12 | <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| 13 | <tr><td> </td> |
| 14 | <td width="100%">Methods defined here:<br> |
| 15 | <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 16 | |
| 17 | <dl><dt><a name="Resource-predict"><strong>predict</strong></a> = method(self, **kwargs)</dt><dd><tt>Submit input and request an output against a hosted model.<br> |
| 18 | <br> |
| 19 | Args:<br> |
| 20 | body: object, The request body. (required)<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 21 | The object takes the form of:<br> |
| 22 | <br> |
| 23 | {<br> |
| 24 | "input": { # Input to the model for a prediction<br> |
| 25 | "csvInstance": [ # A list of input features, these can be strings or doubles.<br> |
| 26 | "",<br> |
| 27 | ],<br> |
| 28 | },<br> |
| 29 | }<br> |
| 30 | <br> |
| 31 | hostedModelName: string, The name of a hosted model. (required)<br> |
| 32 | <br> |
| 33 | Returns:<br> |
| 34 | An object of the form<br> |
| 35 | <br> |
| 36 | {<br> |
| 37 | "kind": "prediction#output", # What kind of resource this is.<br> |
| 38 | "outputLabel": "A String", # The most likely class label [Categorical models only].<br> |
| 39 | "id": "A String", # The unique name for the predictive model.<br> |
| 40 | "outputMulti": [ # A list of class labels with their estimated probabilities [Categorical models only].<br> |
| 41 | {<br> |
| 42 | "score": 3.140000, # The probability of the class label.<br> |
| 43 | "label": "A String", # The class label.<br> |
| 44 | },<br> |
| 45 | ],<br> |
| 46 | "outputValue": 3.140000, # The estimated regression value [Regression models only].<br> |
| 47 | "selfLink": "A String", # A URL to re-request this resource.<br> |
| 48 | }</tt></dd></dl> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 49 | |
| 50 | <hr> |
| 51 | Data descriptors defined here:<br> |
| 52 | <dl><dt><strong>__dict__</strong></dt> |
| 53 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 54 | </dl> |
| 55 | <dl><dt><strong>__weakref__</strong></dt> |
| 56 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 57 | </dl> |
| 58 | </td></tr></table> |
| 59 | </body></html> |