1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\CloudMachineLearningEngine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1AddTrialMeasurementRequest;
|
---|
21 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest;
|
---|
22 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1CompleteTrialRequest;
|
---|
23 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1ListOptimalTrialsRequest;
|
---|
24 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1ListOptimalTrialsResponse;
|
---|
25 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1ListTrialsResponse;
|
---|
26 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1StopTrialRequest;
|
---|
27 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1SuggestTrialsRequest;
|
---|
28 | use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1Trial;
|
---|
29 | use Google\Service\CloudMachineLearningEngine\GoogleLongrunningOperation;
|
---|
30 | use Google\Service\CloudMachineLearningEngine\GoogleProtobufEmpty;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "trials" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $mlService = new Google\Service\CloudMachineLearningEngine(...);
|
---|
37 | * $trials = $mlService->projects_locations_studies_trials;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class ProjectsLocationsStudiesTrials extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Adds a measurement of the objective metrics to a trial. This measurement is
|
---|
44 | * assumed to have been taken before the trial is complete.
|
---|
45 | * (trials.addMeasurement)
|
---|
46 | *
|
---|
47 | * @param string $name Required. The trial name.
|
---|
48 | * @param GoogleCloudMlV1AddTrialMeasurementRequest $postBody
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | * @return GoogleCloudMlV1Trial
|
---|
51 | * @throws \Google\Service\Exception
|
---|
52 | */
|
---|
53 | public function addMeasurement($name, GoogleCloudMlV1AddTrialMeasurementRequest $postBody, $optParams = [])
|
---|
54 | {
|
---|
55 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
56 | $params = array_merge($params, $optParams);
|
---|
57 | return $this->call('addMeasurement', [$params], GoogleCloudMlV1Trial::class);
|
---|
58 | }
|
---|
59 | /**
|
---|
60 | * Checks whether a trial should stop or not. Returns a long-running operation.
|
---|
61 | * When the operation is successful, it will contain a
|
---|
62 | * CheckTrialEarlyStoppingStateResponse. (trials.checkEarlyStoppingState)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The trial name.
|
---|
65 | * @param GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest $postBody
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return GoogleLongrunningOperation
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function checkEarlyStoppingState($name, GoogleCloudMlV1CheckTrialEarlyStoppingStateRequest $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('checkEarlyStoppingState', [$params], GoogleLongrunningOperation::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Marks a trial as complete. (trials.complete)
|
---|
78 | *
|
---|
79 | * @param string $name Required. The trial name.metat
|
---|
80 | * @param GoogleCloudMlV1CompleteTrialRequest $postBody
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | * @return GoogleCloudMlV1Trial
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function complete($name, GoogleCloudMlV1CompleteTrialRequest $postBody, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('complete', [$params], GoogleCloudMlV1Trial::class);
|
---|
90 | }
|
---|
91 | /**
|
---|
92 | * Adds a user provided trial to a study. (trials.create)
|
---|
93 | *
|
---|
94 | * @param string $parent Required. The name of the study that the trial belongs
|
---|
95 | * to.
|
---|
96 | * @param GoogleCloudMlV1Trial $postBody
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return GoogleCloudMlV1Trial
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function create($parent, GoogleCloudMlV1Trial $postBody, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('create', [$params], GoogleCloudMlV1Trial::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Deletes a trial. (trials.delete)
|
---|
109 | *
|
---|
110 | * @param string $name Required. The trial name.
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | * @return GoogleProtobufEmpty
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function delete($name, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['name' => $name];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Gets a trial. (trials.get)
|
---|
123 | *
|
---|
124 | * @param string $name Required. The trial name.
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | * @return GoogleCloudMlV1Trial
|
---|
127 | * @throws \Google\Service\Exception
|
---|
128 | */
|
---|
129 | public function get($name, $optParams = [])
|
---|
130 | {
|
---|
131 | $params = ['name' => $name];
|
---|
132 | $params = array_merge($params, $optParams);
|
---|
133 | return $this->call('get', [$params], GoogleCloudMlV1Trial::class);
|
---|
134 | }
|
---|
135 | /**
|
---|
136 | * Lists the trials associated with a study.
|
---|
137 | * (trials.listProjectsLocationsStudiesTrials)
|
---|
138 | *
|
---|
139 | * @param string $parent Required. The name of the study that the trial belongs
|
---|
140 | * to.
|
---|
141 | * @param array $optParams Optional parameters.
|
---|
142 | * @return GoogleCloudMlV1ListTrialsResponse
|
---|
143 | * @throws \Google\Service\Exception
|
---|
144 | */
|
---|
145 | public function listProjectsLocationsStudiesTrials($parent, $optParams = [])
|
---|
146 | {
|
---|
147 | $params = ['parent' => $parent];
|
---|
148 | $params = array_merge($params, $optParams);
|
---|
149 | return $this->call('list', [$params], GoogleCloudMlV1ListTrialsResponse::class);
|
---|
150 | }
|
---|
151 | /**
|
---|
152 | * Lists the pareto-optimal trials for multi-objective study or the optimal
|
---|
153 | * trials for single-objective study. The definition of pareto-optimal can be
|
---|
154 | * checked in wiki page. https://en.wikipedia.org/wiki/Pareto_efficiency
|
---|
155 | * (trials.listOptimalTrials)
|
---|
156 | *
|
---|
157 | * @param string $parent Required. The name of the study that the pareto-optimal
|
---|
158 | * trial belongs to.
|
---|
159 | * @param GoogleCloudMlV1ListOptimalTrialsRequest $postBody
|
---|
160 | * @param array $optParams Optional parameters.
|
---|
161 | * @return GoogleCloudMlV1ListOptimalTrialsResponse
|
---|
162 | * @throws \Google\Service\Exception
|
---|
163 | */
|
---|
164 | public function listOptimalTrials($parent, GoogleCloudMlV1ListOptimalTrialsRequest $postBody, $optParams = [])
|
---|
165 | {
|
---|
166 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
167 | $params = array_merge($params, $optParams);
|
---|
168 | return $this->call('listOptimalTrials', [$params], GoogleCloudMlV1ListOptimalTrialsResponse::class);
|
---|
169 | }
|
---|
170 | /**
|
---|
171 | * Stops a trial. (trials.stop)
|
---|
172 | *
|
---|
173 | * @param string $name Required. The trial name.
|
---|
174 | * @param GoogleCloudMlV1StopTrialRequest $postBody
|
---|
175 | * @param array $optParams Optional parameters.
|
---|
176 | * @return GoogleCloudMlV1Trial
|
---|
177 | * @throws \Google\Service\Exception
|
---|
178 | */
|
---|
179 | public function stop($name, GoogleCloudMlV1StopTrialRequest $postBody, $optParams = [])
|
---|
180 | {
|
---|
181 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
182 | $params = array_merge($params, $optParams);
|
---|
183 | return $this->call('stop', [$params], GoogleCloudMlV1Trial::class);
|
---|
184 | }
|
---|
185 | /**
|
---|
186 | * Adds one or more trials to a study, with parameter values suggested by AI
|
---|
187 | * Platform Vizier. Returns a long-running operation associated with the
|
---|
188 | * generation of trial suggestions. When this long-running operation succeeds,
|
---|
189 | * it will contain a SuggestTrialsResponse. (trials.suggest)
|
---|
190 | *
|
---|
191 | * @param string $parent Required. The name of the study that the trial belongs
|
---|
192 | * to.
|
---|
193 | * @param GoogleCloudMlV1SuggestTrialsRequest $postBody
|
---|
194 | * @param array $optParams Optional parameters.
|
---|
195 | * @return GoogleLongrunningOperation
|
---|
196 | * @throws \Google\Service\Exception
|
---|
197 | */
|
---|
198 | public function suggest($parent, GoogleCloudMlV1SuggestTrialsRequest $postBody, $optParams = [])
|
---|
199 | {
|
---|
200 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
201 | $params = array_merge($params, $optParams);
|
---|
202 | return $this->call('suggest', [$params], GoogleLongrunningOperation::class);
|
---|
203 | }
|
---|
204 | }
|
---|
205 |
|
---|
206 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
207 | class_alias(ProjectsLocationsStudiesTrials::class, 'Google_Service_CloudMachineLearningEngine_Resource_ProjectsLocationsStudiesTrials');
|
---|