Google_Service_CloudMachineLearning_Resource_Projects
extends Google_Service_Resource
in package
The "projects" collection of methods.
Typical usage is:
$mlService = new Google_Service_CloudMachineLearning(...);
$projects = $mlService->projects;
Table of Contents
- $client : Google_Client
- $methods : array<string|int, mixed>
- $resourceName : string
- $rootUrl : string
- $serviceName : string
- $servicePath : string
- $stackParameters : mixed
- __construct() : mixed
- call() : Google_Http_Request|expectedClass
- TODO: This function needs simplifying.
- createRequestUri() : string
- Parse/expand request parameters and create a fully qualified request uri.
- getConfig() : Google_Service_CloudMachineLearning_GoogleCloudMlV1beta1GetConfigResponse
- Get the service account information associated with your project. You need this information in order to grant the service account persmissions for the Google Cloud Storage location where you put your model training code for training the model with Google Cloud Machine Learning. (projects.getConfig)
- predict() : Google_Service_CloudMachineLearning_GoogleApiHttpBody
- Performs prediction on the data in the request.
- convertToArrayAndStripNulls() : mixed
Properties
$client
private
Google_Client
$client
$methods
private
array<string|int, mixed>
$methods
$resourceName
private
string
$resourceName
$rootUrl
private
string
$rootUrl
$serviceName
private
string
$serviceName
$servicePath
private
string
$servicePath
$stackParameters
private
mixed
$stackParameters
= array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))
Methods
__construct()
public
__construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
- $service : mixed
- $serviceName : mixed
- $resourceName : mixed
- $resource : mixed
Return values
mixed —call()
TODO: This function needs simplifying.
public
call( $name, $arguments[, $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
Tags
Return values
Google_Http_Request|expectedClass —createRequestUri()
Parse/expand request parameters and create a fully qualified request uri.
public
createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
- $restPath : string
- $params : array<string|int, mixed>
Tags
Return values
string —$requestUrl
getConfig()
Get the service account information associated with your project. You need this information in order to grant the service account persmissions for the Google Cloud Storage location where you put your model training code for training the model with Google Cloud Machine Learning. (projects.getConfig)
public
getConfig(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudMachineLearning_GoogleCloudMlV1beta1GetConfigResponse
Parameters
- $name : string
-
Required. The project name.
Authorization: requires
Viewerrole on the specified project. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudMachineLearning_GoogleCloudMlV1beta1GetConfigResponse —predict()
Performs prediction on the data in the request.
public
predict(string $name, Google_Service_CloudMachineLearning_GoogleCloudMlV1beta1PredictRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudMachineLearning_GoogleApiHttpBody
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"} (projects.predict)
Parameters
- $name : string
-
Required. The resource name of a model or a version.
Authorization: requires
Viewerrole on the parent project. - $postBody : Google_Service_CloudMachineLearning_GoogleCloudMlV1beta1PredictRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_CloudMachineLearning_GoogleApiHttpBody —convertToArrayAndStripNulls()
protected
convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
- $o : mixed