gogol-ml-0.2.0: Google Cloud Machine Learning SDK.

Copyright(c) 2015-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Google.Resource.Ml.Projects.Predict

Contents

Description

Performs prediction on the data in the request. Responses are very similar to requests. There are two top-level fields, each of which are JSON lists:

predictions
The list of predictions, one per instance in the request.
error
An error message returned instead of a prediction list if any instance produced an error.

If the call is successful, the response body will contain one prediction entry per instance in the request body. If prediction fails for any instance, the response body will contain no predictions and will contian a single error entry instead. Even though there is one prediction per instance, the format of a prediction is not directly related to the format of an instance. Predictions take whatever format is specified in the outputs collection defined in the model. The collection of predictions is returned in a JSON list. Each member of the list can be a simple value, a list, or a JSON object of any complexity. If your model has more than one output tensor, each prediction will be a JSON object containing a name/value pair for each output. The names identify the output aliases in the graph. The following examples show some possible responses: A simple set of predictions for three input instances, where each prediction is an integer value:

{"predictions": [5, 4, 3]}

A more complex set of predictions, each containing two named values that correspond to output tensors, named **label** and **scores** respectively. The value of **label** is the predicted category ("car" or "beach") and **scores** contains a list of probabilities for that instance across the possible categories.

{"predictions": [{"label": "beach", "scores": [0.1, 0.9]},
                 {"label": "car", "scores": [0.75, 0.25]}]}

A response when there is an error processing an input instance:

{"error": "Divide by zero"}

See: Google Cloud Machine Learning Reference for ml.projects.predict.

Synopsis

REST Resource

type ProjectsPredictResource = "v1beta1" :> (CaptureMode "name" "predict" Text :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "pp" Bool :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "bearer_token" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] GoogleCloudMlV1beta1__PredictRequest :> Post '[JSON] GoogleAPI__HTTPBody)))))))))) Source #

A resource alias for ml.projects.predict method which the ProjectsPredict request conforms to.

Creating a Request

projectsPredict Source #

Creates a value of ProjectsPredict with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data ProjectsPredict Source #

Performs prediction on the data in the request. Responses are very similar to requests. There are two top-level fields, each of which are JSON lists:

predictions
The list of predictions, one per instance in the request.
error
An error message returned instead of a prediction list if any instance produced an error.

If the call is successful, the response body will contain one prediction entry per instance in the request body. If prediction fails for any instance, the response body will contain no predictions and will contian a single error entry instead. Even though there is one prediction per instance, the format of a prediction is not directly related to the format of an instance. Predictions take whatever format is specified in the outputs collection defined in the model. The collection of predictions is returned in a JSON list. Each member of the list can be a simple value, a list, or a JSON object of any complexity. If your model has more than one output tensor, each prediction will be a JSON object containing a name/value pair for each output. The names identify the output aliases in the graph. The following examples show some possible responses: A simple set of predictions for three input instances, where each prediction is an integer value:

{"predictions": [5, 4, 3]}

A more complex set of predictions, each containing two named values that correspond to output tensors, named **label** and **scores** respectively. The value of **label** is the predicted category ("car" or "beach") and **scores** contains a list of probabilities for that instance across the possible categories.

{"predictions": [{"label": "beach", "scores": [0.1, 0.9]},
                 {"label": "car", "scores": [0.75, 0.25]}]}

A response when there is an error processing an input instance:

{"error": "Divide by zero"}

See: projectsPredict smart constructor.

Instances

Eq ProjectsPredict Source # 
Data ProjectsPredict Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProjectsPredict -> c ProjectsPredict #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ProjectsPredict #

toConstr :: ProjectsPredict -> Constr #

dataTypeOf :: ProjectsPredict -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ProjectsPredict) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ProjectsPredict) #

gmapT :: (forall b. Data b => b -> b) -> ProjectsPredict -> ProjectsPredict #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsPredict -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsPredict -> r #

gmapQ :: (forall d. Data d => d -> u) -> ProjectsPredict -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ProjectsPredict -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProjectsPredict -> m ProjectsPredict #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsPredict -> m ProjectsPredict #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsPredict -> m ProjectsPredict #

Show ProjectsPredict Source # 
Generic ProjectsPredict Source # 
GoogleRequest ProjectsPredict Source # 
type Rep ProjectsPredict Source # 
type Scopes ProjectsPredict Source # 
type Scopes ProjectsPredict = (:) Symbol "https://www.googleapis.com/auth/cloud-platform" ([] Symbol)
type Rs ProjectsPredict Source # 

Request Lenses

ppUploadProtocol :: Lens' ProjectsPredict (Maybe Text) Source #

Upload protocol for media (e.g. "raw", "multipart").

ppPp :: Lens' ProjectsPredict Bool Source #

Pretty-print response.

ppUploadType :: Lens' ProjectsPredict (Maybe Text) Source #

Legacy upload protocol for media (e.g. "media", "multipart").

ppName :: Lens' ProjectsPredict Text Source #

Required. The resource name of a model or a version. Authorization: requires `Viewer` role on the parent project.