OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.prediction.v1_6; | 3 library googleapis.prediction.v1_6; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client prediction/v1.6'; | 15 const core.String USER_AGENT = 'dart-api-client prediction/v1.6'; |
16 | 16 |
17 /** | 17 /// Lets you access a cloud hosted machine learning service that makes it easy |
18 * Lets you access a cloud hosted machine learning service that makes it easy to | 18 /// to build smart apps |
19 * build smart apps | |
20 */ | |
21 class PredictionApi { | 19 class PredictionApi { |
22 /** View and manage your data across Google Cloud Platform services */ | 20 /// View and manage your data across Google Cloud Platform services |
23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 21 static const CloudPlatformScope = |
| 22 "https://www.googleapis.com/auth/cloud-platform"; |
24 | 23 |
25 /** Manage your data and permissions in Google Cloud Storage */ | 24 /// Manage your data and permissions in Google Cloud Storage |
26 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev
storage.full_control"; | 25 static const DevstorageFullControlScope = |
| 26 "https://www.googleapis.com/auth/devstorage.full_control"; |
27 | 27 |
28 /** View your data in Google Cloud Storage */ | 28 /// View your data in Google Cloud Storage |
29 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto
rage.read_only"; | 29 static const DevstorageReadOnlyScope = |
| 30 "https://www.googleapis.com/auth/devstorage.read_only"; |
30 | 31 |
31 /** Manage your data in Google Cloud Storage */ | 32 /// Manage your data in Google Cloud Storage |
32 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst
orage.read_write"; | 33 static const DevstorageReadWriteScope = |
| 34 "https://www.googleapis.com/auth/devstorage.read_write"; |
33 | 35 |
34 /** Manage your data in the Google Prediction API */ | 36 /// Manage your data in the Google Prediction API |
35 static const PredictionScope = "https://www.googleapis.com/auth/prediction"; | 37 static const PredictionScope = "https://www.googleapis.com/auth/prediction"; |
36 | 38 |
37 | |
38 final commons.ApiRequester _requester; | 39 final commons.ApiRequester _requester; |
39 | 40 |
40 HostedmodelsResourceApi get hostedmodels => new HostedmodelsResourceApi(_reque
ster); | 41 HostedmodelsResourceApi get hostedmodels => |
41 TrainedmodelsResourceApi get trainedmodels => new TrainedmodelsResourceApi(_re
quester); | 42 new HostedmodelsResourceApi(_requester); |
| 43 TrainedmodelsResourceApi get trainedmodels => |
| 44 new TrainedmodelsResourceApi(_requester); |
42 | 45 |
43 PredictionApi(http.Client client, {core.String rootUrl: "https://www.googleapi
s.com/", core.String servicePath: "prediction/v1.6/projects/"}) : | 46 PredictionApi(http.Client client, |
44 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 47 {core.String rootUrl: "https://www.googleapis.com/", |
| 48 core.String servicePath: "prediction/v1.6/projects/"}) |
| 49 : _requester = |
| 50 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
45 } | 51 } |
46 | 52 |
47 | |
48 class HostedmodelsResourceApi { | 53 class HostedmodelsResourceApi { |
49 final commons.ApiRequester _requester; | 54 final commons.ApiRequester _requester; |
50 | 55 |
51 HostedmodelsResourceApi(commons.ApiRequester client) : | 56 HostedmodelsResourceApi(commons.ApiRequester client) : _requester = client; |
52 _requester = client; | |
53 | 57 |
54 /** | 58 /// Submit input and request an output against a hosted model. |
55 * Submit input and request an output against a hosted model. | 59 /// |
56 * | 60 /// [request] - The metadata request object. |
57 * [request] - The metadata request object. | 61 /// |
58 * | 62 /// Request parameters: |
59 * Request parameters: | 63 /// |
60 * | 64 /// [project] - The project associated with the model. |
61 * [project] - The project associated with the model. | 65 /// |
62 * | 66 /// [hostedModelName] - The name of a hosted model. |
63 * [hostedModelName] - The name of a hosted model. | 67 /// |
64 * | 68 /// Completes with a [Output]. |
65 * Completes with a [Output]. | 69 /// |
66 * | 70 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
67 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 71 /// an error. |
68 * error. | 72 /// |
69 * | 73 /// If the used [http.Client] completes with an error when making a REST |
70 * If the used [http.Client] completes with an error when making a REST call, | 74 /// call, this method will complete with the same error. |
71 * this method will complete with the same error. | 75 async.Future<Output> predict( |
72 */ | 76 Input request, core.String project, core.String hostedModelName) { |
73 async.Future<Output> predict(Input request, core.String project, core.String h
ostedModelName) { | |
74 var _url = null; | 77 var _url = null; |
75 var _queryParams = new core.Map(); | 78 var _queryParams = new core.Map(); |
76 var _uploadMedia = null; | 79 var _uploadMedia = null; |
77 var _uploadOptions = null; | 80 var _uploadOptions = null; |
78 var _downloadOptions = commons.DownloadOptions.Metadata; | 81 var _downloadOptions = commons.DownloadOptions.Metadata; |
79 var _body = null; | 82 var _body = null; |
80 | 83 |
81 if (request != null) { | 84 if (request != null) { |
82 _body = convert.JSON.encode((request).toJson()); | 85 _body = convert.JSON.encode((request).toJson()); |
83 } | 86 } |
84 if (project == null) { | 87 if (project == null) { |
85 throw new core.ArgumentError("Parameter project is required."); | 88 throw new core.ArgumentError("Parameter project is required."); |
86 } | 89 } |
87 if (hostedModelName == null) { | 90 if (hostedModelName == null) { |
88 throw new core.ArgumentError("Parameter hostedModelName is required."); | 91 throw new core.ArgumentError("Parameter hostedModelName is required."); |
89 } | 92 } |
90 | 93 |
91 _url = commons.Escaper.ecapeVariable('$project') + '/hostedmodels/' + common
s.Escaper.ecapeVariable('$hostedModelName') + '/predict'; | 94 _url = commons.Escaper.ecapeVariable('$project') + |
| 95 '/hostedmodels/' + |
| 96 commons.Escaper.ecapeVariable('$hostedModelName') + |
| 97 '/predict'; |
92 | 98 |
93 var _response = _requester.request(_url, | 99 var _response = _requester.request(_url, "POST", |
94 "POST", | 100 body: _body, |
95 body: _body, | 101 queryParams: _queryParams, |
96 queryParams: _queryParams, | 102 uploadOptions: _uploadOptions, |
97 uploadOptions: _uploadOptions, | 103 uploadMedia: _uploadMedia, |
98 uploadMedia: _uploadMedia, | 104 downloadOptions: _downloadOptions); |
99 downloadOptions: _downloadOptions); | |
100 return _response.then((data) => new Output.fromJson(data)); | 105 return _response.then((data) => new Output.fromJson(data)); |
101 } | 106 } |
102 | |
103 } | 107 } |
104 | 108 |
105 | |
106 class TrainedmodelsResourceApi { | 109 class TrainedmodelsResourceApi { |
107 final commons.ApiRequester _requester; | 110 final commons.ApiRequester _requester; |
108 | 111 |
109 TrainedmodelsResourceApi(commons.ApiRequester client) : | 112 TrainedmodelsResourceApi(commons.ApiRequester client) : _requester = client; |
110 _requester = client; | |
111 | 113 |
112 /** | 114 /// Get analysis of the model and the data the model was trained on. |
113 * Get analysis of the model and the data the model was trained on. | 115 /// |
114 * | 116 /// Request parameters: |
115 * Request parameters: | 117 /// |
116 * | 118 /// [project] - The project associated with the model. |
117 * [project] - The project associated with the model. | 119 /// |
118 * | 120 /// [id] - The unique name for the predictive model. |
119 * [id] - The unique name for the predictive model. | 121 /// |
120 * | 122 /// Completes with a [Analyze]. |
121 * Completes with a [Analyze]. | 123 /// |
122 * | 124 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
123 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 125 /// an error. |
124 * error. | 126 /// |
125 * | 127 /// If the used [http.Client] completes with an error when making a REST |
126 * If the used [http.Client] completes with an error when making a REST call, | 128 /// call, this method will complete with the same error. |
127 * this method will complete with the same error. | |
128 */ | |
129 async.Future<Analyze> analyze(core.String project, core.String id) { | 129 async.Future<Analyze> analyze(core.String project, core.String id) { |
130 var _url = null; | 130 var _url = null; |
131 var _queryParams = new core.Map(); | 131 var _queryParams = new core.Map(); |
132 var _uploadMedia = null; | 132 var _uploadMedia = null; |
133 var _uploadOptions = null; | 133 var _uploadOptions = null; |
134 var _downloadOptions = commons.DownloadOptions.Metadata; | 134 var _downloadOptions = commons.DownloadOptions.Metadata; |
135 var _body = null; | 135 var _body = null; |
136 | 136 |
137 if (project == null) { | 137 if (project == null) { |
138 throw new core.ArgumentError("Parameter project is required."); | 138 throw new core.ArgumentError("Parameter project is required."); |
139 } | 139 } |
140 if (id == null) { | 140 if (id == null) { |
141 throw new core.ArgumentError("Parameter id is required."); | 141 throw new core.ArgumentError("Parameter id is required."); |
142 } | 142 } |
143 | 143 |
144 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo
ns.Escaper.ecapeVariable('$id') + '/analyze'; | 144 _url = commons.Escaper.ecapeVariable('$project') + |
| 145 '/trainedmodels/' + |
| 146 commons.Escaper.ecapeVariable('$id') + |
| 147 '/analyze'; |
145 | 148 |
146 var _response = _requester.request(_url, | 149 var _response = _requester.request(_url, "GET", |
147 "GET", | 150 body: _body, |
148 body: _body, | 151 queryParams: _queryParams, |
149 queryParams: _queryParams, | 152 uploadOptions: _uploadOptions, |
150 uploadOptions: _uploadOptions, | 153 uploadMedia: _uploadMedia, |
151 uploadMedia: _uploadMedia, | 154 downloadOptions: _downloadOptions); |
152 downloadOptions: _downloadOptions); | |
153 return _response.then((data) => new Analyze.fromJson(data)); | 155 return _response.then((data) => new Analyze.fromJson(data)); |
154 } | 156 } |
155 | 157 |
156 /** | 158 /// Delete a trained model. |
157 * Delete a trained model. | 159 /// |
158 * | 160 /// Request parameters: |
159 * Request parameters: | 161 /// |
160 * | 162 /// [project] - The project associated with the model. |
161 * [project] - The project associated with the model. | 163 /// |
162 * | 164 /// [id] - The unique name for the predictive model. |
163 * [id] - The unique name for the predictive model. | 165 /// |
164 * | 166 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
165 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 167 /// an error. |
166 * error. | 168 /// |
167 * | 169 /// If the used [http.Client] completes with an error when making a REST |
168 * If the used [http.Client] completes with an error when making a REST call, | 170 /// call, this method will complete with the same error. |
169 * this method will complete with the same error. | |
170 */ | |
171 async.Future delete(core.String project, core.String id) { | 171 async.Future delete(core.String project, core.String id) { |
172 var _url = null; | 172 var _url = null; |
173 var _queryParams = new core.Map(); | 173 var _queryParams = new core.Map(); |
174 var _uploadMedia = null; | 174 var _uploadMedia = null; |
175 var _uploadOptions = null; | 175 var _uploadOptions = null; |
176 var _downloadOptions = commons.DownloadOptions.Metadata; | 176 var _downloadOptions = commons.DownloadOptions.Metadata; |
177 var _body = null; | 177 var _body = null; |
178 | 178 |
179 if (project == null) { | 179 if (project == null) { |
180 throw new core.ArgumentError("Parameter project is required."); | 180 throw new core.ArgumentError("Parameter project is required."); |
181 } | 181 } |
182 if (id == null) { | 182 if (id == null) { |
183 throw new core.ArgumentError("Parameter id is required."); | 183 throw new core.ArgumentError("Parameter id is required."); |
184 } | 184 } |
185 | 185 |
186 _downloadOptions = null; | 186 _downloadOptions = null; |
187 | 187 |
188 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo
ns.Escaper.ecapeVariable('$id'); | 188 _url = commons.Escaper.ecapeVariable('$project') + |
| 189 '/trainedmodels/' + |
| 190 commons.Escaper.ecapeVariable('$id'); |
189 | 191 |
190 var _response = _requester.request(_url, | 192 var _response = _requester.request(_url, "DELETE", |
191 "DELETE", | 193 body: _body, |
192 body: _body, | 194 queryParams: _queryParams, |
193 queryParams: _queryParams, | 195 uploadOptions: _uploadOptions, |
194 uploadOptions: _uploadOptions, | 196 uploadMedia: _uploadMedia, |
195 uploadMedia: _uploadMedia, | 197 downloadOptions: _downloadOptions); |
196 downloadOptions: _downloadOptions); | |
197 return _response.then((data) => null); | 198 return _response.then((data) => null); |
198 } | 199 } |
199 | 200 |
200 /** | 201 /// Check training status of your model. |
201 * Check training status of your model. | 202 /// |
202 * | 203 /// Request parameters: |
203 * Request parameters: | 204 /// |
204 * | 205 /// [project] - The project associated with the model. |
205 * [project] - The project associated with the model. | 206 /// |
206 * | 207 /// [id] - The unique name for the predictive model. |
207 * [id] - The unique name for the predictive model. | 208 /// |
208 * | 209 /// Completes with a [Insert2]. |
209 * Completes with a [Insert2]. | 210 /// |
210 * | 211 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
211 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 212 /// an error. |
212 * error. | 213 /// |
213 * | 214 /// If the used [http.Client] completes with an error when making a REST |
214 * If the used [http.Client] completes with an error when making a REST call, | 215 /// call, this method will complete with the same error. |
215 * this method will complete with the same error. | |
216 */ | |
217 async.Future<Insert2> get(core.String project, core.String id) { | 216 async.Future<Insert2> get(core.String project, core.String id) { |
218 var _url = null; | 217 var _url = null; |
219 var _queryParams = new core.Map(); | 218 var _queryParams = new core.Map(); |
220 var _uploadMedia = null; | 219 var _uploadMedia = null; |
221 var _uploadOptions = null; | 220 var _uploadOptions = null; |
222 var _downloadOptions = commons.DownloadOptions.Metadata; | 221 var _downloadOptions = commons.DownloadOptions.Metadata; |
223 var _body = null; | 222 var _body = null; |
224 | 223 |
225 if (project == null) { | 224 if (project == null) { |
226 throw new core.ArgumentError("Parameter project is required."); | 225 throw new core.ArgumentError("Parameter project is required."); |
227 } | 226 } |
228 if (id == null) { | 227 if (id == null) { |
229 throw new core.ArgumentError("Parameter id is required."); | 228 throw new core.ArgumentError("Parameter id is required."); |
230 } | 229 } |
231 | 230 |
232 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo
ns.Escaper.ecapeVariable('$id'); | 231 _url = commons.Escaper.ecapeVariable('$project') + |
| 232 '/trainedmodels/' + |
| 233 commons.Escaper.ecapeVariable('$id'); |
233 | 234 |
234 var _response = _requester.request(_url, | 235 var _response = _requester.request(_url, "GET", |
235 "GET", | 236 body: _body, |
236 body: _body, | 237 queryParams: _queryParams, |
237 queryParams: _queryParams, | 238 uploadOptions: _uploadOptions, |
238 uploadOptions: _uploadOptions, | 239 uploadMedia: _uploadMedia, |
239 uploadMedia: _uploadMedia, | 240 downloadOptions: _downloadOptions); |
240 downloadOptions: _downloadOptions); | |
241 return _response.then((data) => new Insert2.fromJson(data)); | 241 return _response.then((data) => new Insert2.fromJson(data)); |
242 } | 242 } |
243 | 243 |
244 /** | 244 /// Train a Prediction API model. |
245 * Train a Prediction API model. | 245 /// |
246 * | 246 /// [request] - The metadata request object. |
247 * [request] - The metadata request object. | 247 /// |
248 * | 248 /// Request parameters: |
249 * Request parameters: | 249 /// |
250 * | 250 /// [project] - The project associated with the model. |
251 * [project] - The project associated with the model. | 251 /// |
252 * | 252 /// Completes with a [Insert2]. |
253 * Completes with a [Insert2]. | 253 /// |
254 * | 254 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
255 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 255 /// an error. |
256 * error. | 256 /// |
257 * | 257 /// If the used [http.Client] completes with an error when making a REST |
258 * If the used [http.Client] completes with an error when making a REST call, | 258 /// call, this method will complete with the same error. |
259 * this method will complete with the same error. | |
260 */ | |
261 async.Future<Insert2> insert(Insert request, core.String project) { | 259 async.Future<Insert2> insert(Insert request, core.String project) { |
262 var _url = null; | 260 var _url = null; |
263 var _queryParams = new core.Map(); | 261 var _queryParams = new core.Map(); |
264 var _uploadMedia = null; | 262 var _uploadMedia = null; |
265 var _uploadOptions = null; | 263 var _uploadOptions = null; |
266 var _downloadOptions = commons.DownloadOptions.Metadata; | 264 var _downloadOptions = commons.DownloadOptions.Metadata; |
267 var _body = null; | 265 var _body = null; |
268 | 266 |
269 if (request != null) { | 267 if (request != null) { |
270 _body = convert.JSON.encode((request).toJson()); | 268 _body = convert.JSON.encode((request).toJson()); |
271 } | 269 } |
272 if (project == null) { | 270 if (project == null) { |
273 throw new core.ArgumentError("Parameter project is required."); | 271 throw new core.ArgumentError("Parameter project is required."); |
274 } | 272 } |
275 | 273 |
276 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels'; | 274 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels'; |
277 | 275 |
278 var _response = _requester.request(_url, | 276 var _response = _requester.request(_url, "POST", |
279 "POST", | 277 body: _body, |
280 body: _body, | 278 queryParams: _queryParams, |
281 queryParams: _queryParams, | 279 uploadOptions: _uploadOptions, |
282 uploadOptions: _uploadOptions, | 280 uploadMedia: _uploadMedia, |
283 uploadMedia: _uploadMedia, | 281 downloadOptions: _downloadOptions); |
284 downloadOptions: _downloadOptions); | |
285 return _response.then((data) => new Insert2.fromJson(data)); | 282 return _response.then((data) => new Insert2.fromJson(data)); |
286 } | 283 } |
287 | 284 |
288 /** | 285 /// List available models. |
289 * List available models. | 286 /// |
290 * | 287 /// Request parameters: |
291 * Request parameters: | 288 /// |
292 * | 289 /// [project] - The project associated with the model. |
293 * [project] - The project associated with the model. | 290 /// |
294 * | 291 /// [maxResults] - Maximum number of results to return. |
295 * [maxResults] - Maximum number of results to return. | 292 /// |
296 * | 293 /// [pageToken] - Pagination token. |
297 * [pageToken] - Pagination token. | 294 /// |
298 * | 295 /// Completes with a [List]. |
299 * Completes with a [List]. | 296 /// |
300 * | 297 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
301 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 298 /// an error. |
302 * error. | 299 /// |
303 * | 300 /// If the used [http.Client] completes with an error when making a REST |
304 * If the used [http.Client] completes with an error when making a REST call, | 301 /// call, this method will complete with the same error. |
305 * this method will complete with the same error. | 302 async.Future<List> list(core.String project, |
306 */ | 303 {core.int maxResults, core.String pageToken}) { |
307 async.Future<List> list(core.String project, {core.int maxResults, core.String
pageToken}) { | |
308 var _url = null; | 304 var _url = null; |
309 var _queryParams = new core.Map(); | 305 var _queryParams = new core.Map(); |
310 var _uploadMedia = null; | 306 var _uploadMedia = null; |
311 var _uploadOptions = null; | 307 var _uploadOptions = null; |
312 var _downloadOptions = commons.DownloadOptions.Metadata; | 308 var _downloadOptions = commons.DownloadOptions.Metadata; |
313 var _body = null; | 309 var _body = null; |
314 | 310 |
315 if (project == null) { | 311 if (project == null) { |
316 throw new core.ArgumentError("Parameter project is required."); | 312 throw new core.ArgumentError("Parameter project is required."); |
317 } | 313 } |
318 if (maxResults != null) { | 314 if (maxResults != null) { |
319 _queryParams["maxResults"] = ["${maxResults}"]; | 315 _queryParams["maxResults"] = ["${maxResults}"]; |
320 } | 316 } |
321 if (pageToken != null) { | 317 if (pageToken != null) { |
322 _queryParams["pageToken"] = [pageToken]; | 318 _queryParams["pageToken"] = [pageToken]; |
323 } | 319 } |
324 | 320 |
325 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/list'; | 321 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/list'; |
326 | 322 |
327 var _response = _requester.request(_url, | 323 var _response = _requester.request(_url, "GET", |
328 "GET", | 324 body: _body, |
329 body: _body, | 325 queryParams: _queryParams, |
330 queryParams: _queryParams, | 326 uploadOptions: _uploadOptions, |
331 uploadOptions: _uploadOptions, | 327 uploadMedia: _uploadMedia, |
332 uploadMedia: _uploadMedia, | 328 downloadOptions: _downloadOptions); |
333 downloadOptions: _downloadOptions); | |
334 return _response.then((data) => new List.fromJson(data)); | 329 return _response.then((data) => new List.fromJson(data)); |
335 } | 330 } |
336 | 331 |
337 /** | 332 /// Submit model id and request a prediction. |
338 * Submit model id and request a prediction. | 333 /// |
339 * | 334 /// [request] - The metadata request object. |
340 * [request] - The metadata request object. | 335 /// |
341 * | 336 /// Request parameters: |
342 * Request parameters: | 337 /// |
343 * | 338 /// [project] - The project associated with the model. |
344 * [project] - The project associated with the model. | 339 /// |
345 * | 340 /// [id] - The unique name for the predictive model. |
346 * [id] - The unique name for the predictive model. | 341 /// |
347 * | 342 /// Completes with a [Output]. |
348 * Completes with a [Output]. | 343 /// |
349 * | 344 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
350 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 345 /// an error. |
351 * error. | 346 /// |
352 * | 347 /// If the used [http.Client] completes with an error when making a REST |
353 * If the used [http.Client] completes with an error when making a REST call, | 348 /// call, this method will complete with the same error. |
354 * this method will complete with the same error. | 349 async.Future<Output> predict( |
355 */ | 350 Input request, core.String project, core.String id) { |
356 async.Future<Output> predict(Input request, core.String project, core.String i
d) { | |
357 var _url = null; | 351 var _url = null; |
358 var _queryParams = new core.Map(); | 352 var _queryParams = new core.Map(); |
359 var _uploadMedia = null; | 353 var _uploadMedia = null; |
360 var _uploadOptions = null; | 354 var _uploadOptions = null; |
361 var _downloadOptions = commons.DownloadOptions.Metadata; | 355 var _downloadOptions = commons.DownloadOptions.Metadata; |
362 var _body = null; | 356 var _body = null; |
363 | 357 |
364 if (request != null) { | 358 if (request != null) { |
365 _body = convert.JSON.encode((request).toJson()); | 359 _body = convert.JSON.encode((request).toJson()); |
366 } | 360 } |
367 if (project == null) { | 361 if (project == null) { |
368 throw new core.ArgumentError("Parameter project is required."); | 362 throw new core.ArgumentError("Parameter project is required."); |
369 } | 363 } |
370 if (id == null) { | 364 if (id == null) { |
371 throw new core.ArgumentError("Parameter id is required."); | 365 throw new core.ArgumentError("Parameter id is required."); |
372 } | 366 } |
373 | 367 |
374 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo
ns.Escaper.ecapeVariable('$id') + '/predict'; | 368 _url = commons.Escaper.ecapeVariable('$project') + |
| 369 '/trainedmodels/' + |
| 370 commons.Escaper.ecapeVariable('$id') + |
| 371 '/predict'; |
375 | 372 |
376 var _response = _requester.request(_url, | 373 var _response = _requester.request(_url, "POST", |
377 "POST", | 374 body: _body, |
378 body: _body, | 375 queryParams: _queryParams, |
379 queryParams: _queryParams, | 376 uploadOptions: _uploadOptions, |
380 uploadOptions: _uploadOptions, | 377 uploadMedia: _uploadMedia, |
381 uploadMedia: _uploadMedia, | 378 downloadOptions: _downloadOptions); |
382 downloadOptions: _downloadOptions); | |
383 return _response.then((data) => new Output.fromJson(data)); | 379 return _response.then((data) => new Output.fromJson(data)); |
384 } | 380 } |
385 | 381 |
386 /** | 382 /// Add new data to a trained model. |
387 * Add new data to a trained model. | 383 /// |
388 * | 384 /// [request] - The metadata request object. |
389 * [request] - The metadata request object. | 385 /// |
390 * | 386 /// Request parameters: |
391 * Request parameters: | 387 /// |
392 * | 388 /// [project] - The project associated with the model. |
393 * [project] - The project associated with the model. | 389 /// |
394 * | 390 /// [id] - The unique name for the predictive model. |
395 * [id] - The unique name for the predictive model. | 391 /// |
396 * | 392 /// Completes with a [Insert2]. |
397 * Completes with a [Insert2]. | 393 /// |
398 * | 394 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
399 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 395 /// an error. |
400 * error. | 396 /// |
401 * | 397 /// If the used [http.Client] completes with an error when making a REST |
402 * If the used [http.Client] completes with an error when making a REST call, | 398 /// call, this method will complete with the same error. |
403 * this method will complete with the same error. | 399 async.Future<Insert2> update( |
404 */ | 400 Update request, core.String project, core.String id) { |
405 async.Future<Insert2> update(Update request, core.String project, core.String
id) { | |
406 var _url = null; | 401 var _url = null; |
407 var _queryParams = new core.Map(); | 402 var _queryParams = new core.Map(); |
408 var _uploadMedia = null; | 403 var _uploadMedia = null; |
409 var _uploadOptions = null; | 404 var _uploadOptions = null; |
410 var _downloadOptions = commons.DownloadOptions.Metadata; | 405 var _downloadOptions = commons.DownloadOptions.Metadata; |
411 var _body = null; | 406 var _body = null; |
412 | 407 |
413 if (request != null) { | 408 if (request != null) { |
414 _body = convert.JSON.encode((request).toJson()); | 409 _body = convert.JSON.encode((request).toJson()); |
415 } | 410 } |
416 if (project == null) { | 411 if (project == null) { |
417 throw new core.ArgumentError("Parameter project is required."); | 412 throw new core.ArgumentError("Parameter project is required."); |
418 } | 413 } |
419 if (id == null) { | 414 if (id == null) { |
420 throw new core.ArgumentError("Parameter id is required."); | 415 throw new core.ArgumentError("Parameter id is required."); |
421 } | 416 } |
422 | 417 |
423 _url = commons.Escaper.ecapeVariable('$project') + '/trainedmodels/' + commo
ns.Escaper.ecapeVariable('$id'); | 418 _url = commons.Escaper.ecapeVariable('$project') + |
| 419 '/trainedmodels/' + |
| 420 commons.Escaper.ecapeVariable('$id'); |
424 | 421 |
425 var _response = _requester.request(_url, | 422 var _response = _requester.request(_url, "PUT", |
426 "PUT", | 423 body: _body, |
427 body: _body, | 424 queryParams: _queryParams, |
428 queryParams: _queryParams, | 425 uploadOptions: _uploadOptions, |
429 uploadOptions: _uploadOptions, | 426 uploadMedia: _uploadMedia, |
430 uploadMedia: _uploadMedia, | 427 downloadOptions: _downloadOptions); |
431 downloadOptions: _downloadOptions); | |
432 return _response.then((data) => new Insert2.fromJson(data)); | 428 return _response.then((data) => new Insert2.fromJson(data)); |
433 } | 429 } |
434 | |
435 } | 430 } |
436 | 431 |
| 432 class AnalyzeDataDescriptionFeaturesCategoricalValues { |
| 433 /// Number of times this feature had this value. |
| 434 core.String count; |
437 | 435 |
438 | 436 /// The category name. |
439 class AnalyzeDataDescriptionFeaturesCategoricalValues { | |
440 /** Number of times this feature had this value. */ | |
441 core.String count; | |
442 /** The category name. */ | |
443 core.String value; | 437 core.String value; |
444 | 438 |
445 AnalyzeDataDescriptionFeaturesCategoricalValues(); | 439 AnalyzeDataDescriptionFeaturesCategoricalValues(); |
446 | 440 |
447 AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson(core.Map _json) { | 441 AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson(core.Map _json) { |
448 if (_json.containsKey("count")) { | 442 if (_json.containsKey("count")) { |
449 count = _json["count"]; | 443 count = _json["count"]; |
450 } | 444 } |
451 if (_json.containsKey("value")) { | 445 if (_json.containsKey("value")) { |
452 value = _json["value"]; | 446 value = _json["value"]; |
453 } | 447 } |
454 } | 448 } |
455 | 449 |
456 core.Map<core.String, core.Object> toJson() { | 450 core.Map<core.String, core.Object> toJson() { |
457 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 451 final core.Map<core.String, core.Object> _json = |
| 452 new core.Map<core.String, core.Object>(); |
458 if (count != null) { | 453 if (count != null) { |
459 _json["count"] = count; | 454 _json["count"] = count; |
460 } | 455 } |
461 if (value != null) { | 456 if (value != null) { |
462 _json["value"] = value; | 457 _json["value"] = value; |
463 } | 458 } |
464 return _json; | 459 return _json; |
465 } | 460 } |
466 } | 461 } |
467 | 462 |
468 /** Description of the categorical values of this feature. */ | 463 /// Description of the categorical values of this feature. |
469 class AnalyzeDataDescriptionFeaturesCategorical { | 464 class AnalyzeDataDescriptionFeaturesCategorical { |
470 /** Number of categorical values for this feature in the data. */ | 465 /// Number of categorical values for this feature in the data. |
471 core.String count; | 466 core.String count; |
472 /** List of all the categories for this feature in the data set. */ | 467 |
| 468 /// List of all the categories for this feature in the data set. |
473 core.List<AnalyzeDataDescriptionFeaturesCategoricalValues> values; | 469 core.List<AnalyzeDataDescriptionFeaturesCategoricalValues> values; |
474 | 470 |
475 AnalyzeDataDescriptionFeaturesCategorical(); | 471 AnalyzeDataDescriptionFeaturesCategorical(); |
476 | 472 |
477 AnalyzeDataDescriptionFeaturesCategorical.fromJson(core.Map _json) { | 473 AnalyzeDataDescriptionFeaturesCategorical.fromJson(core.Map _json) { |
478 if (_json.containsKey("count")) { | 474 if (_json.containsKey("count")) { |
479 count = _json["count"]; | 475 count = _json["count"]; |
480 } | 476 } |
481 if (_json.containsKey("values")) { | 477 if (_json.containsKey("values")) { |
482 values = _json["values"].map((value) => new AnalyzeDataDescriptionFeatures
CategoricalValues.fromJson(value)).toList(); | 478 values = _json["values"] |
| 479 .map((value) => |
| 480 new AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson( |
| 481 value)) |
| 482 .toList(); |
483 } | 483 } |
484 } | 484 } |
485 | 485 |
486 core.Map<core.String, core.Object> toJson() { | 486 core.Map<core.String, core.Object> toJson() { |
487 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 487 final core.Map<core.String, core.Object> _json = |
| 488 new core.Map<core.String, core.Object>(); |
488 if (count != null) { | 489 if (count != null) { |
489 _json["count"] = count; | 490 _json["count"] = count; |
490 } | 491 } |
491 if (values != null) { | 492 if (values != null) { |
492 _json["values"] = values.map((value) => (value).toJson()).toList(); | 493 _json["values"] = values.map((value) => (value).toJson()).toList(); |
493 } | 494 } |
494 return _json; | 495 return _json; |
495 } | 496 } |
496 } | 497 } |
497 | 498 |
498 /** Description of the numeric values of this feature. */ | 499 /// Description of the numeric values of this feature. |
499 class AnalyzeDataDescriptionFeaturesNumeric { | 500 class AnalyzeDataDescriptionFeaturesNumeric { |
500 /** Number of numeric values for this feature in the data set. */ | 501 /// Number of numeric values for this feature in the data set. |
501 core.String count; | 502 core.String count; |
502 /** Mean of the numeric values of this feature in the data set. */ | 503 |
| 504 /// Mean of the numeric values of this feature in the data set. |
503 core.String mean; | 505 core.String mean; |
504 /** Variance of the numeric values of this feature in the data set. */ | 506 |
| 507 /// Variance of the numeric values of this feature in the data set. |
505 core.String variance; | 508 core.String variance; |
506 | 509 |
507 AnalyzeDataDescriptionFeaturesNumeric(); | 510 AnalyzeDataDescriptionFeaturesNumeric(); |
508 | 511 |
509 AnalyzeDataDescriptionFeaturesNumeric.fromJson(core.Map _json) { | 512 AnalyzeDataDescriptionFeaturesNumeric.fromJson(core.Map _json) { |
510 if (_json.containsKey("count")) { | 513 if (_json.containsKey("count")) { |
511 count = _json["count"]; | 514 count = _json["count"]; |
512 } | 515 } |
513 if (_json.containsKey("mean")) { | 516 if (_json.containsKey("mean")) { |
514 mean = _json["mean"]; | 517 mean = _json["mean"]; |
515 } | 518 } |
516 if (_json.containsKey("variance")) { | 519 if (_json.containsKey("variance")) { |
517 variance = _json["variance"]; | 520 variance = _json["variance"]; |
518 } | 521 } |
519 } | 522 } |
520 | 523 |
521 core.Map<core.String, core.Object> toJson() { | 524 core.Map<core.String, core.Object> toJson() { |
522 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 525 final core.Map<core.String, core.Object> _json = |
| 526 new core.Map<core.String, core.Object>(); |
523 if (count != null) { | 527 if (count != null) { |
524 _json["count"] = count; | 528 _json["count"] = count; |
525 } | 529 } |
526 if (mean != null) { | 530 if (mean != null) { |
527 _json["mean"] = mean; | 531 _json["mean"] = mean; |
528 } | 532 } |
529 if (variance != null) { | 533 if (variance != null) { |
530 _json["variance"] = variance; | 534 _json["variance"] = variance; |
531 } | 535 } |
532 return _json; | 536 return _json; |
533 } | 537 } |
534 } | 538 } |
535 | 539 |
536 /** Description of multiple-word text values of this feature. */ | 540 /// Description of multiple-word text values of this feature. |
537 class AnalyzeDataDescriptionFeaturesText { | 541 class AnalyzeDataDescriptionFeaturesText { |
538 /** Number of multiple-word text values for this feature. */ | 542 /// Number of multiple-word text values for this feature. |
539 core.String count; | 543 core.String count; |
540 | 544 |
541 AnalyzeDataDescriptionFeaturesText(); | 545 AnalyzeDataDescriptionFeaturesText(); |
542 | 546 |
543 AnalyzeDataDescriptionFeaturesText.fromJson(core.Map _json) { | 547 AnalyzeDataDescriptionFeaturesText.fromJson(core.Map _json) { |
544 if (_json.containsKey("count")) { | 548 if (_json.containsKey("count")) { |
545 count = _json["count"]; | 549 count = _json["count"]; |
546 } | 550 } |
547 } | 551 } |
548 | 552 |
549 core.Map<core.String, core.Object> toJson() { | 553 core.Map<core.String, core.Object> toJson() { |
550 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 554 final core.Map<core.String, core.Object> _json = |
| 555 new core.Map<core.String, core.Object>(); |
551 if (count != null) { | 556 if (count != null) { |
552 _json["count"] = count; | 557 _json["count"] = count; |
553 } | 558 } |
554 return _json; | 559 return _json; |
555 } | 560 } |
556 } | 561 } |
557 | 562 |
558 class AnalyzeDataDescriptionFeatures { | 563 class AnalyzeDataDescriptionFeatures { |
559 /** Description of the categorical values of this feature. */ | 564 /// Description of the categorical values of this feature. |
560 AnalyzeDataDescriptionFeaturesCategorical categorical; | 565 AnalyzeDataDescriptionFeaturesCategorical categorical; |
561 /** The feature index. */ | 566 |
| 567 /// The feature index. |
562 core.String index; | 568 core.String index; |
563 /** Description of the numeric values of this feature. */ | 569 |
| 570 /// Description of the numeric values of this feature. |
564 AnalyzeDataDescriptionFeaturesNumeric numeric; | 571 AnalyzeDataDescriptionFeaturesNumeric numeric; |
565 /** Description of multiple-word text values of this feature. */ | 572 |
| 573 /// Description of multiple-word text values of this feature. |
566 AnalyzeDataDescriptionFeaturesText text; | 574 AnalyzeDataDescriptionFeaturesText text; |
567 | 575 |
568 AnalyzeDataDescriptionFeatures(); | 576 AnalyzeDataDescriptionFeatures(); |
569 | 577 |
570 AnalyzeDataDescriptionFeatures.fromJson(core.Map _json) { | 578 AnalyzeDataDescriptionFeatures.fromJson(core.Map _json) { |
571 if (_json.containsKey("categorical")) { | 579 if (_json.containsKey("categorical")) { |
572 categorical = new AnalyzeDataDescriptionFeaturesCategorical.fromJson(_json
["categorical"]); | 580 categorical = new AnalyzeDataDescriptionFeaturesCategorical.fromJson( |
| 581 _json["categorical"]); |
573 } | 582 } |
574 if (_json.containsKey("index")) { | 583 if (_json.containsKey("index")) { |
575 index = _json["index"]; | 584 index = _json["index"]; |
576 } | 585 } |
577 if (_json.containsKey("numeric")) { | 586 if (_json.containsKey("numeric")) { |
578 numeric = new AnalyzeDataDescriptionFeaturesNumeric.fromJson(_json["numeri
c"]); | 587 numeric = |
| 588 new AnalyzeDataDescriptionFeaturesNumeric.fromJson(_json["numeric"]); |
579 } | 589 } |
580 if (_json.containsKey("text")) { | 590 if (_json.containsKey("text")) { |
581 text = new AnalyzeDataDescriptionFeaturesText.fromJson(_json["text"]); | 591 text = new AnalyzeDataDescriptionFeaturesText.fromJson(_json["text"]); |
582 } | 592 } |
583 } | 593 } |
584 | 594 |
585 core.Map<core.String, core.Object> toJson() { | 595 core.Map<core.String, core.Object> toJson() { |
586 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 596 final core.Map<core.String, core.Object> _json = |
| 597 new core.Map<core.String, core.Object>(); |
587 if (categorical != null) { | 598 if (categorical != null) { |
588 _json["categorical"] = (categorical).toJson(); | 599 _json["categorical"] = (categorical).toJson(); |
589 } | 600 } |
590 if (index != null) { | 601 if (index != null) { |
591 _json["index"] = index; | 602 _json["index"] = index; |
592 } | 603 } |
593 if (numeric != null) { | 604 if (numeric != null) { |
594 _json["numeric"] = (numeric).toJson(); | 605 _json["numeric"] = (numeric).toJson(); |
595 } | 606 } |
596 if (text != null) { | 607 if (text != null) { |
597 _json["text"] = (text).toJson(); | 608 _json["text"] = (text).toJson(); |
598 } | 609 } |
599 return _json; | 610 return _json; |
600 } | 611 } |
601 } | 612 } |
602 | 613 |
603 /** Description of the output values in the data set. */ | 614 /// Description of the output values in the data set. |
604 class AnalyzeDataDescriptionOutputFeatureNumeric { | 615 class AnalyzeDataDescriptionOutputFeatureNumeric { |
605 /** Number of numeric output values in the data set. */ | 616 /// Number of numeric output values in the data set. |
606 core.String count; | 617 core.String count; |
607 /** Mean of the output values in the data set. */ | 618 |
| 619 /// Mean of the output values in the data set. |
608 core.String mean; | 620 core.String mean; |
609 /** Variance of the output values in the data set. */ | 621 |
| 622 /// Variance of the output values in the data set. |
610 core.String variance; | 623 core.String variance; |
611 | 624 |
612 AnalyzeDataDescriptionOutputFeatureNumeric(); | 625 AnalyzeDataDescriptionOutputFeatureNumeric(); |
613 | 626 |
614 AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(core.Map _json) { | 627 AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(core.Map _json) { |
615 if (_json.containsKey("count")) { | 628 if (_json.containsKey("count")) { |
616 count = _json["count"]; | 629 count = _json["count"]; |
617 } | 630 } |
618 if (_json.containsKey("mean")) { | 631 if (_json.containsKey("mean")) { |
619 mean = _json["mean"]; | 632 mean = _json["mean"]; |
620 } | 633 } |
621 if (_json.containsKey("variance")) { | 634 if (_json.containsKey("variance")) { |
622 variance = _json["variance"]; | 635 variance = _json["variance"]; |
623 } | 636 } |
624 } | 637 } |
625 | 638 |
626 core.Map<core.String, core.Object> toJson() { | 639 core.Map<core.String, core.Object> toJson() { |
627 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 640 final core.Map<core.String, core.Object> _json = |
| 641 new core.Map<core.String, core.Object>(); |
628 if (count != null) { | 642 if (count != null) { |
629 _json["count"] = count; | 643 _json["count"] = count; |
630 } | 644 } |
631 if (mean != null) { | 645 if (mean != null) { |
632 _json["mean"] = mean; | 646 _json["mean"] = mean; |
633 } | 647 } |
634 if (variance != null) { | 648 if (variance != null) { |
635 _json["variance"] = variance; | 649 _json["variance"] = variance; |
636 } | 650 } |
637 return _json; | 651 return _json; |
638 } | 652 } |
639 } | 653 } |
640 | 654 |
641 class AnalyzeDataDescriptionOutputFeatureText { | 655 class AnalyzeDataDescriptionOutputFeatureText { |
642 /** Number of times the output label occurred in the data set. */ | 656 /// Number of times the output label occurred in the data set. |
643 core.String count; | 657 core.String count; |
644 /** The output label. */ | 658 |
| 659 /// The output label. |
645 core.String value; | 660 core.String value; |
646 | 661 |
647 AnalyzeDataDescriptionOutputFeatureText(); | 662 AnalyzeDataDescriptionOutputFeatureText(); |
648 | 663 |
649 AnalyzeDataDescriptionOutputFeatureText.fromJson(core.Map _json) { | 664 AnalyzeDataDescriptionOutputFeatureText.fromJson(core.Map _json) { |
650 if (_json.containsKey("count")) { | 665 if (_json.containsKey("count")) { |
651 count = _json["count"]; | 666 count = _json["count"]; |
652 } | 667 } |
653 if (_json.containsKey("value")) { | 668 if (_json.containsKey("value")) { |
654 value = _json["value"]; | 669 value = _json["value"]; |
655 } | 670 } |
656 } | 671 } |
657 | 672 |
658 core.Map<core.String, core.Object> toJson() { | 673 core.Map<core.String, core.Object> toJson() { |
659 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 674 final core.Map<core.String, core.Object> _json = |
| 675 new core.Map<core.String, core.Object>(); |
660 if (count != null) { | 676 if (count != null) { |
661 _json["count"] = count; | 677 _json["count"] = count; |
662 } | 678 } |
663 if (value != null) { | 679 if (value != null) { |
664 _json["value"] = value; | 680 _json["value"] = value; |
665 } | 681 } |
666 return _json; | 682 return _json; |
667 } | 683 } |
668 } | 684 } |
669 | 685 |
670 /** Description of the output value or label. */ | 686 /// Description of the output value or label. |
671 class AnalyzeDataDescriptionOutputFeature { | 687 class AnalyzeDataDescriptionOutputFeature { |
672 /** Description of the output values in the data set. */ | 688 /// Description of the output values in the data set. |
673 AnalyzeDataDescriptionOutputFeatureNumeric numeric; | 689 AnalyzeDataDescriptionOutputFeatureNumeric numeric; |
674 /** Description of the output labels in the data set. */ | 690 |
| 691 /// Description of the output labels in the data set. |
675 core.List<AnalyzeDataDescriptionOutputFeatureText> text; | 692 core.List<AnalyzeDataDescriptionOutputFeatureText> text; |
676 | 693 |
677 AnalyzeDataDescriptionOutputFeature(); | 694 AnalyzeDataDescriptionOutputFeature(); |
678 | 695 |
679 AnalyzeDataDescriptionOutputFeature.fromJson(core.Map _json) { | 696 AnalyzeDataDescriptionOutputFeature.fromJson(core.Map _json) { |
680 if (_json.containsKey("numeric")) { | 697 if (_json.containsKey("numeric")) { |
681 numeric = new AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(_json["n
umeric"]); | 698 numeric = new AnalyzeDataDescriptionOutputFeatureNumeric.fromJson( |
| 699 _json["numeric"]); |
682 } | 700 } |
683 if (_json.containsKey("text")) { | 701 if (_json.containsKey("text")) { |
684 text = _json["text"].map((value) => new AnalyzeDataDescriptionOutputFeatur
eText.fromJson(value)).toList(); | 702 text = _json["text"] |
| 703 .map((value) => |
| 704 new AnalyzeDataDescriptionOutputFeatureText.fromJson(value)) |
| 705 .toList(); |
685 } | 706 } |
686 } | 707 } |
687 | 708 |
688 core.Map<core.String, core.Object> toJson() { | 709 core.Map<core.String, core.Object> toJson() { |
689 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 710 final core.Map<core.String, core.Object> _json = |
| 711 new core.Map<core.String, core.Object>(); |
690 if (numeric != null) { | 712 if (numeric != null) { |
691 _json["numeric"] = (numeric).toJson(); | 713 _json["numeric"] = (numeric).toJson(); |
692 } | 714 } |
693 if (text != null) { | 715 if (text != null) { |
694 _json["text"] = text.map((value) => (value).toJson()).toList(); | 716 _json["text"] = text.map((value) => (value).toJson()).toList(); |
695 } | 717 } |
696 return _json; | 718 return _json; |
697 } | 719 } |
698 } | 720 } |
699 | 721 |
700 /** Description of the data the model was trained on. */ | 722 /// Description of the data the model was trained on. |
701 class AnalyzeDataDescription { | 723 class AnalyzeDataDescription { |
702 /** Description of the input features in the data set. */ | 724 /// Description of the input features in the data set. |
703 core.List<AnalyzeDataDescriptionFeatures> features; | 725 core.List<AnalyzeDataDescriptionFeatures> features; |
704 /** Description of the output value or label. */ | 726 |
| 727 /// Description of the output value or label. |
705 AnalyzeDataDescriptionOutputFeature outputFeature; | 728 AnalyzeDataDescriptionOutputFeature outputFeature; |
706 | 729 |
707 AnalyzeDataDescription(); | 730 AnalyzeDataDescription(); |
708 | 731 |
709 AnalyzeDataDescription.fromJson(core.Map _json) { | 732 AnalyzeDataDescription.fromJson(core.Map _json) { |
710 if (_json.containsKey("features")) { | 733 if (_json.containsKey("features")) { |
711 features = _json["features"].map((value) => new AnalyzeDataDescriptionFeat
ures.fromJson(value)).toList(); | 734 features = _json["features"] |
| 735 .map((value) => new AnalyzeDataDescriptionFeatures.fromJson(value)) |
| 736 .toList(); |
712 } | 737 } |
713 if (_json.containsKey("outputFeature")) { | 738 if (_json.containsKey("outputFeature")) { |
714 outputFeature = new AnalyzeDataDescriptionOutputFeature.fromJson(_json["ou
tputFeature"]); | 739 outputFeature = new AnalyzeDataDescriptionOutputFeature.fromJson( |
| 740 _json["outputFeature"]); |
715 } | 741 } |
716 } | 742 } |
717 | 743 |
718 core.Map<core.String, core.Object> toJson() { | 744 core.Map<core.String, core.Object> toJson() { |
719 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 745 final core.Map<core.String, core.Object> _json = |
| 746 new core.Map<core.String, core.Object>(); |
720 if (features != null) { | 747 if (features != null) { |
721 _json["features"] = features.map((value) => (value).toJson()).toList(); | 748 _json["features"] = features.map((value) => (value).toJson()).toList(); |
722 } | 749 } |
723 if (outputFeature != null) { | 750 if (outputFeature != null) { |
724 _json["outputFeature"] = (outputFeature).toJson(); | 751 _json["outputFeature"] = (outputFeature).toJson(); |
725 } | 752 } |
726 return _json; | 753 return _json; |
727 } | 754 } |
728 } | 755 } |
729 | 756 |
730 /** Description of the model. */ | 757 /// Description of the model. |
731 class AnalyzeModelDescription { | 758 class AnalyzeModelDescription { |
732 /** | 759 /// An output confusion matrix. This shows an estimate for how this model |
733 * An output confusion matrix. This shows an estimate for how this model will | 760 /// will do in predictions. This is first indexed by the true class label. |
734 * do in predictions. This is first indexed by the true class label. For each | 761 /// For each true class label, this provides a pair {predicted_label, count}, |
735 * true class label, this provides a pair {predicted_label, count}, where | 762 /// where count is the estimated number of times the model will predict the |
736 * count is the estimated number of times the model will predict the predicted | 763 /// predicted label given the true label. Will not output if more then 100 |
737 * label given the true label. Will not output if more then 100 classes | 764 /// classes (Categorical models only). |
738 * (Categorical models only). | |
739 */ | |
740 core.Map<core.String, core.Map<core.String, core.String>> confusionMatrix; | 765 core.Map<core.String, core.Map<core.String, core.String>> confusionMatrix; |
741 /** A list of the confusion matrix row totals. */ | 766 |
| 767 /// A list of the confusion matrix row totals. |
742 core.Map<core.String, core.String> confusionMatrixRowTotals; | 768 core.Map<core.String, core.String> confusionMatrixRowTotals; |
743 /** Basic information about the model. */ | 769 |
| 770 /// Basic information about the model. |
744 Insert2 modelinfo; | 771 Insert2 modelinfo; |
745 | 772 |
746 AnalyzeModelDescription(); | 773 AnalyzeModelDescription(); |
747 | 774 |
748 AnalyzeModelDescription.fromJson(core.Map _json) { | 775 AnalyzeModelDescription.fromJson(core.Map _json) { |
749 if (_json.containsKey("confusionMatrix")) { | 776 if (_json.containsKey("confusionMatrix")) { |
750 confusionMatrix = _json["confusionMatrix"]; | 777 confusionMatrix = _json["confusionMatrix"]; |
751 } | 778 } |
752 if (_json.containsKey("confusionMatrixRowTotals")) { | 779 if (_json.containsKey("confusionMatrixRowTotals")) { |
753 confusionMatrixRowTotals = _json["confusionMatrixRowTotals"]; | 780 confusionMatrixRowTotals = _json["confusionMatrixRowTotals"]; |
754 } | 781 } |
755 if (_json.containsKey("modelinfo")) { | 782 if (_json.containsKey("modelinfo")) { |
756 modelinfo = new Insert2.fromJson(_json["modelinfo"]); | 783 modelinfo = new Insert2.fromJson(_json["modelinfo"]); |
757 } | 784 } |
758 } | 785 } |
759 | 786 |
760 core.Map<core.String, core.Object> toJson() { | 787 core.Map<core.String, core.Object> toJson() { |
761 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 788 final core.Map<core.String, core.Object> _json = |
| 789 new core.Map<core.String, core.Object>(); |
762 if (confusionMatrix != null) { | 790 if (confusionMatrix != null) { |
763 _json["confusionMatrix"] = confusionMatrix; | 791 _json["confusionMatrix"] = confusionMatrix; |
764 } | 792 } |
765 if (confusionMatrixRowTotals != null) { | 793 if (confusionMatrixRowTotals != null) { |
766 _json["confusionMatrixRowTotals"] = confusionMatrixRowTotals; | 794 _json["confusionMatrixRowTotals"] = confusionMatrixRowTotals; |
767 } | 795 } |
768 if (modelinfo != null) { | 796 if (modelinfo != null) { |
769 _json["modelinfo"] = (modelinfo).toJson(); | 797 _json["modelinfo"] = (modelinfo).toJson(); |
770 } | 798 } |
771 return _json; | 799 return _json; |
772 } | 800 } |
773 } | 801 } |
774 | 802 |
775 class Analyze { | 803 class Analyze { |
776 /** Description of the data the model was trained on. */ | 804 /// Description of the data the model was trained on. |
777 AnalyzeDataDescription dataDescription; | 805 AnalyzeDataDescription dataDescription; |
778 /** List of errors with the data. */ | 806 |
| 807 /// List of errors with the data. |
779 core.List<core.Map<core.String, core.String>> errors; | 808 core.List<core.Map<core.String, core.String>> errors; |
780 /** The unique name for the predictive model. */ | 809 |
| 810 /// The unique name for the predictive model. |
781 core.String id; | 811 core.String id; |
782 /** What kind of resource this is. */ | 812 |
| 813 /// What kind of resource this is. |
783 core.String kind; | 814 core.String kind; |
784 /** Description of the model. */ | 815 |
| 816 /// Description of the model. |
785 AnalyzeModelDescription modelDescription; | 817 AnalyzeModelDescription modelDescription; |
786 /** A URL to re-request this resource. */ | 818 |
| 819 /// A URL to re-request this resource. |
787 core.String selfLink; | 820 core.String selfLink; |
788 | 821 |
789 Analyze(); | 822 Analyze(); |
790 | 823 |
791 Analyze.fromJson(core.Map _json) { | 824 Analyze.fromJson(core.Map _json) { |
792 if (_json.containsKey("dataDescription")) { | 825 if (_json.containsKey("dataDescription")) { |
793 dataDescription = new AnalyzeDataDescription.fromJson(_json["dataDescripti
on"]); | 826 dataDescription = |
| 827 new AnalyzeDataDescription.fromJson(_json["dataDescription"]); |
794 } | 828 } |
795 if (_json.containsKey("errors")) { | 829 if (_json.containsKey("errors")) { |
796 errors = _json["errors"]; | 830 errors = _json["errors"]; |
797 } | 831 } |
798 if (_json.containsKey("id")) { | 832 if (_json.containsKey("id")) { |
799 id = _json["id"]; | 833 id = _json["id"]; |
800 } | 834 } |
801 if (_json.containsKey("kind")) { | 835 if (_json.containsKey("kind")) { |
802 kind = _json["kind"]; | 836 kind = _json["kind"]; |
803 } | 837 } |
804 if (_json.containsKey("modelDescription")) { | 838 if (_json.containsKey("modelDescription")) { |
805 modelDescription = new AnalyzeModelDescription.fromJson(_json["modelDescri
ption"]); | 839 modelDescription = |
| 840 new AnalyzeModelDescription.fromJson(_json["modelDescription"]); |
806 } | 841 } |
807 if (_json.containsKey("selfLink")) { | 842 if (_json.containsKey("selfLink")) { |
808 selfLink = _json["selfLink"]; | 843 selfLink = _json["selfLink"]; |
809 } | 844 } |
810 } | 845 } |
811 | 846 |
812 core.Map<core.String, core.Object> toJson() { | 847 core.Map<core.String, core.Object> toJson() { |
813 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 848 final core.Map<core.String, core.Object> _json = |
| 849 new core.Map<core.String, core.Object>(); |
814 if (dataDescription != null) { | 850 if (dataDescription != null) { |
815 _json["dataDescription"] = (dataDescription).toJson(); | 851 _json["dataDescription"] = (dataDescription).toJson(); |
816 } | 852 } |
817 if (errors != null) { | 853 if (errors != null) { |
818 _json["errors"] = errors; | 854 _json["errors"] = errors; |
819 } | 855 } |
820 if (id != null) { | 856 if (id != null) { |
821 _json["id"] = id; | 857 _json["id"] = id; |
822 } | 858 } |
823 if (kind != null) { | 859 if (kind != null) { |
824 _json["kind"] = kind; | 860 _json["kind"] = kind; |
825 } | 861 } |
826 if (modelDescription != null) { | 862 if (modelDescription != null) { |
827 _json["modelDescription"] = (modelDescription).toJson(); | 863 _json["modelDescription"] = (modelDescription).toJson(); |
828 } | 864 } |
829 if (selfLink != null) { | 865 if (selfLink != null) { |
830 _json["selfLink"] = selfLink; | 866 _json["selfLink"] = selfLink; |
831 } | 867 } |
832 return _json; | 868 return _json; |
833 } | 869 } |
834 } | 870 } |
835 | 871 |
836 /** Input to the model for a prediction. */ | 872 /// Input to the model for a prediction. |
837 class InputInput { | 873 class InputInput { |
838 /** | 874 /// A list of input features, these can be strings or doubles. |
839 * A list of input features, these can be strings or doubles. | 875 /// |
840 * | 876 /// The values for Object must be JSON objects. It can consist of `num`, |
841 * The values for Object must be JSON objects. It can consist of `num`, | 877 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
842 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
843 */ | |
844 core.List<core.Object> csvInstance; | 878 core.List<core.Object> csvInstance; |
845 | 879 |
846 InputInput(); | 880 InputInput(); |
847 | 881 |
848 InputInput.fromJson(core.Map _json) { | 882 InputInput.fromJson(core.Map _json) { |
849 if (_json.containsKey("csvInstance")) { | 883 if (_json.containsKey("csvInstance")) { |
850 csvInstance = _json["csvInstance"]; | 884 csvInstance = _json["csvInstance"]; |
851 } | 885 } |
852 } | 886 } |
853 | 887 |
854 core.Map<core.String, core.Object> toJson() { | 888 core.Map<core.String, core.Object> toJson() { |
855 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 889 final core.Map<core.String, core.Object> _json = |
| 890 new core.Map<core.String, core.Object>(); |
856 if (csvInstance != null) { | 891 if (csvInstance != null) { |
857 _json["csvInstance"] = csvInstance; | 892 _json["csvInstance"] = csvInstance; |
858 } | 893 } |
859 return _json; | 894 return _json; |
860 } | 895 } |
861 } | 896 } |
862 | 897 |
863 class Input { | 898 class Input { |
864 /** Input to the model for a prediction. */ | 899 /// Input to the model for a prediction. |
865 InputInput input; | 900 InputInput input; |
866 | 901 |
867 Input(); | 902 Input(); |
868 | 903 |
869 Input.fromJson(core.Map _json) { | 904 Input.fromJson(core.Map _json) { |
870 if (_json.containsKey("input")) { | 905 if (_json.containsKey("input")) { |
871 input = new InputInput.fromJson(_json["input"]); | 906 input = new InputInput.fromJson(_json["input"]); |
872 } | 907 } |
873 } | 908 } |
874 | 909 |
875 core.Map<core.String, core.Object> toJson() { | 910 core.Map<core.String, core.Object> toJson() { |
876 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 911 final core.Map<core.String, core.Object> _json = |
| 912 new core.Map<core.String, core.Object>(); |
877 if (input != null) { | 913 if (input != null) { |
878 _json["input"] = (input).toJson(); | 914 _json["input"] = (input).toJson(); |
879 } | 915 } |
880 return _json; | 916 return _json; |
881 } | 917 } |
882 } | 918 } |
883 | 919 |
884 class InsertTrainingInstances { | 920 class InsertTrainingInstances { |
885 /** | 921 /// The input features for this instance. |
886 * The input features for this instance. | 922 /// |
887 * | 923 /// The values for Object must be JSON objects. It can consist of `num`, |
888 * The values for Object must be JSON objects. It can consist of `num`, | 924 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
889 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
890 */ | |
891 core.List<core.Object> csvInstance; | 925 core.List<core.Object> csvInstance; |
892 /** The generic output value - could be regression or class label. */ | 926 |
| 927 /// The generic output value - could be regression or class label. |
893 core.String output; | 928 core.String output; |
894 | 929 |
895 InsertTrainingInstances(); | 930 InsertTrainingInstances(); |
896 | 931 |
897 InsertTrainingInstances.fromJson(core.Map _json) { | 932 InsertTrainingInstances.fromJson(core.Map _json) { |
898 if (_json.containsKey("csvInstance")) { | 933 if (_json.containsKey("csvInstance")) { |
899 csvInstance = _json["csvInstance"]; | 934 csvInstance = _json["csvInstance"]; |
900 } | 935 } |
901 if (_json.containsKey("output")) { | 936 if (_json.containsKey("output")) { |
902 output = _json["output"]; | 937 output = _json["output"]; |
903 } | 938 } |
904 } | 939 } |
905 | 940 |
906 core.Map<core.String, core.Object> toJson() { | 941 core.Map<core.String, core.Object> toJson() { |
907 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 942 final core.Map<core.String, core.Object> _json = |
| 943 new core.Map<core.String, core.Object>(); |
908 if (csvInstance != null) { | 944 if (csvInstance != null) { |
909 _json["csvInstance"] = csvInstance; | 945 _json["csvInstance"] = csvInstance; |
910 } | 946 } |
911 if (output != null) { | 947 if (output != null) { |
912 _json["output"] = output; | 948 _json["output"] = output; |
913 } | 949 } |
914 return _json; | 950 return _json; |
915 } | 951 } |
916 } | 952 } |
917 | 953 |
918 class Insert { | 954 class Insert { |
919 /** The unique name for the predictive model. */ | 955 /// The unique name for the predictive model. |
920 core.String id; | 956 core.String id; |
921 /** Type of predictive model (classification or regression). */ | 957 |
| 958 /// Type of predictive model (classification or regression). |
922 core.String modelType; | 959 core.String modelType; |
923 /** The Id of the model to be copied over. */ | 960 |
| 961 /// The Id of the model to be copied over. |
924 core.String sourceModel; | 962 core.String sourceModel; |
925 /** Google storage location of the training data file. */ | 963 |
| 964 /// Google storage location of the training data file. |
926 core.String storageDataLocation; | 965 core.String storageDataLocation; |
927 /** Google storage location of the preprocessing pmml file. */ | 966 |
| 967 /// Google storage location of the preprocessing pmml file. |
928 core.String storagePMMLLocation; | 968 core.String storagePMMLLocation; |
929 /** Google storage location of the pmml model file. */ | 969 |
| 970 /// Google storage location of the pmml model file. |
930 core.String storagePMMLModelLocation; | 971 core.String storagePMMLModelLocation; |
931 /** Instances to train model on. */ | 972 |
| 973 /// Instances to train model on. |
932 core.List<InsertTrainingInstances> trainingInstances; | 974 core.List<InsertTrainingInstances> trainingInstances; |
933 /** | 975 |
934 * A class weighting function, which allows the importance weights for class | 976 /// A class weighting function, which allows the importance weights for class |
935 * labels to be specified (Categorical models only). | 977 /// labels to be specified (Categorical models only). |
936 */ | |
937 core.List<core.Map<core.String, core.double>> utility; | 978 core.List<core.Map<core.String, core.double>> utility; |
938 | 979 |
939 Insert(); | 980 Insert(); |
940 | 981 |
941 Insert.fromJson(core.Map _json) { | 982 Insert.fromJson(core.Map _json) { |
942 if (_json.containsKey("id")) { | 983 if (_json.containsKey("id")) { |
943 id = _json["id"]; | 984 id = _json["id"]; |
944 } | 985 } |
945 if (_json.containsKey("modelType")) { | 986 if (_json.containsKey("modelType")) { |
946 modelType = _json["modelType"]; | 987 modelType = _json["modelType"]; |
947 } | 988 } |
948 if (_json.containsKey("sourceModel")) { | 989 if (_json.containsKey("sourceModel")) { |
949 sourceModel = _json["sourceModel"]; | 990 sourceModel = _json["sourceModel"]; |
950 } | 991 } |
951 if (_json.containsKey("storageDataLocation")) { | 992 if (_json.containsKey("storageDataLocation")) { |
952 storageDataLocation = _json["storageDataLocation"]; | 993 storageDataLocation = _json["storageDataLocation"]; |
953 } | 994 } |
954 if (_json.containsKey("storagePMMLLocation")) { | 995 if (_json.containsKey("storagePMMLLocation")) { |
955 storagePMMLLocation = _json["storagePMMLLocation"]; | 996 storagePMMLLocation = _json["storagePMMLLocation"]; |
956 } | 997 } |
957 if (_json.containsKey("storagePMMLModelLocation")) { | 998 if (_json.containsKey("storagePMMLModelLocation")) { |
958 storagePMMLModelLocation = _json["storagePMMLModelLocation"]; | 999 storagePMMLModelLocation = _json["storagePMMLModelLocation"]; |
959 } | 1000 } |
960 if (_json.containsKey("trainingInstances")) { | 1001 if (_json.containsKey("trainingInstances")) { |
961 trainingInstances = _json["trainingInstances"].map((value) => new InsertTr
ainingInstances.fromJson(value)).toList(); | 1002 trainingInstances = _json["trainingInstances"] |
| 1003 .map((value) => new InsertTrainingInstances.fromJson(value)) |
| 1004 .toList(); |
962 } | 1005 } |
963 if (_json.containsKey("utility")) { | 1006 if (_json.containsKey("utility")) { |
964 utility = _json["utility"]; | 1007 utility = _json["utility"]; |
965 } | 1008 } |
966 } | 1009 } |
967 | 1010 |
968 core.Map<core.String, core.Object> toJson() { | 1011 core.Map<core.String, core.Object> toJson() { |
969 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1012 final core.Map<core.String, core.Object> _json = |
| 1013 new core.Map<core.String, core.Object>(); |
970 if (id != null) { | 1014 if (id != null) { |
971 _json["id"] = id; | 1015 _json["id"] = id; |
972 } | 1016 } |
973 if (modelType != null) { | 1017 if (modelType != null) { |
974 _json["modelType"] = modelType; | 1018 _json["modelType"] = modelType; |
975 } | 1019 } |
976 if (sourceModel != null) { | 1020 if (sourceModel != null) { |
977 _json["sourceModel"] = sourceModel; | 1021 _json["sourceModel"] = sourceModel; |
978 } | 1022 } |
979 if (storageDataLocation != null) { | 1023 if (storageDataLocation != null) { |
980 _json["storageDataLocation"] = storageDataLocation; | 1024 _json["storageDataLocation"] = storageDataLocation; |
981 } | 1025 } |
982 if (storagePMMLLocation != null) { | 1026 if (storagePMMLLocation != null) { |
983 _json["storagePMMLLocation"] = storagePMMLLocation; | 1027 _json["storagePMMLLocation"] = storagePMMLLocation; |
984 } | 1028 } |
985 if (storagePMMLModelLocation != null) { | 1029 if (storagePMMLModelLocation != null) { |
986 _json["storagePMMLModelLocation"] = storagePMMLModelLocation; | 1030 _json["storagePMMLModelLocation"] = storagePMMLModelLocation; |
987 } | 1031 } |
988 if (trainingInstances != null) { | 1032 if (trainingInstances != null) { |
989 _json["trainingInstances"] = trainingInstances.map((value) => (value).toJs
on()).toList(); | 1033 _json["trainingInstances"] = |
| 1034 trainingInstances.map((value) => (value).toJson()).toList(); |
990 } | 1035 } |
991 if (utility != null) { | 1036 if (utility != null) { |
992 _json["utility"] = utility; | 1037 _json["utility"] = utility; |
993 } | 1038 } |
994 return _json; | 1039 return _json; |
995 } | 1040 } |
996 } | 1041 } |
997 | 1042 |
998 /** Model metadata. */ | 1043 /// Model metadata. |
999 class Insert2ModelInfo { | 1044 class Insert2ModelInfo { |
1000 /** | 1045 /// Estimated accuracy of model taking utility weights into account |
1001 * Estimated accuracy of model taking utility weights into account | 1046 /// (Categorical models only). |
1002 * (Categorical models only). | |
1003 */ | |
1004 core.String classWeightedAccuracy; | 1047 core.String classWeightedAccuracy; |
1005 /** | 1048 |
1006 * A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an | 1049 /// A number between 0.0 and 1.0, where 1.0 is 100% accurate. This is an |
1007 * estimate, based on the amount and quality of the training data, of the | 1050 /// estimate, based on the amount and quality of the training data, of the |
1008 * estimated prediction accuracy. You can use this is a guide to decide | 1051 /// estimated prediction accuracy. You can use this is a guide to decide |
1009 * whether the results are accurate enough for your needs. This estimate will | 1052 /// whether the results are accurate enough for your needs. This estimate |
1010 * be more reliable if your real input data is similar to your training data | 1053 /// will be more reliable if your real input data is similar to your training |
1011 * (Categorical models only). | 1054 /// data (Categorical models only). |
1012 */ | |
1013 core.String classificationAccuracy; | 1055 core.String classificationAccuracy; |
1014 /** | 1056 |
1015 * An estimated mean squared error. The can be used to measure the quality of | 1057 /// An estimated mean squared error. The can be used to measure the quality |
1016 * the predicted model (Regression models only). | 1058 /// of the predicted model (Regression models only). |
1017 */ | |
1018 core.String meanSquaredError; | 1059 core.String meanSquaredError; |
1019 /** Type of predictive model (CLASSIFICATION or REGRESSION). */ | 1060 |
| 1061 /// Type of predictive model (CLASSIFICATION or REGRESSION). |
1020 core.String modelType; | 1062 core.String modelType; |
1021 /** Number of valid data instances used in the trained model. */ | 1063 |
| 1064 /// Number of valid data instances used in the trained model. |
1022 core.String numberInstances; | 1065 core.String numberInstances; |
1023 /** Number of class labels in the trained model (Categorical models only). */ | 1066 |
| 1067 /// Number of class labels in the trained model (Categorical models only). |
1024 core.String numberLabels; | 1068 core.String numberLabels; |
1025 | 1069 |
1026 Insert2ModelInfo(); | 1070 Insert2ModelInfo(); |
1027 | 1071 |
1028 Insert2ModelInfo.fromJson(core.Map _json) { | 1072 Insert2ModelInfo.fromJson(core.Map _json) { |
1029 if (_json.containsKey("classWeightedAccuracy")) { | 1073 if (_json.containsKey("classWeightedAccuracy")) { |
1030 classWeightedAccuracy = _json["classWeightedAccuracy"]; | 1074 classWeightedAccuracy = _json["classWeightedAccuracy"]; |
1031 } | 1075 } |
1032 if (_json.containsKey("classificationAccuracy")) { | 1076 if (_json.containsKey("classificationAccuracy")) { |
1033 classificationAccuracy = _json["classificationAccuracy"]; | 1077 classificationAccuracy = _json["classificationAccuracy"]; |
1034 } | 1078 } |
1035 if (_json.containsKey("meanSquaredError")) { | 1079 if (_json.containsKey("meanSquaredError")) { |
1036 meanSquaredError = _json["meanSquaredError"]; | 1080 meanSquaredError = _json["meanSquaredError"]; |
1037 } | 1081 } |
1038 if (_json.containsKey("modelType")) { | 1082 if (_json.containsKey("modelType")) { |
1039 modelType = _json["modelType"]; | 1083 modelType = _json["modelType"]; |
1040 } | 1084 } |
1041 if (_json.containsKey("numberInstances")) { | 1085 if (_json.containsKey("numberInstances")) { |
1042 numberInstances = _json["numberInstances"]; | 1086 numberInstances = _json["numberInstances"]; |
1043 } | 1087 } |
1044 if (_json.containsKey("numberLabels")) { | 1088 if (_json.containsKey("numberLabels")) { |
1045 numberLabels = _json["numberLabels"]; | 1089 numberLabels = _json["numberLabels"]; |
1046 } | 1090 } |
1047 } | 1091 } |
1048 | 1092 |
1049 core.Map<core.String, core.Object> toJson() { | 1093 core.Map<core.String, core.Object> toJson() { |
1050 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1094 final core.Map<core.String, core.Object> _json = |
| 1095 new core.Map<core.String, core.Object>(); |
1051 if (classWeightedAccuracy != null) { | 1096 if (classWeightedAccuracy != null) { |
1052 _json["classWeightedAccuracy"] = classWeightedAccuracy; | 1097 _json["classWeightedAccuracy"] = classWeightedAccuracy; |
1053 } | 1098 } |
1054 if (classificationAccuracy != null) { | 1099 if (classificationAccuracy != null) { |
1055 _json["classificationAccuracy"] = classificationAccuracy; | 1100 _json["classificationAccuracy"] = classificationAccuracy; |
1056 } | 1101 } |
1057 if (meanSquaredError != null) { | 1102 if (meanSquaredError != null) { |
1058 _json["meanSquaredError"] = meanSquaredError; | 1103 _json["meanSquaredError"] = meanSquaredError; |
1059 } | 1104 } |
1060 if (modelType != null) { | 1105 if (modelType != null) { |
1061 _json["modelType"] = modelType; | 1106 _json["modelType"] = modelType; |
1062 } | 1107 } |
1063 if (numberInstances != null) { | 1108 if (numberInstances != null) { |
1064 _json["numberInstances"] = numberInstances; | 1109 _json["numberInstances"] = numberInstances; |
1065 } | 1110 } |
1066 if (numberLabels != null) { | 1111 if (numberLabels != null) { |
1067 _json["numberLabels"] = numberLabels; | 1112 _json["numberLabels"] = numberLabels; |
1068 } | 1113 } |
1069 return _json; | 1114 return _json; |
1070 } | 1115 } |
1071 } | 1116 } |
1072 | 1117 |
1073 class Insert2 { | 1118 class Insert2 { |
1074 /** Insert time of the model (as a RFC 3339 timestamp). */ | 1119 /// Insert time of the model (as a RFC 3339 timestamp). |
1075 core.DateTime created; | 1120 core.DateTime created; |
1076 /** The unique name for the predictive model. */ | 1121 |
| 1122 /// The unique name for the predictive model. |
1077 core.String id; | 1123 core.String id; |
1078 /** What kind of resource this is. */ | 1124 |
| 1125 /// What kind of resource this is. |
1079 core.String kind; | 1126 core.String kind; |
1080 /** Model metadata. */ | 1127 |
| 1128 /// Model metadata. |
1081 Insert2ModelInfo modelInfo; | 1129 Insert2ModelInfo modelInfo; |
1082 /** Type of predictive model (CLASSIFICATION or REGRESSION). */ | 1130 |
| 1131 /// Type of predictive model (CLASSIFICATION or REGRESSION). |
1083 core.String modelType; | 1132 core.String modelType; |
1084 /** A URL to re-request this resource. */ | 1133 |
| 1134 /// A URL to re-request this resource. |
1085 core.String selfLink; | 1135 core.String selfLink; |
1086 /** Google storage location of the training data file. */ | 1136 |
| 1137 /// Google storage location of the training data file. |
1087 core.String storageDataLocation; | 1138 core.String storageDataLocation; |
1088 /** Google storage location of the preprocessing pmml file. */ | 1139 |
| 1140 /// Google storage location of the preprocessing pmml file. |
1089 core.String storagePMMLLocation; | 1141 core.String storagePMMLLocation; |
1090 /** Google storage location of the pmml model file. */ | 1142 |
| 1143 /// Google storage location of the pmml model file. |
1091 core.String storagePMMLModelLocation; | 1144 core.String storagePMMLModelLocation; |
1092 /** Training completion time (as a RFC 3339 timestamp). */ | 1145 |
| 1146 /// Training completion time (as a RFC 3339 timestamp). |
1093 core.DateTime trainingComplete; | 1147 core.DateTime trainingComplete; |
1094 /** | 1148 |
1095 * The current status of the training job. This can be one of following: | 1149 /// The current status of the training job. This can be one of following: |
1096 * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND | 1150 /// RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND |
1097 */ | |
1098 core.String trainingStatus; | 1151 core.String trainingStatus; |
1099 | 1152 |
1100 Insert2(); | 1153 Insert2(); |
1101 | 1154 |
1102 Insert2.fromJson(core.Map _json) { | 1155 Insert2.fromJson(core.Map _json) { |
1103 if (_json.containsKey("created")) { | 1156 if (_json.containsKey("created")) { |
1104 created = core.DateTime.parse(_json["created"]); | 1157 created = core.DateTime.parse(_json["created"]); |
1105 } | 1158 } |
1106 if (_json.containsKey("id")) { | 1159 if (_json.containsKey("id")) { |
1107 id = _json["id"]; | 1160 id = _json["id"]; |
(...skipping 21 matching lines...) Expand all Loading... |
1129 } | 1182 } |
1130 if (_json.containsKey("trainingComplete")) { | 1183 if (_json.containsKey("trainingComplete")) { |
1131 trainingComplete = core.DateTime.parse(_json["trainingComplete"]); | 1184 trainingComplete = core.DateTime.parse(_json["trainingComplete"]); |
1132 } | 1185 } |
1133 if (_json.containsKey("trainingStatus")) { | 1186 if (_json.containsKey("trainingStatus")) { |
1134 trainingStatus = _json["trainingStatus"]; | 1187 trainingStatus = _json["trainingStatus"]; |
1135 } | 1188 } |
1136 } | 1189 } |
1137 | 1190 |
1138 core.Map<core.String, core.Object> toJson() { | 1191 core.Map<core.String, core.Object> toJson() { |
1139 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1192 final core.Map<core.String, core.Object> _json = |
| 1193 new core.Map<core.String, core.Object>(); |
1140 if (created != null) { | 1194 if (created != null) { |
1141 _json["created"] = (created).toIso8601String(); | 1195 _json["created"] = (created).toIso8601String(); |
1142 } | 1196 } |
1143 if (id != null) { | 1197 if (id != null) { |
1144 _json["id"] = id; | 1198 _json["id"] = id; |
1145 } | 1199 } |
1146 if (kind != null) { | 1200 if (kind != null) { |
1147 _json["kind"] = kind; | 1201 _json["kind"] = kind; |
1148 } | 1202 } |
1149 if (modelInfo != null) { | 1203 if (modelInfo != null) { |
(...skipping 18 matching lines...) Expand all Loading... |
1168 _json["trainingComplete"] = (trainingComplete).toIso8601String(); | 1222 _json["trainingComplete"] = (trainingComplete).toIso8601String(); |
1169 } | 1223 } |
1170 if (trainingStatus != null) { | 1224 if (trainingStatus != null) { |
1171 _json["trainingStatus"] = trainingStatus; | 1225 _json["trainingStatus"] = trainingStatus; |
1172 } | 1226 } |
1173 return _json; | 1227 return _json; |
1174 } | 1228 } |
1175 } | 1229 } |
1176 | 1230 |
1177 class List { | 1231 class List { |
1178 /** List of models. */ | 1232 /// List of models. |
1179 core.List<Insert2> items; | 1233 core.List<Insert2> items; |
1180 /** What kind of resource this is. */ | 1234 |
| 1235 /// What kind of resource this is. |
1181 core.String kind; | 1236 core.String kind; |
1182 /** Pagination token to fetch the next page, if one exists. */ | 1237 |
| 1238 /// Pagination token to fetch the next page, if one exists. |
1183 core.String nextPageToken; | 1239 core.String nextPageToken; |
1184 /** A URL to re-request this resource. */ | 1240 |
| 1241 /// A URL to re-request this resource. |
1185 core.String selfLink; | 1242 core.String selfLink; |
1186 | 1243 |
1187 List(); | 1244 List(); |
1188 | 1245 |
1189 List.fromJson(core.Map _json) { | 1246 List.fromJson(core.Map _json) { |
1190 if (_json.containsKey("items")) { | 1247 if (_json.containsKey("items")) { |
1191 items = _json["items"].map((value) => new Insert2.fromJson(value)).toList(
); | 1248 items = |
| 1249 _json["items"].map((value) => new Insert2.fromJson(value)).toList(); |
1192 } | 1250 } |
1193 if (_json.containsKey("kind")) { | 1251 if (_json.containsKey("kind")) { |
1194 kind = _json["kind"]; | 1252 kind = _json["kind"]; |
1195 } | 1253 } |
1196 if (_json.containsKey("nextPageToken")) { | 1254 if (_json.containsKey("nextPageToken")) { |
1197 nextPageToken = _json["nextPageToken"]; | 1255 nextPageToken = _json["nextPageToken"]; |
1198 } | 1256 } |
1199 if (_json.containsKey("selfLink")) { | 1257 if (_json.containsKey("selfLink")) { |
1200 selfLink = _json["selfLink"]; | 1258 selfLink = _json["selfLink"]; |
1201 } | 1259 } |
1202 } | 1260 } |
1203 | 1261 |
1204 core.Map<core.String, core.Object> toJson() { | 1262 core.Map<core.String, core.Object> toJson() { |
1205 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1263 final core.Map<core.String, core.Object> _json = |
| 1264 new core.Map<core.String, core.Object>(); |
1206 if (items != null) { | 1265 if (items != null) { |
1207 _json["items"] = items.map((value) => (value).toJson()).toList(); | 1266 _json["items"] = items.map((value) => (value).toJson()).toList(); |
1208 } | 1267 } |
1209 if (kind != null) { | 1268 if (kind != null) { |
1210 _json["kind"] = kind; | 1269 _json["kind"] = kind; |
1211 } | 1270 } |
1212 if (nextPageToken != null) { | 1271 if (nextPageToken != null) { |
1213 _json["nextPageToken"] = nextPageToken; | 1272 _json["nextPageToken"] = nextPageToken; |
1214 } | 1273 } |
1215 if (selfLink != null) { | 1274 if (selfLink != null) { |
1216 _json["selfLink"] = selfLink; | 1275 _json["selfLink"] = selfLink; |
1217 } | 1276 } |
1218 return _json; | 1277 return _json; |
1219 } | 1278 } |
1220 } | 1279 } |
1221 | 1280 |
1222 class OutputOutputMulti { | 1281 class OutputOutputMulti { |
1223 /** The class label. */ | 1282 /// The class label. |
1224 core.String label; | 1283 core.String label; |
1225 /** The probability of the class label. */ | 1284 |
| 1285 /// The probability of the class label. |
1226 core.String score; | 1286 core.String score; |
1227 | 1287 |
1228 OutputOutputMulti(); | 1288 OutputOutputMulti(); |
1229 | 1289 |
1230 OutputOutputMulti.fromJson(core.Map _json) { | 1290 OutputOutputMulti.fromJson(core.Map _json) { |
1231 if (_json.containsKey("label")) { | 1291 if (_json.containsKey("label")) { |
1232 label = _json["label"]; | 1292 label = _json["label"]; |
1233 } | 1293 } |
1234 if (_json.containsKey("score")) { | 1294 if (_json.containsKey("score")) { |
1235 score = _json["score"]; | 1295 score = _json["score"]; |
1236 } | 1296 } |
1237 } | 1297 } |
1238 | 1298 |
1239 core.Map<core.String, core.Object> toJson() { | 1299 core.Map<core.String, core.Object> toJson() { |
1240 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1300 final core.Map<core.String, core.Object> _json = |
| 1301 new core.Map<core.String, core.Object>(); |
1241 if (label != null) { | 1302 if (label != null) { |
1242 _json["label"] = label; | 1303 _json["label"] = label; |
1243 } | 1304 } |
1244 if (score != null) { | 1305 if (score != null) { |
1245 _json["score"] = score; | 1306 _json["score"] = score; |
1246 } | 1307 } |
1247 return _json; | 1308 return _json; |
1248 } | 1309 } |
1249 } | 1310 } |
1250 | 1311 |
1251 class Output { | 1312 class Output { |
1252 /** The unique name for the predictive model. */ | 1313 /// The unique name for the predictive model. |
1253 core.String id; | 1314 core.String id; |
1254 /** What kind of resource this is. */ | 1315 |
| 1316 /// What kind of resource this is. |
1255 core.String kind; | 1317 core.String kind; |
1256 /** The most likely class label (Categorical models only). */ | 1318 |
| 1319 /// The most likely class label (Categorical models only). |
1257 core.String outputLabel; | 1320 core.String outputLabel; |
1258 /** | 1321 |
1259 * A list of class labels with their estimated probabilities (Categorical | 1322 /// A list of class labels with their estimated probabilities (Categorical |
1260 * models only). | 1323 /// models only). |
1261 */ | |
1262 core.List<OutputOutputMulti> outputMulti; | 1324 core.List<OutputOutputMulti> outputMulti; |
1263 /** The estimated regression value (Regression models only). */ | 1325 |
| 1326 /// The estimated regression value (Regression models only). |
1264 core.String outputValue; | 1327 core.String outputValue; |
1265 /** A URL to re-request this resource. */ | 1328 |
| 1329 /// A URL to re-request this resource. |
1266 core.String selfLink; | 1330 core.String selfLink; |
1267 | 1331 |
1268 Output(); | 1332 Output(); |
1269 | 1333 |
1270 Output.fromJson(core.Map _json) { | 1334 Output.fromJson(core.Map _json) { |
1271 if (_json.containsKey("id")) { | 1335 if (_json.containsKey("id")) { |
1272 id = _json["id"]; | 1336 id = _json["id"]; |
1273 } | 1337 } |
1274 if (_json.containsKey("kind")) { | 1338 if (_json.containsKey("kind")) { |
1275 kind = _json["kind"]; | 1339 kind = _json["kind"]; |
1276 } | 1340 } |
1277 if (_json.containsKey("outputLabel")) { | 1341 if (_json.containsKey("outputLabel")) { |
1278 outputLabel = _json["outputLabel"]; | 1342 outputLabel = _json["outputLabel"]; |
1279 } | 1343 } |
1280 if (_json.containsKey("outputMulti")) { | 1344 if (_json.containsKey("outputMulti")) { |
1281 outputMulti = _json["outputMulti"].map((value) => new OutputOutputMulti.fr
omJson(value)).toList(); | 1345 outputMulti = _json["outputMulti"] |
| 1346 .map((value) => new OutputOutputMulti.fromJson(value)) |
| 1347 .toList(); |
1282 } | 1348 } |
1283 if (_json.containsKey("outputValue")) { | 1349 if (_json.containsKey("outputValue")) { |
1284 outputValue = _json["outputValue"]; | 1350 outputValue = _json["outputValue"]; |
1285 } | 1351 } |
1286 if (_json.containsKey("selfLink")) { | 1352 if (_json.containsKey("selfLink")) { |
1287 selfLink = _json["selfLink"]; | 1353 selfLink = _json["selfLink"]; |
1288 } | 1354 } |
1289 } | 1355 } |
1290 | 1356 |
1291 core.Map<core.String, core.Object> toJson() { | 1357 core.Map<core.String, core.Object> toJson() { |
1292 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1358 final core.Map<core.String, core.Object> _json = |
| 1359 new core.Map<core.String, core.Object>(); |
1293 if (id != null) { | 1360 if (id != null) { |
1294 _json["id"] = id; | 1361 _json["id"] = id; |
1295 } | 1362 } |
1296 if (kind != null) { | 1363 if (kind != null) { |
1297 _json["kind"] = kind; | 1364 _json["kind"] = kind; |
1298 } | 1365 } |
1299 if (outputLabel != null) { | 1366 if (outputLabel != null) { |
1300 _json["outputLabel"] = outputLabel; | 1367 _json["outputLabel"] = outputLabel; |
1301 } | 1368 } |
1302 if (outputMulti != null) { | 1369 if (outputMulti != null) { |
1303 _json["outputMulti"] = outputMulti.map((value) => (value).toJson()).toList
(); | 1370 _json["outputMulti"] = |
| 1371 outputMulti.map((value) => (value).toJson()).toList(); |
1304 } | 1372 } |
1305 if (outputValue != null) { | 1373 if (outputValue != null) { |
1306 _json["outputValue"] = outputValue; | 1374 _json["outputValue"] = outputValue; |
1307 } | 1375 } |
1308 if (selfLink != null) { | 1376 if (selfLink != null) { |
1309 _json["selfLink"] = selfLink; | 1377 _json["selfLink"] = selfLink; |
1310 } | 1378 } |
1311 return _json; | 1379 return _json; |
1312 } | 1380 } |
1313 } | 1381 } |
1314 | 1382 |
1315 class Update { | 1383 class Update { |
1316 /** | 1384 /// The input features for this instance. |
1317 * The input features for this instance. | 1385 /// |
1318 * | 1386 /// The values for Object must be JSON objects. It can consist of `num`, |
1319 * The values for Object must be JSON objects. It can consist of `num`, | 1387 /// `String`, `bool` and `null` as well as `Map` and `List` values. |
1320 * `String`, `bool` and `null` as well as `Map` and `List` values. | |
1321 */ | |
1322 core.List<core.Object> csvInstance; | 1388 core.List<core.Object> csvInstance; |
1323 /** The generic output value - could be regression or class label. */ | 1389 |
| 1390 /// The generic output value - could be regression or class label. |
1324 core.String output; | 1391 core.String output; |
1325 | 1392 |
1326 Update(); | 1393 Update(); |
1327 | 1394 |
1328 Update.fromJson(core.Map _json) { | 1395 Update.fromJson(core.Map _json) { |
1329 if (_json.containsKey("csvInstance")) { | 1396 if (_json.containsKey("csvInstance")) { |
1330 csvInstance = _json["csvInstance"]; | 1397 csvInstance = _json["csvInstance"]; |
1331 } | 1398 } |
1332 if (_json.containsKey("output")) { | 1399 if (_json.containsKey("output")) { |
1333 output = _json["output"]; | 1400 output = _json["output"]; |
1334 } | 1401 } |
1335 } | 1402 } |
1336 | 1403 |
1337 core.Map<core.String, core.Object> toJson() { | 1404 core.Map<core.String, core.Object> toJson() { |
1338 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1405 final core.Map<core.String, core.Object> _json = |
| 1406 new core.Map<core.String, core.Object>(); |
1339 if (csvInstance != null) { | 1407 if (csvInstance != null) { |
1340 _json["csvInstance"] = csvInstance; | 1408 _json["csvInstance"] = csvInstance; |
1341 } | 1409 } |
1342 if (output != null) { | 1410 if (output != null) { |
1343 _json["output"] = output; | 1411 _json["output"] = output; |
1344 } | 1412 } |
1345 return _json; | 1413 return _json; |
1346 } | 1414 } |
1347 } | 1415 } |
OLD | NEW |